data_source
stringclasses
4 values
prompt
listlengths
1
1
ability
stringclasses
1 value
reward_model
dict
extra_info
dict
codecontests
[ { "content": "The School β„–0 of the capital of Berland has n children studying in it. All the children in this school are gifted: some of them are good at programming, some are good at maths, others are good at PE (Physical Education). Hence, for each child we know value ti:\n\n * ti = 1, if the i-th child is g...
code
{ "ground_truth": "{\"inputs\": [\"4\\n2 1 1 2\\n\", \"7\\n1 3 1 3 2 1 2\\n\", \"3\\n2 1 2\\n\", \"5\\n1 2 2 3 3\\n\", \"220\\n1 1 3 1 3 1 1 3 1 3 3 3 3 1 3 3 1 3 3 3 3 3 1 1 1 3 1 1 1 3 2 3 3 3 1 1 3 3 1 1 3 3 3 3 1 3 3 1 1 1 2 3 1 1 1 2 3 3 3 2 3 1 1 3 1 1 1 3 2 1 3 2 3 1 1 3 3 3 1 3 1 1 1 3 3 2 1 3 2 1 1 3 3 1 1 1...
{ "index": 0, "split": "dummy" }
apps
[ { "content": "You are given an array $a_1, a_2, \\dots , a_n$ and two integers $m$ and $k$.\n\nYou can choose some subarray $a_l, a_{l+1}, \\dots, a_{r-1}, a_r$. \n\nThe cost of subarray $a_l, a_{l+1}, \\dots, a_{r-1}, a_r$ is equal to $\\sum\\limits_{i=l}^{r} a_i - k \\lceil \\frac{r - l + 1}{m} \\rceil$, wher...
code
{ "ground_truth": "{\n \"inputs\": [\n \"7 3 10\\n2 -4 15 -3 4 8 3\\n\",\n \"5 2 1000\\n-13 -4 -9 -20 -11\\n\",\n \"5 10 10\\n1000000000 1000000000 1000000000 1000000000 1000000000\\n\",\n \"1 1 1\\n2\\n\",\n \"5 10 10\\n1000000000 1000000000 -1000000000 1000000000 1000000000\\n\",\n \"6 2 5\\n2 2 ...
{ "index": 0, "split": "dummy" }
taco
[ { "content": "Two coordinates (a1, a2) and (b1, b2) on a two-dimensional grid of r Γ— c are given. The cost of moving from a cell (e, f) to one of the cells (e + 1, f), (e-1, f), (e, f + 1), (e, f-1) is 1. And. You can also move between (e, c-1) and (e, 0), and between (r-1, f) and (0, f) at a cost of 1. At this...
code
{ "ground_truth": "{\"inputs\": [\"500 500 0 0 107 200\", \"4 1 0 0 1 1\", \"4 4 1 0 3 3\", \"2 3 0 0 1 1\", \"500 500 0 0 107 239\", \"2 1 0 0 1 1\", \"678 500 0 0 107 168\", \"500 500 0 0 200 277\", \"500 500 1 0 107 239\", \"678 353 0 0 107 239\", \"1174 500 0 0 4 168\", \"272 500 0 0 200 277\", \"4 7 0 0 1 2\", \...
{ "index": 0, "split": "dummy" }
codeforces
[ { "content": "Title: Flipping Game\n\nTime Limit: None seconds\n\nMemory Limit: None megabytes\n\nProblem Description:\nIahub got bored, so he invented a game to be played on paper. \n\nHe writes *n* integers *a*1,<=*a*2,<=...,<=*a**n*. Each of those integers can be either 0 or 1. He's allowed to do exactly one...
code
{ "ground_truth": "{\"inputs\": [\"5\\n1 0 0 1 0\", \"4\\n1 0 0 1\", \"1\\n1\", \"1\\n0\", \"8\\n1 0 0 0 1 0 0 0\", \"18\\n0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0\", \"23\\n1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1\", \"100\\n0 1 0 1 1 1 0 1 0 1 0 0 1 1 1 1 0 0 1 1 1 1 1 1 1 0 0 1 1 1 0 1 1 0 0 0 1 1 1 1 0 0 1 1 1 0 ...
{ "index": 0, "split": "dummy" }
codecontests
[ { "content": "Let f(x) be the sum of digits of a decimal number x.\n\nFind the smallest non-negative integer x such that f(x) + f(x + 1) + ... + f(x + k) = n.\n\nInput\n\nThe first line contains one integer t (1 ≀ t ≀ 150) β€” the number of test cases.\n\nEach test case consists of one line containing two integer...
code
{ "ground_truth": "{\"inputs\": [\"7\\n1 0\\n1 1\\n42 7\\n13 7\\n99 1\\n99 0\\n99 2\\n\", \"2\\n13 9\\n17 9\\n\", \"2\\n13 9\\n27 9\\n\", \"7\\n1 0\\n1 1\\n42 7\\n13 7\\n64 1\\n99 0\\n99 2\\n\", \"2\\n17 9\\n47 9\\n\", \"7\\n1 0\\n1 1\\n42 7\\n1 9\\n64 0\\n99 0\\n99 2\\n\", \"7\\n1 0\\n2 1\\n42 7\\n1 9\\n64 0\\n99 0\...
{ "index": 0, "split": "dummy" }
apps
[ { "content": "Given are an integer N and arrays S, T, U, and V, each of length N.\nConstruct an NΓ—N matrix a that satisfy the following conditions:\n - a_{i,j} is an integer.\n - 0 \\leq a_{i,j} \\lt 2^{64}.\n - If S_{i} = 0, the bitwise AND of the elements in the i-th row is U_{i}.\n - If S_{i} = 1, the bitwi...
code
{ "ground_truth": "{\"inputs\": [\"2\\n0 1\\n1 0\\n1 1\\n1 0\\n\", \"2\\n1 1\\n1 0\\n15 15\\n15 11\\n\"], \"outputs\": [\"1 1\\n1 0\\n\", \"15 11\\n15 11\\n\"]}", "style": "rule" }
{ "index": 0, "split": "dummy" }
taco
[ { "content": "Today is the judgment day of Pokemons worldcup and all the audience are waiting outside the stadium. Many families has come to see the world cup (say N). Each family has atleast one and atmost four members and they want to seat together. The sitting arrangement in the stadium is such that one ro...
code
{ "ground_truth": "{\"inputs\": [\"10\\n3\\n3 2 2\\n3\\n2 4 2\\n3\\n3 4 3\\n3\\n2 2 1\\n3\\n1 3 3\\n3\\n4 4 1\\n3\\n3 3 2\\n3\\n4 2 4\\n3\\n4 3 4\\n3\\n4 3 2\", \"10\\n3\\n3 1 4\\n3\\n2 1 4\\n3\\n3 1 2\\n4\\n4 4 3 2\\n4\\n1 4 3 1\\n4\\n2 2 4 1\\n4\\n3 2 1 2\\n5\\n2 4 2 3 4\\n5\\n1 3 4 1 3\\n5\\n1 1 2 4 2\", \"10\\n5\...
{ "index": 0, "split": "dummy" }
codecontests
[ { "content": "Bike loves looking for the second maximum element in the sequence. The second maximum element in the sequence of distinct numbers x1, x2, ..., xk (k > 1) is such maximum element xj, that the following inequality holds: <image>.\n\nThe lucky number of the sequence of distinct positive integers x1, ...
code
{ "ground_truth": "{\"inputs\": [\"5\\n9 8 3 5 7\\n\", \"5\\n5 2 1 4 3\\n\", \"10\\n29272229 8752316 10025994 52398694 57994948 49609605 28150935 66061676 44865054 87041483\\n\", \"10\\n3106954 3413954 3854371 85952704 17834583 20954227 58810981 7460648 97908613 97965110\\n\", \"10\\n4547989 39261040 94929326 3813145...
{ "index": 0, "split": "dummy" }
codecontests
[ { "content": "We have a permutation p = {p_1,\\ p_2,\\ ...,\\ p_n} of {1,\\ 2,\\ ...,\\ n}.\n\nPrint the number of elements p_i (1 < i < n) that satisfy the following condition:\n\n* p_i is the second smallest number among the three numbers p_{i - 1}, p_i, and p_{i + 1}.\n\nConstraints\n\n* All values in input ...
code
{ "ground_truth": "{\"inputs\": [\"9\\n9 6 3 2 5 8 7 4 1\", \"5\\n1 3 5 4 2\", \"9\\n9 6 3 2 5 14 7 4 1\", \"5\\n2 3 5 4 2\", \"9\\n14 17 3 4 5 25 7 4 0\", \"5\\n2 1 5 4 2\", \"9\\n14 12 3 2 9 14 1 4 0\", \"5\\n2 6 4 8 3\", \"9\\n14 6 3 2 5 14 7 4 1\", \"9\\n14 6 3 2 5 14 7 4 0\", \"9\\n14 12 3 2 5 14 7 4 0\", \"9\\n...
{ "index": 0, "split": "dummy" }
codeforces
[ { "content": "Title: Common ancestor\n\nTime Limit: 5 seconds\n\nMemory Limit: 256 megabytes\n\nProblem Description:\nThe DNA sequence for every living creature in Berland can be represented as a non-empty line consisting of lowercase Latin letters. Berland scientists found out that all the creatures evolve by ...
code
{ "ground_truth": "{\"inputs\": [\"ababa\\naba\\n2\\nc->ba\\nc->cc\", \"ababa\\naba\\n7\\nc->ba\\nc->cc\\ne->ab\\nz->ea\\nb->ba\\nd->dd\\nd->ab\", \"ababa\\naba\\n1\\nc->ba\", \"mvo\\nmx\\n5\\nu->dl\\nt->fb\\nx->vo\\nn->kq\\na->ca\", \"bxr\\nbxr\\n5\\nw->jk\\nm->ie\\nh->ab\\nu->sy\\nj->gj\", \"oaujn\\noaemvsbb\\n50\\...
{ "index": 0, "split": "dummy" }
apps
[ { "content": "Normally, the factorial of a positive integer nΒ is the product of all positive integers less than or equal to n.Β  For example, factorial(10) = 10 * 9 * 8 * 7 * 6 * 5 * 4 * 3 * 2 * 1.\nWe instead make a clumsy factorial:Β using the integers in decreasing order, weΒ swap out the multiply operations fo...
code
{ "ground_truth": "{\"fn_name\": \"clumsy\", \"inputs\": [[4]], \"outputs\": [7]}", "style": "rule" }
{ "index": 0, "split": "dummy" }
apps
[ { "content": "You are given a image with a height of H pixels and a width of W pixels.\nEach pixel is represented by a lowercase English letter.\nThe pixel at the i-th row from the top and j-th column from the left is a_{ij}.\nPut a box around this image and output the result. The box should consist of # and ha...
code
{ "ground_truth": "{\"inputs\": [\"2 3\\nabc\\narc\\n\", \"1 1\\nz\\n\"], \"outputs\": [\"#####\\n#abc#\\n#arc#\\n#####\\n\", \"###\\n#z#\\n###\\n\"]}", "style": "rule" }
{ "index": 0, "split": "dummy" }
taco
[ { "content": "Music Macro Language (MML) is a language for textual representation of musical scores. Although there are various dialects of MML, all of them provide a set of commands to describe scores, such as commands for notes, rests, octaves, volumes, and so forth.\n\nIn this problem, we focus on rests, i.e...
code
{ "ground_truth": "{\"inputs\": [\"3\\nR2R2\\nR2R1R4R8R16R32R64\\nR1R4R16\", \"3\\nR2R1\\nR2R1R4R8R16R32R64\\nR1R4R16\", \"3\\nR2R1\\nR2R2R4R8R16R32R64\\nR1R4R16\", \"3\\nR1R1\\nR2R1R4R8R16R32R64\\nR1R4R16\", \"3\\nR2R1\\nR2R1R4R8R16R32R64\\nR2R4R16\", \"3\\nR2R2\\nR1R2R4R8R16R326R4\\nR1R4R16\", \"3\\nR2R2\\nR1R2R4R8...
{ "index": 0, "split": "dummy" }
codecontests
[ { "content": "Takahashi, who lives on the number line, is now at coordinate X. He will make exactly K moves of distance D in the positive or negative direction.\n\nMore specifically, in one move, he can go from coordinate x to x + D or x - D.\n\nHe wants to make K moves so that the absolute value of the coordin...
code
{ "ground_truth": "{\"inputs\": [\"1000000000000000 1000000000000000 1000000000000000\", \"6 2 4\", \"10 1 2\", \"7 4 3\", \"1000000000000000 1000100000000000 1000000000000000\", \"3 2 4\", \"10 1 4\", \"7 6 3\", \"7 0 3\", \"13 0 3\", \"1000100000000000 1000101000000000 1000000001000000\", \"13 1 3\", \"100010010000...
{ "index": 0, "split": "dummy" }
codecontests
[ { "content": "In the advanced algorithm class, n2 students sit in n rows and n columns. One day, a professor who teaches this subject comes into the class, asks the shortest student in each row to lift up his left hand, and the tallest student in each column to lift up his right hand. What is the height of the ...
code
{ "ground_truth": "{\"inputs\": [\"3\\n1 2 3\\n4 5 6\\n7 8 9\\n3\\n1 2 3\\n7 8 9\\n4 5 6\\n0\", \"3\\n1 2 3\\n4 5 6\\n7 10 9\\n3\\n1 2 3\\n7 8 9\\n4 5 6\\n0\", \"3\\n1 2 3\\n4 5 6\\n7 10 9\\n3\\n1 2 3\\n7 8 6\\n4 5 6\\n0\", \"3\\n1 2 3\\n4 5 6\\n7 10 9\\n3\\n1 2 3\\n2 8 9\\n4 5 6\\n0\", \"3\\n1 2 3\\n4 5 6\\n7 10 9\\...
{ "index": 0, "split": "dummy" }
codeforces
[ { "content": "Title: Beautiful Road\n\nTime Limit: 1 seconds\n\nMemory Limit: 256 megabytes\n\nProblem Description:\nA long time ago in some country in Asia were civil wars.\n\nEach of *n* cities wanted to seize power. That's why sometimes one city gathered an army and sent it to campaign against another city.\...
code
{ "ground_truth": "{\"inputs\": [\"2\\n2 1 5\", \"6\\n1 2 1\\n1 3 5\\n3 4 2\\n3 5 3\\n3 6 4\", \"10\\n10 6 43981\\n4 2 6730\\n1 2 35174\\n5 3 61951\\n8 7 43981\\n7 1 6730\\n5 8 6730\\n9 3 52479\\n6 4 18138\", \"9\\n6 4 72697\\n9 6 72697\\n1 6 38220\\n2 6 38220\\n6 7 72697\\n6 5 72697\\n8 6 72697\\n3 6 38220\", \"10\\...
{ "index": 0, "split": "dummy" }
codecontests
[ { "content": "A company of n friends wants to order exactly two pizzas. It is known that in total there are 9 pizza ingredients in nature, which are denoted by integers from 1 to 9.\n\nEach of the n friends has one or more favorite ingredients: the i-th of friends has the number of favorite ingredients equal to...
code
{ "ground_truth": "{\"inputs\": [\"1 5\\n9 9 8 7 6 5 4 3 2 1\\n3 4 1 2 3 4\\n1 4 5 6 7 8\\n4 4 1 3 5 7\\n1 4 2 4 6 8\\n5 4 1 9 2 8\\n\", \"3 4\\n2 6 7\\n4 2 3 9 5\\n3 2 3 9\\n100 1 7\\n400 3 3 2 5\\n100 2 9 2\\n500 3 2 9 5\\n\", \"4 3\\n1 1\\n1 2\\n1 3\\n1 4\\n10 4 1 2 3 4\\n20 4 1 2 3 4\\n30 4 1 2 3 4\\n\", \"3 3\\n...
{ "index": 0, "split": "dummy" }
taco
[ { "content": "Given a Circular Linked List of size N. The task is to delete the given node (excluding the first and last node) in the circular linked list and then print the reverse of the circular linked list.\n \nExample 1:\nInput:\n5\n2 5 7 8 10\n8\nOutput:\n10 7 5 2\nExplanation: \nAfter deleting 8 from the...
code
{ "ground_truth": "{\"inputs\": [\"5\\n2 5 7 8 10\\n8\", \"4\\n1 7 8 10\\n8\"], \"outputs\": [\"10 7 5 2\", \"10 7 1\"]}", "style": "rule" }
{ "index": 0, "split": "dummy" }
taco
[ { "content": "Example\n\nInput\n\n1\n\n\nOutput\n\n)(\n\nWrite Python code to solve the problem. Present the code in \n```python\nYour code\n```\nat the end.", "role": "user" } ]
code
{ "ground_truth": "{\"inputs\": [\"2\", \"4\", \"3\", \"5\", \"6\", \"9\", \"7\", \"8\", \"12\", \"22\", \"11\", \"13\", \"14\", \"17\", \"10\", \"33\", \"16\", \"23\", \"25\", \"43\", \"35\", \"15\", \"26\", \"32\", \"29\", \"55\", \"77\", \"85\", \"114\", \"61\", \"28\", \"41\", \"19\", \"31\", \"20\", \"36\", \"21...
{ "index": 0, "split": "dummy" }
taco
[ { "content": "# Task\n Four men, `a, b, c and d` are standing in a line, one behind another. \n \n There's a wall between the first three people (a, b and c) and the last one (d).\n \n a, b and c are lined up in order of height, so that person a can see the backs of b and c, person b can see the back of c, and ...
code
{ "ground_truth": "{\"fn_name\": \"guess_hat_color\", \"inputs\": [[\"white\", \"black\", \"white\", \"black\"], [\"white\", \"black\", \"black\", \"white\"]], \"outputs\": [[2], [1]]}", "style": "rule" }
{ "index": 0, "split": "dummy" }
codecontests
[ { "content": "We'll call a set of positive integers a beautiful if the following condition fulfills: for any prime p, if <image>, then <image>. In other words, if one number from the set is divisible by prime p, then at least half of numbers from the set is divisible by p.\n\nYour task is to find any beautiful ...
code
{ "ground_truth": "{\"inputs\": [\"10\\n\", \"31\\n\", \"11\\n\", \"32\\n\", \"14\\n\", \"30\\n\", \"20\\n\", \"777\\n\", \"53\\n\", \"3232\\n\", \"41\\n\", \"2521\\n\", \"12\\n\", \"666\\n\", \"4848\\n\", \"2001\\n\", \"87\\n\", \"29\\n\", \"1500\\n\", \"28\\n\", \"4444\\n\", \"103\\n\", \"5000\\n\", \"4777\\n\", \"...
{ "index": 0, "split": "dummy" }
taco
[ { "content": "If you can't sleep, just count sheep!!\n\n## Task:\nGiven a non-negative integer, `3` for example, return a string with a murmur: `\"1 sheep...2 sheep...3 sheep...\"`. Input will always be valid, i.e. no negative integers.\n\nWrite Python code to solve the problem. Present the code in \n```python...
code
{ "ground_truth": "{\"fn_name\": \"count_sheep\", \"inputs\": [[3]], \"outputs\": [[\"1 sheep...2 sheep...3 sheep...\"]]}", "style": "rule" }
{ "index": 0, "split": "dummy" }
apps
[ { "content": "We have weather records at AtCoder Town for some consecutive three days. A string of length 3, S, represents the records - if the i-th character is S, it means it was sunny on the i-th day; if that character is R, it means it was rainy on that day.\nFind the maximum number of consecutive rainy day...
code
{ "ground_truth": "{\"inputs\": [\"RRS\\n\", \"SSS\\n\", \"RSR\\n\", \"SRS\\n\", \"SSR\\n\", \"RRR\\n\", \"RSS\\n\", \"SRR\\n\"], \"outputs\": [\"2\\n\", \"0\\n\", \"1\\n\", \"1\\n\", \"1\\n\", \"3\\n\", \"1\\n\", \"2\\n\"]}", "style": "rule" }
{ "index": 0, "split": "dummy" }
codecontests
[ { "content": "Snuke and Raccoon have a heap of N cards. The i-th card from the top has the integer a_i written on it.\n\nThey will share these cards. First, Snuke will take some number of cards from the top of the heap, then Raccoon will take all the remaining cards. Here, both Snuke and Raccoon have to take at...
code
{ "ground_truth": "{\"inputs\": [\"6\\n1 2 3 4 5 6\", \"2\\n10 -10\", \"6\\n0 2 3 4 5 6\", \"2\\n0 -10\", \"6\\n0 2 3 7 5 6\", \"2\\n0 -19\", \"6\\n-1 2 3 7 5 6\", \"2\\n1 -19\", \"2\\n1 -33\", \"2\\n0 -33\", \"6\\n1 2 3 7 8 8\", \"2\\n-1 -33\", \"6\\n1 2 3 7 8 13\", \"2\\n-1 -47\", \"6\\n1 3 3 7 8 13\", \"2\\n-1 -75...
{ "index": 0, "split": "dummy" }
codecontests
[ { "content": "Takahashi loves palindromes. Non-palindromic strings are unacceptable to him. Each time he hugs a string, he can change one of its characters to any character of his choice.\n\nGiven is a string S. Find the minimum number of hugs needed to make S palindromic.\n\nConstraints\n\n* S is a string cons...
code
{ "ground_truth": "{\"inputs\": [\"abcdabc\", \"redcoder\", \"vvvvvv\", \"aacdabc\", \"redocder\", \"vwwvvv\", \"rdebrdeo\", \"uuxxuu\", \"wvvvvv\", \"aacbadc\", \"reeocddr\", \"vvvvvw\", \"cdabcaa\", \"rddcoeer\", \"vwvvvv\", \"ccabcaa\", \"rddboeer\", \"aacbacc\", \"rdeboder\", \"vvvwwv\", \"aaccacc\", \"vvvwxv\", ...
{ "index": 0, "split": "dummy" }
codecontests
[ { "content": "Everyone who has played Cut the Rope knows full well how the gameplay is organized. All levels in the game are divided into boxes. Initially only one box with some levels is available. Player should complete levels to earn stars, collecting stars opens new box with levels.\n\n<image>\n\nImagine th...
code
{ "ground_truth": "{\"inputs\": [\"2 3\\n1 2\\n1 2\\n\", \"5 3\\n10 20\\n5 10\\n10 20\\n6 9\\n25 30\\n\", \"6 7\\n8 10\\n6 10\\n1 3\\n2 7\\n4 10\\n3 7\\n\", \"10 16\\n9 10\\n2 4\\n1 10\\n1 7\\n6 7\\n7 10\\n4 5\\n7 9\\n7 10\\n1 10\\n\", \"13 14\\n1 4\\n1 5\\n3 9\\n5 8\\n6 7\\n3 8\\n7 8\\n6 8\\n8 10\\n5 6\\n9 10\\n4 5\...
{ "index": 0, "split": "dummy" }
codecontests
[ { "content": "We have a S cm long stick.It can be broken only at certain\npositions.Sarah wants to calculate the number of GOOD Pairs.\nIt satisfies the following conditions\nA good pair consists of 2 distinct positions where the stick can be\n broken.\nWhen the stick is broken at these two positions there sh...
code
{ "ground_truth": "{\"inputs\": [\"2\\n10 2 6\\n1 3\\n10 3 5\\n1 3 9\\n\\nSAMPLE\", \"7\\n100 3 25\\n25 50 75\\n100 3 50\\n25 50 75\\n100 3 24\\n25 50 75\\n100 9 50\\n99 88 77 66 55 44 33 22 11\\n100 11 71\\n67 21 90 77 19 38 85 91 23 29 42\\n100 2 50\\n50 51\\n100 2 49\\n50 51\"], \"outputs\": [\"1\\n3\", \"3\\n0\\n...
{ "index": 0, "split": "dummy" }
codecontests
[ { "content": "Given is an integer N. Find the number of digits that N has in base K.\n\nConstraints\n\n* All values in input are integers.\n* 1 \\leq N \\leq 10^9\n* 2 \\leq K \\leq 10\n\nInput\n\nInput is given from Standard Input in the following format:\n\n\nN K\n\n\nOutput\n\nPrint the number of digits that...
code
{ "ground_truth": "{\"inputs\": [\"11 2\", \"314159265 3\", \"1010101 10\", \"22 2\", \"279134799 3\", \"1011101 10\", \"1010001 2\", \"29240007 3\", \"1010001 3\", \"1010001 5\", \"0110111 5\", \"0110111 9\", \"314159265 4\", \"15 2\", \"550505180 3\", \"49139062 3\", \"1011111 4\", \"1 2\", \"49139062 5\", \"893161...
{ "index": 0, "split": "dummy" }
taco
[ { "content": "You have N coins each of which has a value ai. Find the number of combinations that result when you choose K different coins in such a way that the total value of the coins is greater than or equal to L and less than or equal to R.\n\nConstraints\n\n* 1 ≀ K ≀ N ≀ 40\n* 1 ≀ ai ≀ 1016\n* 1 ≀ L ≀ R ≀...
code
{ "ground_truth": "{\"inputs\": [\"5 2 7 19\\n6 5 4 2 2\", \"2 2 2 9\\n5 1\", \"5 2 7 19\\n2 5 4 2 2\", \"2 2 2 9\\n9 1\", \"5 4 7 19\\n2 5 4 2 2\", \"5 2 7 19\\n3 5 4 2 3\", \"5 3 7 19\\n6 5 1 2 2\", \"5 4 7 19\\n1 5 1 2 -1\", \"5 3 7 17\\n0 5 4 2 3\", \"2 1 1 9\\n6 1\", \"2 2 2 9\\n9 2\", \"5 4 7 19\\n1 5 4 2 2\", ...
{ "index": 0, "split": "dummy" }
apps
[ { "content": "We often have to copy large volumes of information. Such operation can take up many computer resources. Therefore, in this problem you are advised to come up with a way to copy some part of a number array into another one, quickly.\n\nMore formally, you've got two arrays of integers a_1, a_2, ...,...
code
{ "ground_truth": "{\n \"inputs\": [\n \"5 10\\n1 2 0 -1 3\\n3 1 5 -2 0\\n2 5\\n1 3 3 3\\n2 5\\n2 4\\n2 1\\n1 2 1 4\\n2 1\\n2 4\\n1 4 2 1\\n2 2\\n\",\n \"1 4\\n-2\\n1\\n1 1 1 1\\n2 1\\n1 1 1 1\\n1 1 1 1\\n\",\n \"2 5\\n-3 2\\n3 -4\\n1 1 1 2\\n2 1\\n2 1\\n1 2 2 1\\n2 1\\n\",\n \"3 6\\n4 -3 0\\n1 3 -5\\n2 ...
{ "index": 0, "split": "dummy" }
codecontests
[ { "content": "Problem\n\nIt seems that a magician with a smoky smell will show off his magic.\n\n\"Now, think of one favorite integer.\"\nYou decide to think of your counting years in your head.\n\nThe magician has thrown the query $ N $ times.\nEach query is one of the following:\n\n\n1. \"Multiply the number ...
code
{ "ground_truth": "{\"inputs\": [\"3\\n1 2\\n2 10\\n3 8\", \"10\\n1 10\\n1 10\\n1 10\\n1 10\\n1 10\\n1 10\\n1 10\\n1 10\\n1 10\\n1 10\", \"3\\n1 2\\n2 10\\n2 8\", \"10\\n1 10\\n1 10\\n1 10\\n1 10\\n2 10\\n1 10\\n1 10\\n1 10\\n1 10\\n1 10\", \"3\\n1 2\\n1 10\\n2 8\", \"3\\n1 1\\n1 10\\n2 8\", \"3\\n1 1\\n1 10\\n2 13\"...
{ "index": 0, "split": "dummy" }
apps
[ { "content": "Ashish has $n$ elements arranged in a line. \n\nThese elements are represented by two integers $a_i$Β β€” the value of the element and $b_i$Β β€” the type of the element (there are only two possible types: $0$ and $1$). He wants to sort the elements in non-decreasing values of $a_i$.\n\nHe can perform t...
code
{ "ground_truth": "{\n \"inputs\": [\n \"5\\n4\\n10 20 20 30\\n0 1 0 1\\n3\\n3 1 2\\n0 1 1\\n4\\n2 2 4 8\\n1 1 1 1\\n3\\n5 15 4\\n0 0 0\\n4\\n20 10 100 50\\n1 0 0 1\\n\",\n \"10\\n4\\n61984 85101 45152 74839\\n1 0 0 1\\n4\\n4214 35436 84747 99946\\n0 0 1 1\\n3\\n79565 44828 8501\\n1 0 1\\n1\\n38344\\n0\\n2\\n3...
{ "index": 0, "split": "dummy" }
codecontests
[ { "content": "Chef has a nice complete binary tree in his garden. Complete means that each node has exactly two sons, so the tree is infinite. Yesterday he had enumerated the nodes of the tree in such a way: \n\nLet's call the nodes' level a number of nodes that occur on the way to this node from the root, incl...
code
{ "ground_truth": "{\"inputs\": [\"4\\nlrl\\nrll\\nr\\nlllr\", \"4\\nrll\\nrll\\nr\\nlllr\", \"4\\nlrl\\nrll\\nr\\nrlll\", \"4\\nlrl\\nrll\\nr\\nllrl\", \"4\\nrll\\nllr\\nr\\nlllr\", \"4\\nrll\\nrll\\nr\\nllrl\", \"4\\nrll\\nllr\\nr\\nrlll\", \"4\\nllr\\nllr\\nr\\nrlll\", \"4\\nllr\\nrll\\nr\\nrlll\", \"4\\nrll\\nrll...
{ "index": 0, "split": "dummy" }
codecontests
[ { "content": "\"The Chamber of Secrets has been opened again\" β€” this news has spread all around Hogwarts and some of the students have been petrified due to seeing the basilisk. Dumbledore got fired and now Harry is trying to enter the Chamber of Secrets. These aren't good news for Lord Voldemort. The problem ...
code
{ "ground_truth": "{\"inputs\": [\"3 3\\n.#.\\n...\\n.#.\\n\", \"4 3\\n##.\\n...\\n.#.\\n.#.\\n\", \"5 5\\n.....\\n.#...\\n.....\\n.....\\n#.###\\n\", \"3 4\\n..##\\n....\\n..#.\\n\", \"2 42\\n..........#.......#..........###........#.\\n.....#######.......#..#....#...##.........\\n\", \"6 8\\n...##...\\n.#.#.#.#\\n#...
{ "index": 0, "split": "dummy" }
taco
[ { "content": "# Task\n\nGiven an array of integers, sum consecutive even numbers and consecutive odd numbers. Repeat the process while it can be done and return the length of the final array.\n\n# Example\n\nFor `arr = [2, 1, 2, 2, 6, 5, 0, 2, 0, 5, 5, 7, 7, 4, 3, 3, 9]`\n \nThe result should be `6`.\n\n```\n[2...
code
{ "ground_truth": "{\"fn_name\": \"sum_groups\", \"inputs\": [[[2, 1, 2, 2, 6, 5, 0, 2, 0, 5, 5, 7, 7, 4, 3, 3, 9]], [[2, 1, 2, 2, 6, 5, 0, 2, 0, 3, 3, 3, 9, 2]], [[2]], [[1, 2]], [[1, 1, 2, 2]]], \"outputs\": [[6], [5], [1], [2], [1]]}", "style": "rule" }
{ "index": 0, "split": "dummy" }
apps
[ { "content": "In Finite Encyclopedia of Integer Sequences (FEIS), all integer sequences of lengths between 1 and N (inclusive) consisting of integers between 1 and K (inclusive) are listed.\nLet the total number of sequences listed in FEIS be X. Among those sequences, find the (X/2)-th (rounded up to the neares...
code
{ "ground_truth": "{\"inputs\": [\"3 2\\n\", \"2 4\\n\", \"5 14\\n\"], \"outputs\": [\"2 1 \\n\", \"1 2 2 2\\n\", \"3 3 3 3 3 3 3 3 3 3 3 3 2 2 \\n\"]}", "style": "rule" }
{ "index": 0, "split": "dummy" }
taco
[ { "content": "In this kata, you have to define a function named **func** that will take a list as input.\n\nYou must try and guess the pattern how we get the output number and return list - **[output number,binary representation,octal representation,hexadecimal representation]**, but **you must convert that spe...
code
{ "ground_truth": "{\"fn_name\": \"func\", \"inputs\": [[[1, 4, 9, 16, 25, 36, 49]], [[2, 31, 3, 56, 46, 3, 467, 33]], [[9, 99, 999, 9999]], [[1, 12, 123, 1234, 12345]], [[1, 2, 6, 3, 1, 577, 12]]], \"outputs\": [[[20, \"10100\", \"24\", \"14\"]], [[80, \"1010000\", \"120\", \"50\"]], [[2776, \"101011011000\", \"5330...
{ "index": 0, "split": "dummy" }
codecontests
[ { "content": "One day three best friends Petya, Vasya and Tonya decided to form a team and take part in programming contests. Participants are usually offered several problems during programming contests. Long before the start the friends decided that they will implement a problem if at least two of them are su...
code
{ "ground_truth": "{\"inputs\": [\"2\\n1 0 0\\n0 1 1\\n\", \"3\\n1 1 0\\n1 1 1\\n1 0 0\\n\", \"1\\n1 0 0\\n\", \"16\\n1 1 1\\n1 1 1\\n1 1 1\\n1 1 1\\n1 1 1\\n1 1 1\\n1 1 1\\n1 1 1\\n1 1 1\\n1 1 1\\n1 1 1\\n1 1 1\\n1 1 1\\n1 1 1\\n1 1 1\\n1 1 1\\n\", \"1\\n1 1 1\\n\", \"10\\n0 1 0\\n0 1 0\\n1 1 0\\n1 0 0\\n0 0 1\\n0 1...
{ "index": 0, "split": "dummy" }
apps
[ { "content": "Task:\nMake a function that converts a word to pig latin. The rules of pig latin are:\n\n```\nIf the word has more than 3 letters:\n 1. Take the first letter of a word and move it to the end\n 2. Add -ay to the word\nOtherwise leave the word alone.\n```\n\nExample: `hello` = `ellohay`\n\nWrite P...
code
{ "ground_truth": "{\"fn_name\": \"pig_latin\", \"inputs\": [[\"hello\"], [\"hi\"]], \"outputs\": [[\"ellohay\"], [\"hi\"]]}", "style": "rule" }
{ "index": 0, "split": "dummy" }
taco
[ { "content": "Find the difference between two collections. The difference means that either the character is present in one collection or it is present in other, but not in both. Return a sorted set with difference.\n\nThe collections can contain any character and can contain duplicates.\n\nFor instance:\n\nA =...
code
{ "ground_truth": "{\"fn_name\": \"diff\", \"inputs\": [[[\"a\", \"b\"], [\"a\", \"b\"]], [[], []]], \"outputs\": [[[]], [[]]]}", "style": "rule" }
{ "index": 0, "split": "dummy" }
taco
[ { "content": "Indian National Olympiad in Informatics 2012\nYou are given a table with 2 rows and N columns. Each cell has an integer in it. The score of such a table is defined as follows: for each column, consider the sum of the two numbers in the column; the maximum of the N numbers so obtained is the score....
code
{ "ground_truth": "{\"inputs\": [\"6\\n1 2 3 4 5 6\\n\", \"4\\n1 1 1 1\\n\", \"2\\n100000 100000\\n\", \"3\\n1 100000 100000\\n\", \"2\\n100000 100000\\n\", \"3\\n1 1 100000\\n\", \"3\\n100000 100000 100000\\n\", \"3\\n1 100000 200000\\n\", \"4\\n1 100000 200000 300000\\n\"], \"outputs\": [\"12 11 10 9 10 11\", \"5 5...
{ "index": 0, "split": "dummy" }
taco
[ { "content": "Zubin is the dark messiah. He roams the streets at night, helping the poor and the innocent from evil. He's Batman.\nGhosh is Zubin's nemesis. He's the Riddler to Zubin's Batman. He delights in torturing people with his puzzles.\nTonight, Ghosh has gotten hold of yet another innocent victim. When ...
code
{ "ground_truth": "{\"inputs\": [\"10\\n\\n562189\\n8112316\\n9855612318\\n8548\\n12385561\\n118\\n0\\n452157848\\n44512\\n855\"], \"outputs\": [\"2988369\\n52526037\\n94213633266\\n29900\\n82470764\\n195\\n1\\n3717187680\\n187585\\n2138\"]}", "style": "rule" }
{ "index": 0, "split": "dummy" }
taco
[ { "content": "Given an Array of length $N$ containing elements $Ai$ ( i = 1 to n ) . You have to handle $Q$ queries on this array . Each Query is of two types k=(1 or 2). \nType 1:- $k$ $l$ $r$ in which you have to tell whether the product of numbers in range l to r results in a perfect square or not. if prod...
code
{ "ground_truth": "{\"inputs\": [[\"4\", \"2 2 3 4\", \"4\", \"1 1 2\", \"1 3 4\", \"2 3 3\", \"1 1 4\"]], \"outputs\": [[\"YES\", \"NO\", \"YES\"]]}", "style": "rule" }
{ "index": 0, "split": "dummy" }
codecontests
[ { "content": "As you very well know, the whole Universe traditionally uses three-dimensional Cartesian system of coordinates. In this system each point corresponds to three real coordinates (x, y, z). In this coordinate system, the distance between the center of the Universe and the point is calculated by the f...
code
{ "ground_truth": "{\"inputs\": [\"3\\n1 1 1\\n\", \"3\\n2 0 0\\n\", \"10\\n0 0 0\\n\", \"557\\n84 654 154\\n\", \"1000\\n197 198 199\\n\", \"5\\n0 0 0\\n\", \"9\\n8 2 0\\n\", \"1\\n1000 1000 1000\\n\", \"1000\\n117 403 270\\n\", \"1\\n0 0 0\\n\", \"706\\n197 265 571\\n\", \"1000\\n0 1 1\\n\", \"938\\n414 308 795\\n\...
{ "index": 0, "split": "dummy" }
codecontests
[ { "content": "Johnny needs to make a rectangular box for his physics class project. He has bought P cm of wire and S cm^2 of special paper. He would like to use all the wire (for the 12 edges) and paper (for the 6 sides) to make the box.\nWhat is the largest volume of the box that Johnny can make?\n\nInput\nThe...
code
{ "ground_truth": "{\"inputs\": [\"2\\n20 14\\n20 16\", \"2\\n20 14\\n20 14\", \"2\\n32 14\\n20 14\", \"2\\n20 14\\n36 14\", \"2\\n20 8\\n36 14\", \"2\\n28 8\\n36 14\", \"2\\n20 16\\n20 14\", \"2\\n32 20\\n20 14\", \"2\\n20 14\\n20 10\", \"2\\n20 16\\n20 10\", \"2\\n20 4\\n20 10\", \"2\\n32 14\\n20 4\", \"2\\n20 8\\n...
{ "index": 0, "split": "dummy" }
apps
[ { "content": "Taru likes reading. Every month he gets a copy of the magazine \"BIT\". The magazine contains information about the latest advancements in technology. Taru \n\nreads the book at night and writes the page number to which he has read on a piece of paper so that he can continue from there the next d...
code
{ "ground_truth": "{\"inputs\": [[\"2\", \"10\", \"2 1 2\", \"2\", \"10\", \"1 8\", \"0\"]], \"outputs\": [[\"31.2000\", \"47.0000\"]]}", "style": "rule" }
{ "index": 0, "split": "dummy" }
codecontests
[ { "content": "You are at a water bowling training. There are l people who play with their left hand, r people, who play with their right hand, and a ambidexters, who can play with left or right hand.\n\nThe coach decided to form a team of even number of players, exactly half of the players should play with thei...
code
{ "ground_truth": "{\"inputs\": [\"0 2 0\\n\", \"1 4 2\\n\", \"5 5 5\\n\", \"89 44 76\\n\", \"100 100 0\\n\", \"1 2 1\\n\", \"32 61 89\\n\", \"2 2 2\\n\", \"0 0 2\\n\", \"77 76 73\\n\", \"1 2 2\\n\", \"4 86 74\\n\", \"1 4 0\\n\", \"58 3 65\\n\", \"1 2 3\\n\", \"10 8 7\\n\", \"0 1 1\\n\", \"92 9 28\\n\", \"100 0 0\\n\...
{ "index": 0, "split": "dummy" }
apps
[ { "content": "Imp is in a magic forest, where xorangles grow (wut?)\n\n [Image] \n\nA xorangle of order n is such a non-degenerate triangle, that lengths of its sides are integers not exceeding n, and the xor-sum of the lengths is equal to zero. Imp has to count the number of distinct xorangles of order n to ge...
code
{ "ground_truth": "{\n \"inputs\": [\n \"6\\n\",\n \"10\\n\",\n \"3\\n\",\n \"4\\n\",\n \"5\\n\",\n \"2500\\n\",\n \"952\\n\",\n \"88\\n\",\n \"1216\\n\",\n \"2140\\n\",\n \"564\\n\",\n \"1488\\n\",\n \"116\\n\",\n \"1040\\n\",\n \"1965\\n\",\n \"593\\n\",\n \"779\\...
{ "index": 0, "split": "dummy" }
codecontests
[ { "content": "Let's solve the puzzle by programming.\n\nThe numbers n x n are arranged in a grid pattern. Some of the numbers are circled and we will call them the starting point. The rules of the puzzle are as follows:\n\n* Draw one line that goes vertically and horizontally from each starting point (cannot be...
code
{ "ground_truth": "{\"inputs\": [\"3\\n-3 1 1\\n2 -4 1\\n2 1 -1\\n3\\n-4 1 1\\n1 1 -6\\n1 -5 3\\n4\\n-8 6 -2 1\\n2 -7 -2 1\\n1 -1 1 1\\n1 1 1 -5\\n6\\n2 2 3 -7 3 2\\n1 -10 1 1 3 2\\n2 6 5 2 -6 1\\n3 4 -23 2 2 5\\n3 3 -6 2 3 7\\n-7 2 3 2 -5 -13\\n6\\n2 2 3 -7 3 2\\n1 -10 1 1 3 2\\n2 6 5 2 -6 1\\n3 4 -23 2 2 5\\n3 3 -6...
{ "index": 0, "split": "dummy" }
taco
[ { "content": "# Task\n\nGiven a square `matrix`, your task is to reverse the order of elements on both of its longest diagonals.\n\nThe longest diagonals of a square matrix are defined as follows:\n* the first longest diagonal goes from the top left corner to the bottom right one;\n* the second longest diagonal...
code
{ "ground_truth": "{\"fn_name\": \"reverse_on_diagonals\", \"inputs\": [[[[1, 2, 3], [4, 5, 6], [7, 8, 9]]], [[[239]]], [[[1, 10], [100, 1000]]], [[[43, 455, 32, 103], [102, 988, 298, 981], [309, 21, 53, 64], [2, 22, 35, 291]]]], \"outputs\": [[[[9, 2, 7], [4, 5, 6], [3, 8, 1]]], [[[239]]], [[[1000, 100], [10, 1]]], ...
{ "index": 0, "split": "dummy" }
codeforces
[ { "content": "Title: Link/Cut Tree\n\nTime Limit: None seconds\n\nMemory Limit: None megabytes\n\nProblem Description:\nProgrammer Rostislav got seriously interested in the Link/Cut Tree data structure, which is based on Splay trees. Specifically, he is now studying the *expose* procedure.\n\nUnfortunately, Ros...
code
{ "ground_truth": "{\"inputs\": [\"1 10 2\", \"2 4 5\", \"18102 43332383920 28554\", \"19562 31702689720 17701\", \"11729 55221128400 313\", \"5482 100347128000 342\", \"3680 37745933600 10\", \"17098 191120104800 43\", \"10462 418807699200 2\", \"30061 641846400000 3\", \"1 1000000000000000000 2\", \"32 249803971200...
{ "index": 0, "split": "dummy" }
codecontests
[ { "content": "Jzzhu have n non-negative integers a1, a2, ..., an. We will call a sequence of indexes i1, i2, ..., ik (1 ≀ i1 < i2 < ... < ik ≀ n) a group of size k. \n\nJzzhu wonders, how many groups exists such that ai1 & ai2 & ... & aik = 0 (1 ≀ k ≀ n)? Help him and print this number modulo 1000000007 (109 + ...
code
{ "ground_truth": "{\"inputs\": [\"3\\n2 3 3\\n\", \"4\\n0 1 2 3\\n\", \"6\\n5 2 0 5 2 1\\n\", \"2\\n1 31\\n\", \"2\\n1 0\\n\", \"10\\n450661 128600 993228 725823 293549 33490 843121 903634 556169 448234\\n\", \"1\\n1\\n\", \"5\\n1 3 5 7 9\\n\", \"6\\n524 529 5249 524 529 529\\n\", \"3\\n1 2 3\\n\", \"2\\n0 1\\n\", \...
{ "index": 0, "split": "dummy" }
apps
[ { "content": "You're given an array $a$ of length $n$. You can perform the following operation on it as many times as you want: Pick two integers $i$ and $j$ $(1 \\le i,j \\le n)$ such that $a_i+a_j$ is odd, then swap $a_i$ and $a_j$. \n\nWhat is lexicographically the smallest array you can obtain?\n\nAn array...
code
{ "ground_truth": "{\n \"inputs\": [\n \"3\\n4 1 7\\n\",\n \"2\\n1 1\\n\",\n \"1\\n943081371\\n\",\n \"2\\n658442931 871874608\\n\",\n \"1\\n94198816\\n\",\n \"4\\n84289719 164233551 183942746 549385344\\n\",\n \"36\\n398353608 662365068 456456182 594572278 958026500 524977116 903404403 38222019...
{ "index": 0, "split": "dummy" }
taco
[ { "content": "A telephone number is a sequence of exactly $11$ digits such that its first digit is 8.\n\nVasya and Petya are playing a game. Initially they have a string $s$ of length $n$ ($n$ is odd) consisting of digits. Vasya makes the first move, then players alternate turns. In one move the player must cho...
code
{ "ground_truth": "{\"inputs\": [\"13\\n8380011223344\\n\", \"15\\n807345619350641\\n\", \"19\\n8181818181111111111\\n\", \"29\\n88811188118181818118111111111\\n\", \"15\\n980848088815548\\n\", \"13\\n9999999998888\\n\", \"13\\n0000008888888\\n\", \"13\\n2480011223348\\n\", \"17\\n87879887989788999\\n\", \"21\\n12345...
{ "index": 0, "split": "dummy" }
codecontests
[ { "content": "Ayoub had an array a of integers of size n and this array had two interesting properties: \n\n * All the integers in the array were between l and r (inclusive). \n * The sum of all the elements was divisible by 3. \n\n\n\nUnfortunately, Ayoub has lost his array, but he remembers the size of the ...
code
{ "ground_truth": "{\"inputs\": [\"9 9 99\\n\", \"2 1 3\\n\", \"3 2 2\\n\", \"1561 27096 939571\\n\", \"1050 1 982008957\\n\", \"200000 1 1000000000\\n\", \"3 1000000000 1000000000\\n\", \"142972 686320621 866589707\\n\", \"100 1 2\\n\", \"64 759746120 905671814\\n\", \"120881 536336525 585696606\\n\", \"557 68671496...
{ "index": 0, "split": "dummy" }
taco
[ { "content": "There is a collection of rocks where each rock has various minerals embeded in it. Each type of mineral is designated by a lowercase letter in the range $a s c i i[a-z]$. There may be multiple occurrences of a mineral in a rock. A mineral is called a gemstone if it occurs at least once in each of...
code
{ "ground_truth": "{\"inputs\": [\"5\\napple\\ngrape\\nbanana\\npeach\\ncherry\\n\", \"3\\nabcd\\nbcde\\ncdef\\n\"], \"outputs\": [\"0\", \"2\"]}", "style": "rule" }
{ "index": 0, "split": "dummy" }
apps
[ { "content": "During the winter holidays, the demand for Christmas balls is exceptionally high. Since it's already 2018, the advances in alchemy allow easy and efficient ball creation by utilizing magic crystals.\n\nGrisha needs to obtain some yellow, green and blue balls. It's known that to produce a yellow ba...
code
{ "ground_truth": "{\n \"inputs\": [\n \"4 3\\n2 1 1\\n\",\n \"3 9\\n1 1 3\\n\",\n \"12345678 87654321\\n43043751 1000000000 53798715\\n\",\n \"12 12\\n3 5 2\\n\",\n \"770 1390\\n170 442 311\\n\",\n \"3555165 6693472\\n1499112 556941 3075290\\n\",\n \"0 0\\n1000000000 1000000000 1000000000\\n\",...
{ "index": 0, "split": "dummy" }
taco
[ { "content": "The Finals of the \"Russian Code Cup\" 2214 will be held in n hotels. Two hotels (let's assume that they are the main hotels), will host all sorts of events, and the remaining hotels will accommodate the participants. The hotels are connected by n - 1 roads, you can get from any hotel to any other...
code
{ "ground_truth": "{\"inputs\": [\"5\\n4 3\\n3 1\\n1 5\\n5 2\\n20\\n4 3\\n4 1\\n4 5\\n4 2\\n3 4\\n3 1\\n3 5\\n3 2\\n1 4\\n1 3\\n1 5\\n1 2\\n5 4\\n5 3\\n5 1\\n5 2\\n2 4\\n2 3\\n2 1\\n2 5\\n\", \"4\\n4 1\\n1 3\\n3 2\\n12\\n4 1\\n4 3\\n4 2\\n1 4\\n1 3\\n1 2\\n3 4\\n3 1\\n3 2\\n2 4\\n2 1\\n2 3\\n\", \"6\\n3 5\\n5 6\\n6 4...
{ "index": 0, "split": "dummy" }
apps
[ { "content": "You are given an integer N.\nFind the number of the positive divisors of N!, modulo 10^9+7.\n\n-----Constraints-----\n - 1≀N≀10^3\n\n-----Input-----\nThe input is given from Standard Input in the following format:\nN\n\n-----Output-----\nPrint the number of the positive divisors of N!, modulo 10^9...
code
{ "ground_truth": "{\"inputs\": [\"3\\n\", \"6\\n\", \"1000\\n\"], \"outputs\": [\"4\\n\", \"30\\n\", \"972926972\\n\"]}", "style": "rule" }
{ "index": 0, "split": "dummy" }
taco
[ { "content": "A permutation of length N is an array of N integers (P_{1},P_{2}, \\dots,P_{N}) where every integer from 1 to N (inclusive) appears in it exactly once. The weight of a subsegment containing the elements (P_{l},P_{l+1}, \\dots,P_{r}) is defined as follows: W(l, r) = (r-l+1)\\cdot \\min\\limits_{l≀...
code
{ "ground_truth": "{\"inputs\": [\" 3\\n3 7\\n2 3\\n4 5\\n\", \" 5\\n3 4\\n6 20\\n8 5\\n2 4\\n2 1\\n\", \" 1\\n2 4\\n\", \" 2\\n3 6\\n7 16\\n\", \" 4\\n1 10000000000\\n100000 5000000000\\n2 10000000000\\n99999 4999950000\\n\"], \"outputs\": [\"NO\\nNO\\nNO\", \"YES\\nNO\\nYES\\nNO\\nYES\", \"NO\", \"NO\\nYES\", \"NO\...
{ "index": 0, "split": "dummy" }
apps
[ { "content": "Petr likes to come up with problems about randomly generated data. This time problem is about random permutation. He decided to generate a random permutation this way: he takes identity permutation of numbers from $1$ to $n$ and then $3n$ times takes a random pair of different elements and swaps t...
code
{ "ground_truth": "{\n \"inputs\": [\n \"5\\n2 4 5 1 3\\n\"\n ],\n \"outputs\": [\n \"Petr\\n\"\n ]\n}", "style": "rule" }
{ "index": 0, "split": "dummy" }
taco
[ { "content": "Archeologists recently found the remains of Greco-Roman architecture. The location can be modeled as a grid of $R \\cdot C$ square cells. For each of the cells, archeologists have determined if some building was there or if the cell has always been empty.\n\nAfter examining the artifacts in detail...
code
{ "ground_truth": "{\"inputs\": [\"3 3\\nxx.\\nxxx\\n...\\n\", \"4 6\\nxx....\\nxx.xxx\\n...xxx\\n...xxx\\n\", \"5 5\\n.....\\nxxx..\\nxxxx.\\nxxxx.\\n.xxx.\\n\"], \"outputs\": [\"1 1 2\\n2 3 1\\n\", \"1 1 2\\n2 4 3\\n\", \"2 1 3\\n3 2 3\\n\"]}", "style": "rule" }
{ "index": 0, "split": "dummy" }
codeforces
[ { "content": "Title: Game with Coins\n\nTime Limit: None seconds\n\nMemory Limit: None megabytes\n\nProblem Description:\nTwo pirates Polycarpus and Vasily play a very interesting game. They have *n* chests with coins, the chests are numbered with integers from 1 to *n*. Chest number *i* has *a**i* coins. \n\nP...
code
{ "ground_truth": "{\"inputs\": [\"1\\n1\", \"3\\n1 2 3\", \"100\\n269 608 534 956 993 409 297 735 258 451 468 422 125 407 580 769 857 383 419 67 377 230 842 113 169 427 287 75 372 133 456 450 644 303 638 40 217 445 427 730 168 341 371 633 237 951 142 596 528 509 236 782 44 467 607 326 267 15 564 858 499 337 74 346 4...
{ "index": 0, "split": "dummy" }
taco
[ { "content": "Consider a string of $n$ characters, $\\boldsymbol{\\mathrm{~S~}}$, of where each character is indexed from $\\mbox{0}$ to $n-1$.\n\nYou are given $\\textit{q}$ queries in the form of two integer indices: ${\\mbox{left}}$ and $\\textit{right}$. For each query, count and print the number of differe...
code
{ "ground_truth": "{\"inputs\": [\"7 3\\nabcabc\\n0 0\\n1 2\\n0 3\\n\", \"6 2\\nabcabc\\n0 5\\n0 3\\n\", \"5 4\\nabcabc\\n0 5\\n0 3\\n1 4\\n1 2\\n\", \"7 3\\nabccba\\n0 3\\n1 4\\n2 5\\n\", \"10 5\\nabbacdefgh\\n0 0\\n0 9\\n4 4\\n2 5\\n0 9\\n\"], \"outputs\": [\"1\\n3\\n9\", \"15\\n9\", \"15\\n9\\n9\\n3\", \"9\\n8\\n9...
{ "index": 0, "split": "dummy" }
codecontests
[ { "content": "Gildong is playing a video game called Block Adventure. In Block Adventure, there are n columns of blocks in a row, and the columns are numbered from 1 to n. All blocks have equal heights. The height of the i-th column is represented as h_i, which is the number of blocks stacked in the i-th column...
code
{ "ground_truth": "{\"inputs\": [\"5\\n3 0 1\\n4 3 5\\n3 1 2\\n1 4 7\\n4 10 0\\n10 20 10 20\\n2 5 5\\n0 11\\n1 9 9\\n99\\n\", \"1\\n97 0 0\\n0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0...
{ "index": 0, "split": "dummy" }
codecontests
[ { "content": "On Chocolate day, Chotu wants to give his girlfriend a box of chocolate. Chotu has a N X N square box and N^2 chocolates each having a distinct sweetness value between 1 and N^2.\n\nTo make the box look attractive Chotu must fill each row with chocolates arranged in increasing value of sweetness. ...
code
{ "ground_truth": "{\"inputs\": [\"20\\n619 495\\n67 12\\n470 97\\n544 529\\n396 340\\n963 9\\n154 24\\n167 32\\n469 439\\n507 450\\n346 76\\n569 204\\n518 245\\n955 107\\n426 151\\n883 559\\n70 37\\n832 279\\n176 93\\n784 778\\n694 450\", \"20\\n18 5\\n302 206\\n414 282\\n181 38\\n437 34\\n501 337\\n404 86\\n580 69\...
{ "index": 0, "split": "dummy" }
taco
[ { "content": "Sort the given Linked List using quicksort. which takes O(n^2) time in worst case and O(nLogn) in average and best cases, otherwise you may get TLE.\nInput:\nIn this problem, method takes 1 argument: address of the head of the linked list. The function should not read any input from stdin/console....
code
{ "ground_truth": "{\"fn_name\": \"quickSort\", \"inputs\": [\"2\\r\\n\\n3\\r\\n\\n1 6 2\\r\\n\\n4\\r\\n\\n1 9 3 8\"], \"outputs\": [\"1 2 6\\r\\n\\n1 3 8 9\"]}", "style": "rule" }
{ "index": 0, "split": "dummy" }
taco
[ { "content": "Evaluate the value of an arithmetic expression in Reverse Polish Notation.\n\nValid operators are +, -, *, /. Each operand may be an integer or another expression.\n\nNote:\n\n\n Division between two integers should truncate toward zero.\n The given RPN expression is always valid. That...
code
{ "ground_truth": "{\"fn_name\": \"evalRPN\", \"inputs\": [[[\"4\", \"2\", \"/\"]], [[\"2\"]], [[\"2\", \"2\", \"/\", \"2\", \"/\", \"2\", \"/\"]], [[\"0\", \"2\", \"/\"]], [[\"1000000\", \"2\", \"/\", \"3\", \"/\", \"4\", \"/\", \"5\", \"/\", \"10\", \"/\"]]], \"outputs\": [[2], [2], [0], [0], [833]]}", "style": "...
{ "index": 0, "split": "dummy" }
codecontests
[ { "content": "In the year 2500 the annual graduation ceremony in the German University in Cairo (GUC) has run smoothly for almost 500 years so far.\n\nThe most important part of the ceremony is related to the arrangement of the professors in the ceremonial hall.\n\nTraditionally GUC has n professors. Each profe...
code
{ "ground_truth": "{\"inputs\": [\"3 2001 3\\n1 2\\n2 3\\n3 1\\n\", \"10 3630801 0\\n\", \"3 2001 2\\n1 2\\n2 3\\n\", \"7 2020 6\\n1 2\\n1 3\\n2 4\\n2 5\\n3 6\\n3 7\\n\", \"11 2001 34\\n2 1\\n7 5\\n9 8\\n5 2\\n9 5\\n9 1\\n9 11\\n1 5\\n7 2\\n9 1\\n4 7\\n3 11\\n9 7\\n2 1\\n3 7\\n7 3\\n7 6\\n8 1\\n1 9\\n11 8\\n8 4\\n8 9...
{ "index": 0, "split": "dummy" }
taco
[ { "content": "Bandits appeared in the city! One of them is trying to catch as many citizens as he can.\n\nThe city consists of $n$ squares connected by $n-1$ roads in such a way that it is possible to reach any square from any other square. The square number $1$ is the main square.\n\nAfter Sunday walk all the ...
code
{ "ground_truth": "{\"inputs\": [\"3\\n1 1\\n3 1 2\\n\", \"3\\n1 1\\n3 1 3\\n\", \"3\\n1 1\\n2 0 0\\n\", \"2\\n1\\n487981126 805590708\\n\", \"5\\n1 1 1 4\\n28 0 0 0 0\\n\", \"2\\n1\\n91 0\\n\", \"10\\n1 1 1 1 1 1 1 1 1\\n64 0 0 0 0 0 0 0 0 0\\n\", \"50\\n1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 ...
{ "index": 0, "split": "dummy" }
codecontests
[ { "content": "Write a program which manipulates a sequence A = {a1, a2, . . . , an} with the following operations:\n\n* add(i, x): add x to ai.\n* getSum(s, t): print the sum of as, as+1,...,at.\n\n\n\nNote that the initial values of ai (i = 1, 2, . . . , n) are 0.\n\nConstraints\n\n* 1 ≀ n ≀ 100000\n* 1 ≀ q ≀ ...
code
{ "ground_truth": "{\"inputs\": [\"3 5\\n0 1 1\\n0 2 2\\n0 3 3\\n1 1 2\\n1 2 2\", \"4 5\\n0 1 1\\n0 2 2\\n0 3 3\\n1 1 2\\n1 2 2\", \"4 5\\n0 1 1\\n0 2 2\\n0 1 5\\n1 1 2\\n1 2 2\", \"4 5\\n0 1 0\\n0 2 2\\n0 1 5\\n1 1 2\\n1 2 2\", \"4 5\\n0 1 1\\n0 2 4\\n0 3 3\\n1 1 2\\n1 2 2\", \"4 5\\n0 1 1\\n0 4 4\\n0 3 3\\n1 1 2\\n...
{ "index": 0, "split": "dummy" }
codecontests
[ { "content": "There are N people, conveniently numbered 1 through N. We want to divide them into some number of groups, under the following two conditions:\n\n* Every group contains between A and B people, inclusive.\n\n* Let F_i be the number of the groups containing exactly i people. Then, for all i, either F...
code
{ "ground_truth": "{\"inputs\": [\"10 3 4 2 5\", \"7 2 3 1 3\", \"1000 1 1000 1 1000\", \"3 1 3 1 2\", \"7 3 4 2 5\", \"8 2 3 1 3\", \"1000 1 1000 2 1000\", \"1000 1 1000 3 1000\", \"10 3 7 2 5\", \"7 1 3 1 3\", \"1000 1 1000 1 1001\", \"7 1 6 2 5\", \"0 3 8 2 7\", \"2 1 3 1 2\", \"8 2 5 1 3\", \"1000 1 1000 4 1010\"...
{ "index": 0, "split": "dummy" }
codecontests
[ { "content": "Let's suppose you have an array a, a stack s (initially empty) and an array b (also initially empty).\n\nYou may perform the following operations until both a and s are empty:\n\n * Take the first element of a, push it into s and remove it from a (if a is not empty); \n * Take the top element fr...
code
{ "ground_truth": "{\"inputs\": [\"5 3\\n2 3 1\\n\", \"5 3\\n3 2 1\\n\", \"5 2\\n3 4\\n\", \"5 1\\n3\\n\", \"10 7\\n10 8 5 1 2 7 3\\n\", \"4 3\\n3 4 2\\n\", \"10 4\\n2 1 3 4\\n\", \"10 4\\n2 1 7 3\\n\", \"20 5\\n11 19 6 2 12\\n\", \"2 1\\n1\\n\", \"10 3\\n2 1 4\\n\", \"4 3\\n3 1 2\\n\", \"10 9\\n10 8 7 5 6 2 1 9 4\\n...
{ "index": 0, "split": "dummy" }
codecontests
[ { "content": "Most problems on CodeChef highlight chef's love for food and cooking but little is known about his love for racing sports. He is an avid Formula 1 fan. He went to watch this year's Indian Grand Prix at New Delhi. He noticed that one segment of the circuit was a long straight road. It was impossibl...
code
{ "ground_truth": "{\"inputs\": [\"3\\n1\\n10\\n3\\n8 3 6\\n5\\n4 5 1 2 3\", \"3\\n1\\n10\\n3\\n8 3 6\\n5\\n4 5 1 2 4\", \"3\\n1\\n10\\n3\\n0 3 6\\n5\\n4 5 1 2 3\", \"3\\n1\\n10\\n3\\n8 3 1\\n5\\n4 5 1 2 4\", \"3\\n1\\n0\\n3\\n8 3 6\\n5\\n6 5 1 2 5\", \"3\\n1\\n10\\n3\\n8 3 1\\n5\\n6 5 1 2 4\", \"3\\n1\\n10\\n3\\n8 3...
{ "index": 0, "split": "dummy" }
taco
[ { "content": "Fox Ciel is going to publish a paper on FOCS (Foxes Operated Computer Systems, pronounce: \"Fox\"). She heard a rumor: the authors list on the paper is always sorted in the lexicographical order. \n\nAfter checking some examples, she found out that sometimes it wasn't true. On some papers authors'...
code
{ "ground_truth": "{\"inputs\": [\"2\\naa\\na\\n\", \"5\\naaaaa\\naaaa\\naaa\\naa\\na\\n\", \"2\\nanud\\nanu\\n\", \"4\\nax\\nay\\nby\\nbz\\n\", \"1\\nzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz\\n\", \"6\\nax\\nay\\nby\\nbz\\ncz\\ncx\\n\", \"4\\nax\\nay\\nby\\...
{ "index": 0, "split": "dummy" }
taco
[ { "content": "Given a non-emptyΒ array of unique positive integers A, consider the following graph:\n\nThere are A.length nodes, labelled A[0] to A[A.length - 1];\nThere is an edge between A[i] and A[j]Β if and only ifΒ A[i] and A[j] share a common factor greater than 1.\n\nReturn the size of the largest connected...
code
{ "ground_truth": "{\"fn_name\": \"largestComponentSize\", \"inputs\": [[[2, 3, 4, 6, 7, 9, 10]], [[4, 5, 6, 7, 8, 10, 11]], [[12, 13, 14, 15, 16, 17, 18]], [[20, 21, 22, 23, 24, 25, 26]], [[28, 29, 30, 31, 32, 33, 34]], [[1]], [[1, 2, 3, 4, 5]], [[2, 4, 8, 16, 32]], [[3, 5, 7, 11, 13, 17]], [[97, 89, 83, 79, 73]], [...
{ "index": 0, "split": "dummy" }
codecontests
[ { "content": "DZY loves planting, and he enjoys solving tree problems.\n\nDZY has a weighted tree (connected undirected graph without cycles) containing n nodes (they are numbered from 1 to n). He defines the function g(x, y) (1 ≀ x, y ≀ n) as the longest edge in the shortest path between nodes x and y. Special...
code
{ "ground_truth": "{\"inputs\": [\"4\\n1 2 1\\n2 3 2\\n3 4 3\\n1\\n1\\n1\\n1\\n\", \"4\\n1 2 1\\n2 3 2\\n3 4 3\\n4\\n4\\n4\\n4\\n\", \"1\\n1\\n\", \"10\\n2 1 559\\n3 1 5707\\n4 2 9790\\n5 3 1591\\n6 1 7113\\n7 6 2413\\n8 6 3006\\n9 4 1935\\n10 6 5954\\n1\\n1\\n1\\n1\\n1\\n1\\n1\\n1\\n1\\n1\\n\", \"10\\n2 1 8760\\n3 1...
{ "index": 0, "split": "dummy" }
taco
[ { "content": "Write a function \n\n```python\nvowel_2_index```\n\nthat takes in a string and replaces all the vowels [a,e,i,o,u] with their respective positions within that string. \nE.g: \n\n```python\nvowel_2_index('this is my string') == 'th3s 6s my str15ng'\nvowel_2_index('Codewars is the best site in the w...
code
{ "ground_truth": "{\"fn_name\": \"vowel_2_index\", \"inputs\": [[\"this is my string\"], [\"Codewars is the best site in the world\"], [\"Tomorrow is going to be raining\"], [\"\"], [\"90's cornhole Austin, pickled butcher yr messenger bag gastropub next level leggings listicle meditation try-hard Vice. Taxidermy ga...
{ "index": 0, "split": "dummy" }
codecontests
[ { "content": "Based on some criterion, Snuke divided the integers from 1 through 12 into three groups as shown in the figure below. Given two integers x and y (1 ≀ x < y ≀ 12), determine whether they belong to the same group.\n\nb4ab979900ed647703389d4349eb84ee.png\n\nConstraints\n\n* x and y are integers.\n* 1...
code
{ "ground_truth": "{\"inputs\": [\"2 4\", \"1 3\", \"2 8\", \"1 10\", \"1 4\", \"2 3\", \"2 10\", \"4 3\", \"7 3\", \"7 6\", \"7 4\", \"7 5\", \"4 5\", \"1 5\", \"1 2\", \"0 2\", \"-1 2\", \"2 1\", \"1 1\", \"2 0\", \"2 6\", \"3 3\", \"7 1\", \"5 4\", \"7 10\", \"5 5\", \"2 5\", \"2 9\", \"3 6\", \"5 3\", \"7 12\", \...
{ "index": 0, "split": "dummy" }
taco
[ { "content": "Vasya had a strictly increasing sequence of positive integers a_1, ..., a_{n}. Vasya used it to build a new sequence b_1, ..., b_{n}, where b_{i} is the sum of digits of a_{i}'s decimal representation. Then sequence a_{i} got lost and all that remained is sequence b_{i}.\n\nVasya wonders what the ...
code
{ "ground_truth": "{\"inputs\": [\"3\\n1\\n2\\n3\\n\", \"3\\n3\\n2\\n1\\n\", \"10\\n1\\n2\\n3\\n4\\n5\\n6\\n7\\n8\\n9\\n1\\n\", \"10\\n8\\n8\\n5\\n1\\n2\\n7\\n3\\n8\\n9\\n4\\n\", \"10\\n1\\n1\\n1\\n1\\n1\\n1\\n1\\n1\\n1\\n1\\n\", \"100\\n1\\n2\\n3\\n4\\n5\\n6\\n7\\n8\\n9\\n1\\n2\\n3\\n4\\n5\\n6\\n7\\n8\\n9\\n10\\n2\\...
{ "index": 0, "split": "dummy" }
codeforces
[ { "content": "Title: Little Elephant and Sorting\n\nTime Limit: None seconds\n\nMemory Limit: None megabytes\n\nProblem Description:\nThe Little Elephant loves sortings.\n\nHe has an array *a* consisting of *n* integers. Let's number the array elements from 1 to *n*, then the *i*-th element will be denoted as *...
code
{ "ground_truth": "{\"inputs\": [\"3\\n1 2 3\", \"3\\n3 2 1\", \"4\\n7 4 1 47\", \"10\\n1 2 3 4 5 6 7 8 9 1000000000\", \"10\\n1000000000 1 1000000000 1 1000000000 1 1000000000 1 1000000000 1\", \"7\\n47 47 47 47 47 47 48\", \"47\\n479793446 951468508 89486286 338446715 32648506 624498057 608503040 669251062 92245929...
{ "index": 0, "split": "dummy" }
codeforces
[ { "content": "Title: Irrational problem\n\nTime Limit: 2 seconds\n\nMemory Limit: 256 megabytes\n\nProblem Description:\nLittle Petya was given this problem for homework:\n\nYou are given function (here represents the operation of taking the remainder). His task is to count the number of integers *x* in range...
code
{ "ground_truth": "{\"inputs\": [\"2 7 1 8 2 8\", \"20 30 40 50 0 100\", \"31 41 59 26 17 43\", \"1 2 3 4 0 0\", \"1 2 3 4 1 1\", \"1 2 999 1000 30 40\", \"17 18 19 20 17 20\", \"17 18 19 20 16 20\", \"41 449 328 474 150 709\", \"467 329 936 440 117 700\", \"258 811 952 491 931 993\", \"823 431 359 590 153 899\", \"2...
{ "index": 0, "split": "dummy" }
taco
[ { "content": "You have a rooted tree with $n$ vertices numbered from $\\mbox{1}$ through $n$ where the root is vertex $\\mbox{1}$. \n\nYou are given $m$ triplets, the $j^{th}$ triplet is denoted by three integers $u_j,v_j,c_j$. The $j^{th}$ triplet represents a simple path in the tree with endpoints in $u_i$ an...
code
{ "ground_truth": "{\"inputs\": [\"1\\n8 8\\n1 2 3\\n1 3 1\\n2 4 5\\n2 5 1\\n2 6 1\\n3 7 2\\n4 8 1\\n1 2 3\\n2 8 5\\n1 8 7\\n1 5 8\\n1 6 10\\n3 7 5\\n1 7 6\\n1 7 6\\n\"], \"outputs\": [\"37\\n\"]}", "style": "rule" }
{ "index": 0, "split": "dummy" }
codecontests
[ { "content": "Your favorite shop sells n Kinder Surprise chocolate eggs. You know that exactly s stickers and exactly t toys are placed in n eggs in total.\n\nEach Kinder Surprise can be one of three types:\n\n * it can contain a single sticker and no toy; \n * it can contain a single toy and no sticker; \n ...
code
{ "ground_truth": "{\"inputs\": [\"3\\n10 5 7\\n10 10 10\\n2 1 1\\n\", \"4\\n1 1 1\\n1000000000 1000000000 1000000000\\n1000000000 999999999 1\\n999999999 666666667 666666666\\n\", \"4\\n2 1 1\\n2 1 2\\n2 2 1\\n2 2 2\\n\", \"1\\n1926 1900 1200\\n\", \"1\\n5 3 2\\n\", \"4\\n2 1 1\\n2 2 2\\n2 2 1\\n2 2 2\\n\", \"1\\n5 ...
{ "index": 0, "split": "dummy" }
taco
[ { "content": "Peter returned from the recently held ACM ICPC World Finals only to find that his return flight was overbooked and he was bumped from the flight! Well, at least he wasn’t beat up by the airline and he’s received a voucher for one free flight between any two destinations he wishes.\n\nHe is already...
code
{ "ground_truth": "{\"inputs\": [\"8 11 1 0 5\\n0 1 10\\n0 2 10\\n1 2 10\\n2 6 40\\n6 7 10\\n5 6 10\\n3 5 15\\n3 6 40\\n3 4 20\\n1 4 20\\n1 3 20\\n4 7\\n\", \"8 11 1 0 5\\n0 1 10\\n0 2 10\\n1 2 10\\n2 6 40\\n6 7 10\\n5 6 10\\n3 5 15\\n3 6 40\\n3 4 20\\n1 4 20\\n1 3 30\\n4 7\\n\"], \"outputs\": [\"45\\n\", \"50\\n\"]}...
{ "index": 0, "split": "dummy" }
taco
[ { "content": "You are given a string $s$ consisting only of lowercase Latin letters.\n\nYou can rearrange all letters of this string as you wish. Your task is to obtain a good string by rearranging the letters of the given string or report that it is impossible to do it.\n\nLet's call a string good if it is not...
code
{ "ground_truth": "{\"inputs\": [\"3\\naa\\nabacaba\\nxdd\\n\", \"100\\naa\\nb\\ncbc\\nc\\nbab\\nc\\nbdb\\ndd\\nhfh\\nebe\\nb\\nf\\ngg\\na\\nm\\nkkk\\nqq\\ni\\noo\\nss\\ntt\\nere\\njgj\\nqiq\\nkk\\nn\\naaa\\nb\\naa\\nb\\nc\\na\\nf\\ne\\na\\naa\\nff\\ne\\na\\nafa\\no\\nmom\\nqq\\nf\\niii\\nh\\njj\\njj\\nkgk\\nbb\\nhih...
{ "index": 0, "split": "dummy" }
apps
[ { "content": "Witua is a little student from the University of Lviv. He enjoys studying math. Witua knows a lot of famous mathematicians like Eratosthenes, Pythagoras, Fermat, Diophantus, Furko, Gauss and so on. However, his favorite one is Euler. The only thing Witua likes more than Euler is Euler’s totient fu...
code
{ "ground_truth": "{\"inputs\": [[\"3\", \"2\", \"3\", \"4\"]], \"outputs\": [[\"2\", \"3\", \"3\"]]}", "style": "rule" }
{ "index": 0, "split": "dummy" }
codecontests
[ { "content": "Alice is a geeky girl. She has a lot of codes to execute but she always choose a lucky time to execute a code. \nTime is shown in 24 hour format as hh:mm:ss\nTime is said to be lucky if all the 6 characters (except ':') are different.\n\nGiven the time when she completed the code find a lucky time...
code
{ "ground_truth": "{\"inputs\": [\"3\\n00:00:00\\n12:59:59\\n23:59:59\\n\\nSAMPLE\", \"3\\n00:00:00\\n12:59:59\\n23:59:59\\n\\nRAMPLE\", \"3\\n00:00:00\\n12:59:59\\n23:49:59\\n\\nRAMPEL\", \"3\\n00:00:00\\n12:59:59\\n22:59:59\\n\\nPAMSLE\", \"3\\n00:00:00\\n02:59:59\\n23:59:58\\n\\nSEAQLM\", \"3\\n11:00:00\\n02:59:59...
{ "index": 0, "split": "dummy" }
codecontests
[ { "content": "A prime number n (11, 19, 23, etc.) that divides by 4 and has 3 has an interesting property. The results of calculating the remainder of the square of a natural number (1, 2, ..., n -1) of 1 or more and less than n divided by n are the same, so they are different from each other. The number is (n ...
code
{ "ground_truth": "{\"inputs\": [\"11\\n15\\n0\", \"11\\n23\\n0\", \"11\\n45\\n0\", \"11\\n77\\n0\", \"11\\n13\\n0\", \"11\\n17\\n0\", \"11\\n25\\n0\", \"11\\n37\\n0\", \"11\\n5\\n0\", \"11\\n69\\n0\", \"11\\n19\\n0\", \"11\\n21\\n0\", \"11\\n27\\n0\", \"11\\n11\\n0\", \"11\\n31\\n0\", \"11\\n33\\n0\", \"11\\n29\\n0\...
{ "index": 0, "split": "dummy" }
taco
[ { "content": "Chef is deriving weird ways to sort his array. Currently he is trying to sort his arrays in increasing order by reversing some of his subarrays.\n\nTo make it more challenging for himself, Chef decides that he can reverse only those subarrays that have sum of its elements at most X. Soon he notice...
code
{ "ground_truth": "{\"inputs\": [\"1\\n5 15\\n5 3 9 6 1\\n\", \"1\\n6 15\\n6 5 4 3 2 1\\n\", \"1\\n5 2000000000\\n2000000000 1000000000 300000000 100000000 2\\n\"], \"outputs\": [\"YES\", \"YES\", \"NO\"]}", "style": "rule" }
{ "index": 0, "split": "dummy" }
taco
[ { "content": "A person is getting ready to leave and needs a pair of matching socks. If there are $n$ colors of socks in the drawer, how many socks need to be removed to be certain of having a matching pair? \n\nExample\n$n=2$ \n\nThere are $2$ colors of socks in the drawer. If they remove $2$ socks, they m...
code
{ "ground_truth": "{\"inputs\": [\"2\\n1\\n2\\n\"], \"outputs\": [\"2\\n3\\n\"]}", "style": "rule" }
{ "index": 0, "split": "dummy" }
codecontests
[ { "content": "This problem differs from the previous problem only in constraints.\n\nPetya decided to visit Byteland during the summer holidays. It turned out that the history of this country is quite unusual.\n\nInitially, there were n different countries on the land that is now Berland. Each country had its o...
code
{ "ground_truth": "{\"inputs\": [\"4\\n0 0 1 2\\n0 2 1 3\\n1 0 2 1\\n1 1 2 3\\n\", \"4\\n0 0 2 1\\n1 2 3 3\\n2 0 3 2\\n0 1 1 3\\n\", \"24\\n1639 833 9207 834\\n9948 874 9973 4856\\n1660 2923 9229 6823\\n1468 2423 1538 9944\\n3643 9894 9951 9917\\n2314 215 9911 679\\n1669 6866 9235 8374\\n51 846 1516 2381\\n1698 9135 ...
{ "index": 0, "split": "dummy" }
taco
[ { "content": "Kodi has been bought at the auction in the NIT Premier League. Kodi is a batsman and the runs he makes in each innings depends on the runs he has made in his previous three innings. The runs he makes in the current innings is given by the formula :\n\nF(x) = ( 2xF(x-1)-(x-1)F(x-2)-(x-2)*F(x-3) )/...
code
{ "ground_truth": "{\"inputs\": [\"100\\n89384 89384 89384 6930887\\n92778 92778 92778 4636916\\n47794 47794 47794 4238336\\n85387 85387 85387 9760493\\n16650 16650 16650 9641422\\n2363 2363 2363 490028\\n68691 68691 68691 2520060\\n97764 97764 97764 7513927\\n80541 80541 80541 383427\\n89173 89173 89173 3455737\\n52...
{ "index": 0, "split": "dummy" }
codecontests
[ { "content": "Brio wants to get a beautiful house constructed near the National Highway. As his in laws are very much fond of triangles, he decided to give his house a perfect Triangular Shape.\nNow, here comes the problem that he faces. The plots in Hackers' Land are all circular in shape. You need to help Bri...
code
{ "ground_truth": "{\"inputs\": [\"2\\n5.0000 3.0000 4.0000\\n12.0000 13.0000 5.0000\\n\\n\\nSAMPLE\", \"2\\n5.0000 3.5218061682463278 4.0000\\n12.0000 13.0000 5.0000\\n\\n\\nSAMPLE\", \"2\\n5.0000 3.5218061682463278 4.0000\\n12.0000 13.173512536333314 5.0000\\n\\n\\nSAMPLE\", \"2\\n5.757769514565519 3.52180616824632...
{ "index": 0, "split": "dummy" }
apps
[ { "content": "Vadim loves decorating the Christmas tree, so he got a beautiful garland as a present. It consists of $n$ light bulbs in a single row. Each bulb has a number from $1$ to $n$ (in arbitrary order), such that all the numbers are distinct. While Vadim was solving problems, his home Carp removed some l...
code
{ "ground_truth": "{\n \"inputs\": [\n \"5\\n0 5 0 2 3\\n\",\n \"7\\n1 0 0 5 0 0 2\\n\",\n \"1\\n0\\n\",\n \"20\\n7 0 9 0 5 0 15 0 0 1 17 0 11 19 0 0 3 0 13 0\\n\",\n \"20\\n9 0 0 0 18 0 11 0 0 4 0 15 0 0 0 14 0 0 5 0\\n\",\n \"20\\n13 0 0 12 14 0 19 0 15 0 8 0 7 0 9 0 20 0 0 10\\n\",\n \"20\\n1...
{ "index": 0, "split": "dummy" }
codeforces
[ { "content": "Title: Beaver Game\n\nTime Limit: 1 seconds\n\nMemory Limit: 256 megabytes\n\nProblem Description:\nTwo beavers, Timur and Marsel, play the following game.\n\nThere are *n* logs, each of exactly *m* meters in length. The beavers move in turns. For each move a beaver chooses a log and gnaws it into...
code
{ "ground_truth": "{\"inputs\": [\"1 15 4\", \"4 9 5\", \"14 30 9\", \"81 180 53\", \"225 187 20\", \"501 840 11\", \"3 11 6\", \"1 2 1\", \"1 1 2\", \"1 1 1\", \"1 2 2\", \"2 1 1\", \"2 1 2\", \"2 2 1\", \"2 2 2\", \"1000000000 1000000000 1000000000\", \"999999999 735134400 1\", \"999999999 735134400 100\", \"787965...
{ "index": 0, "split": "dummy" }
codecontests
[ { "content": "You are an upcoming movie director, and you have just released your first movie. You have also launched a simple review site with two buttons to press β€” upvote and downvote.\n\nHowever, the site is not so simple on the inside. There are two servers, each with its separate counts for the upvotes an...
code
{ "ground_truth": "{\"inputs\": [\"4\\n1\\n2\\n3\\n1 2 3\\n5\\n1 1 1 1 1\\n3\\n3 3 2\\n\", \"9\\n1\\n1\\n1\\n1\\n1\\n1\\n1\\n1\\n1\\n1\\n1\\n1\\n1\\n1\\n1\\n1\\n1\\n1\\n\", \"1\\n1\\n2\\n\", \"9\\n1\\n1\\n1\\n1\\n1\\n1\\n1\\n1\\n1\\n1\\n1\\n1\\n1\\n2\\n1\\n1\\n1\\n1\\n\", \"4\\n1\\n2\\n3\\n1 3 3\\n5\\n1 1 1 1 1\\n3\\...
{ "index": 0, "split": "dummy" }
apps
[ { "content": "Ash like soup very much! So, on the Raksha Bandhan day, his sister gave him a soup maker as a gift. Soup maker in the ith hour will make volume Vi liters of soup and pours it in a bowl.\nEach hour, the Volume of soup in every bowl is reduced due to evaporation. More precisely, when the temperatur...
code
{ "ground_truth": "{\"inputs\": [[\"s\", \"Input\", \"3\", \"10 10 5\", \"5 7 2\"], [\"5\", \"30 25 20 15 10\", \"9 10 12 4 13\"]], \"outputs\": [[\"5 12 4\"], [\"9 20 35 11 25\", \"Note\", \"In the first sample, In the first hour, 10 liters of soup is prepared, which evaporates to the size of 5 at the same hour. In ...
{ "index": 0, "split": "dummy" }
codecontests
[ { "content": "You are given four digits N_1, N_2, N_3 and N_4. Determine if these can be arranged into the sequence of digits \"1974\".\n\nConstraints\n\n* 0 \\leq N_1, N_2, N_3, N_4 \\leq 9\n* N_1, N_2, N_3 and N_4 are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\n\nN_1 N...
code
{ "ground_truth": "{\"inputs\": [\"1 9 7 4\", \"1 2 9 1\", \"4 9 0 8\", \"1 7 9 4\", \"1 9 13 4\", \"1 2 3 1\", \"4 9 0 13\", \"0 7 9 4\", \"1 9 13 3\", \"1 3 3 1\", \"3 9 0 13\", \"1 12 9 4\", \"1 9 13 0\", \"1 2 3 2\", \"3 9 -1 13\", \"1 15 9 4\", \"1 3 13 0\", \"1 0 3 2\", \"3 1 -1 13\", \"1 15 11 4\", \"1 3 13 -1...
{ "index": 0, "split": "dummy" }
codecontests
[ { "content": "Makes solves problems on Decoforces and lots of other different online judges. Each problem is denoted by its difficulty β€” a positive integer number. Difficulties are measured the same across all the judges (the problem with difficulty d on Decoforces is as hard as the problem with difficulty d on...
code
{ "ground_truth": "{\"inputs\": [\"4 20\\n10 3 6 3\\n\", \"3 3\\n2 1 9\\n\", \"1 2\\n9\\n\", \"7 6\\n4 20 16 14 3 17 4\\n\", \"1 1\\n1000000000\\n\", \"4 2\\n45 44 35 38\\n\", \"2 1\\n4 1000000000\\n\", \"2 1\\n1 4\\n\", \"100 10\\n246 286 693 607 87 612 909 312 621 37 801 558 504 914 416 762 187 974 976 123 635 488 ...
{ "index": 0, "split": "dummy" }