data_source
stringclasses
1 value
prompt
listlengths
1
1
ability
stringclasses
1 value
reward_model
dict
extra_info
dict
deepcoder_while_sandbox
[ { "content": "Solve the following programming problem. Provide a complete solution in Python.\n\nGiven any integer x, Aoki can do the operation below.\nOperation: Replace x with the absolute difference of x and K.\nYou are given the initial value of an integer N. Find the minimum possible value taken by N after...
code_mechanism
{ "ground_truth": "{\"inputs\": [\"7 4\\n\", \"2 6\\n\", \"1000000000000000000 1\\n\", \"1 1\\n\", \"1 1000000000000000000\\n\", \"34439284758432890 4389039281938432\\n\", \"435893948572830341 43\\n\", \"548698204992839484 5\\n\", \"999999482938498888 1000000000000000000\\n\", \"10 999999999999999999\\n\", \"0 149839...
{ "index": 24200, "source": "taco", "source_row_index": 7349, "source_split": "train" }
deepcoder_while_sandbox
[ { "content": "Solve the following programming problem. Provide a complete solution in Python.\n\nSince you are the best Wraith King, Nizhniy Magazin «Mir» at the centre of Vinnytsia is offering you a discount.\n\nYou are given an array a of length n and an integer c. \n\nThe value of some array b of length k is...
code_mechanism
{ "ground_truth": "{\"inputs\": [\"3 5\\n1 2 3\\n\", \"12 10\\n1 1 10 10 10 10 10 10 9 10 10 10\\n\", \"7 2\\n2 3 6 4 5 7 1\\n\", \"8 4\\n1 3 4 5 5 3 4 1\\n\", \"15 5\\n11 15 16 24 24 28 36 40 49 49 53 55 66 73 100\\n\", \"11 10\\n58 97 93 74 59 59 76 59 59 59 30\\n\", \"1 1\\n1\\n\", \"15 5\\n1 1 1 1 1 1 1 1 1 1 1 1...
{ "index": 24201, "source": "taco", "source_row_index": 7350, "source_split": "train" }
deepcoder_while_sandbox
[ { "content": "Solve the following programming problem. Provide a complete solution in Python.\n\nConsider a sequence of digits of length $2^k$ $[a_1, a_2, \\ldots, a_{2^k}]$. We perform the following operation with it: replace pairs $(a_{2i+1}, a_{2i+2})$ with $(a_{2i+1} + a_{2i+2})\\bmod 10$ for $0\\le i<2^{k-...
code_mechanism
{ "ground_truth": "{\"inputs\": [\"8\\n8 7 3 1 7 0 9 4\\n3\\n1 8\\n2 5\\n7 7\\n\", \"6\\n0 1 2 3 3 5\\n3\\n1 2\\n1 4\\n3 6\\n\", \"1\\n8\\n1\\n1 1\\n\", \"2\\n9 9\\n2\\n1 1\\n1 2\\n\", \"4\\n8 5 6 6\\n3\\n2 3\\n2 3\\n3 4\\n\", \"10\\n6 6 8 8 2 5 0 1 2 1\\n5\\n5 6\\n3 6\\n8 9\\n7 8\\n2 9\\n\", \"20\\n4 8 6 6 3 0 1 8 3...
{ "index": 24202, "source": "taco", "source_row_index": 7351, "source_split": "train" }
deepcoder_while_sandbox
[ { "content": "Solve the following programming problem. Provide a complete solution in Python.\n\n<image>\n\n\nA directed acyclic graph (DAG) can be used to represent the ordering of tasks. Tasks are represented by vertices and constraints where one task can begin before another, are represented by edges. For ex...
code_mechanism
{ "ground_truth": "{\"inputs\": [\"6 6\\n0 1\\n1 2\\n4 1\\n3 4\\n4 5\\n5 2\", \"6 6\\n0 1\\n1 2\\n4 1\\n3 4\\n4 5\\n5 0\", \"6 6\\n0 2\\n1 2\\n3 1\\n3 4\\n4 5\\n5 2\", \"6 6\\n0 1\\n1 2\\n3 1\\n3 4\\n4 5\\n5 1\", \"6 6\\n0 2\\n1 2\\n4 1\\n3 4\\n1 5\\n5 0\", \"6 0\\n0 1\\n1 2\\n4 1\\n3 4\\n4 5\\n5 2\", \"4 0\\n1 2\\n2...
{ "index": 24203, "source": "taco", "source_row_index": 7352, "source_split": "train" }
deepcoder_while_sandbox
[ { "content": "Solve the following programming problem. Provide a complete solution in Python.\n\nLittle Nastya has a hobby, she likes to remove some letters from word, to obtain another word. But it turns out to be pretty hard for her, because she is too young. Therefore, her brother Sergey always helps her.\n\...
code_mechanism
{ "ground_truth": "{\"inputs\": [\"aaaaaaaadbaaabbbbbddaaabdadbbbbbdbbabbbabaabdbbdababbbddddbdaabbddbbbbabbbbbabadaadabaaaadbbabbbaddb\\naaaaaaaaaaaaaa\\n61 52 5 43 53 81 7 96 6 9 34 78 79 12 8 63 22 76 18 46 41 56 3 20 57 21 75 73 100 94 35 69 32 4 70 95 88 44 68 10 71 98 23 89 36 62 28 51 24 30 74 55 27 80 38 48 9...
{ "index": 24204, "source": "taco", "source_row_index": 7353, "source_split": "train" }
deepcoder_while_sandbox
[ { "content": "Solve the following programming problem. Provide a complete solution in Python.\n\nThere are many blue cards and red cards on the table. For each card, an integer number greater than 1 is printed on its face. The same number may be printed on several cards.\n\nA blue card and a red card can be pai...
code_mechanism
{ "ground_truth": "{\"inputs\": [\"4 3\\n2 6 6 15\\n2 3 5\\n2 3\\n4 9\\n8 16 32\\n4 2\\n4 9 11 13\\n5 7\\n5 5\\n2 3 5 1001 1001\\n7 11 13 30 30\\n10 10\\n2 3 5 7 9 11 13 15 17 29\\n4 6 10 14 18 22 26 30 34 38\\n20 20\\n195 144 903 63 137 513 44 626 75 473\\n876 421 568 519 755 840 374 368 570 872\\n363 650 155 265 64...
{ "index": 24205, "source": "taco", "source_row_index": 7354, "source_split": "train" }
deepcoder_while_sandbox
[ { "content": "Solve the following programming problem. Provide a complete solution in Python.\n\nDuring her tantrums the princess usually smashes some collectable porcelain. Every furious shriek is accompanied with one item smashed.\n\nThe collection of porcelain is arranged neatly on n shelves. Within each she...
code_mechanism
{ "ground_truth": "{\"inputs\": [\"1 4\\n6 5 1 10 1 1 5\\n\", \"3 2\\n1 10\\n1 2\\n1 5\\n\", \"1 1\\n1 100\\n\", \"1 68\\n100 26 58 15 8 69 66 49 97 18 74 27 39 19 76 37 25 4 88 75 17 79 41 21 44 39 7 42 63 82 92 87 41 85 25 30 43 80 95 70 98 88 16 15 97 74 81 76 33 19 64 3 14 72 17 36 33 21 34 59 38 75 48 1 57 20 81...
{ "index": 24206, "source": "taco", "source_row_index": 7355, "source_split": "train" }
deepcoder_while_sandbox
[ { "content": "Solve the following programming problem. Provide a complete solution in Python.\n\nYou are given a integer $n$ ($n > 0$). Find any integer $s$ which satisfies these conditions, or report that there are no such numbers:\n\nIn the decimal representation of $s$: $s > 0$, $s$ consists of $n$ digits...
code_mechanism
{ "ground_truth": "{\"inputs\": [\"4\\n1\\n2\\n3\\n4\\n\", \"5\\n19999\\n19998\\n20001\\n20000\\n20002\\n\", \"1\\n90010\\n\", \"1\\n100000\\n\", \"49\\n2008\\n2045\\n2025\\n2007\\n2002\\n2022\\n2019\\n2043\\n2035\\n2041\\n2004\\n2030\\n2044\\n2028\\n2016\\n2011\\n2001\\n2017\\n2032\\n2013\\n2005\\n2009\\n2047\\n2006...
{ "index": 24207, "source": "taco", "source_row_index": 7356, "source_split": "train" }
deepcoder_while_sandbox
[ { "content": "Solve the following programming problem. Provide a complete solution in Python.\n\nThere are N squares in a row. The leftmost square contains the integer A, and the rightmost contains the integer B. The other squares are empty.\n\nAohashi would like to fill the empty squares with integers so that ...
code_mechanism
{ "ground_truth": "{\"inputs\": [\"1788 105960835 681218449 90629745 90632170\", \"4 7 11 4 5\", \"491995 412925347 465710940 59999126 59999339\", \"1788 122437383 681218449 90629745 90632170\", \"491995 412925347 465710940 59999126 4650906\", \"4 7 11 4 6\", \"1788 122437383 681218449 90629745 148553464\", \"801386 ...
{ "index": 24208, "source": "taco", "source_row_index": 7357, "source_split": "train" }
deepcoder_while_sandbox
[ { "content": "Solve the following programming problem. Provide a complete solution in Python.\n\nPetya loves lucky numbers. Everybody knows that lucky numbers are positive integers whose decimal representation contains only the lucky digits 4 and 7. For example, numbers 47, 744, 4 are lucky and 5, 17, 467 are n...
code_mechanism
{ "ground_truth": "{\"inputs\": [\"369 852\\n\", \"3 4\\n\", \"77 77\\n\", \"77777440 77777444\\n\", \"854444 985555\\n\", \"6 77\\n\", \"7 777777774\\n\", \"12 47\\n\", \"47444 1000000000\\n\", \"1 2\\n\", \"49 49\\n\", \"1000000000 1000000000\\n\", \"474 747\\n\", \"1 1000000\\n\", \"987545885 999875584\\n\", \"1 1...
{ "index": 24209, "source": "taco", "source_row_index": 7358, "source_split": "train" }
deepcoder_while_sandbox
[ { "content": "Solve the following programming problem. Provide a complete solution in Python.\n\nA boy Petya loves chess very much. He even came up with a chess piece of his own, a semiknight. The semiknight can move in any of these four directions: 2 squares forward and 2 squares to the right, 2 squares forwar...
code_mechanism
{ "ground_truth": "{\"inputs\": [\"2\\n........\\n........\\n......#.\\nK..##..#\\n.......#\\n...##..#\\n......#.\\nK.......\\n\\n........\\n........\\n..#.....\\n..#..#..\\n..####..\\n...##...\\n........\\n....K#K#\\n\", \"3\\n........\\n........\\n..#.....\\n..#..#..\\n..####..\\n...##...\\n........\\n####K#K#\\n\\...
{ "index": 24210, "source": "taco", "source_row_index": 7359, "source_split": "train" }
deepcoder_while_sandbox
[ { "content": "Solve the following programming problem. Provide a complete solution in Python.\n\nOne day, Ikta, an elementary school student, received a piece of paper with mathematical formulas from his grandfather. Apparently, the grandfather will give you as much money as the answer to the formula. Ikta has ...
code_mechanism
{ "ground_truth": "{\"inputs\": [\"(1989967-3*2-211+4487)\", \"3-2)3\", \"(5-3*4)+(0-2+1)\", \"3)2-3\", \"0-2+3-4+5-6*0\", \"(1998967-3*1-211+4487)\", \"(5-3*4)*(0-1+1)\", \"(199896743*1-211+4-87)\", \"(5-3*4)*(0-1+2)\", \"0*6-5+5-3+2-0\", \"(199876743*1-211+4-89)\", \"(5-3*3)*(0-1+2)\", \"(199877743*1-211+4-89)\", \...
{ "index": 24211, "source": "taco", "source_row_index": 7360, "source_split": "train" }
deepcoder_while_sandbox
[ { "content": "Solve the following programming problem. Provide a complete solution in Python.\n\nProfessor GukiZ doesn't accept string as they are. He likes to swap some letters in string to obtain a new one.\n\nGukiZ has strings a, b, and c. He wants to obtain string k by swapping some letters in a, so that k ...
code_mechanism
{ "ground_truth": "{\"inputs\": [\"brtakoktrosttttttttttosafasfkalsfkodfdasiofhadfhasdsajfdsafoasodsafahaihfdisoadspapsapiosapdsajdipsahdhasuirhaeuifhhfkjgosooooooooodafdfioottttafdsafaddfuiasdjfjasdo\\nokat\\ntako\\n\", \"aleksandrehteosidatedodam\\nevo\\nsi\\n\", \"goodbyeihopecontestisntsohar\\noh\\ngod\\n\", \"du...
{ "index": 24212, "source": "taco", "source_row_index": 7361, "source_split": "train" }
deepcoder_while_sandbox
[ { "content": "Solve the following programming problem. Provide a complete solution in Python.\n\nExample\n\nInput\n\n6\n2\n3\n1\n1\n4\n2\n\n\nOutput\n\nYes\nYes\nYes\nNo\nYes\nNo", "role": "user" } ]
code_mechanism
{ "ground_truth": "{\"inputs\": [\"6\\n2\\n3\\n1\\n1\\n4\\n1\", \"6\\n2\\n3\\n2\\n0\\n0\\n0\", \"6\\n2\\n3\\n2\\n1\\n11\\n2\", \"6\\n4\\n5\\n2\\n1\\n4\\n1\", \"6\\n0\\n3\\n2\\n1\\n0\\n1\", \"6\\n1\\n1\\n1\\n1\\n-1\\n0\", \"6\\n2\\n1\\n1\\n1\\n4\\n2\", \"6\\n2\\n1\\n1\\n2\\n-1\\n1\", \"6\\n1\\n3\\n0\\n1\\n0\\n2\", \"6...
{ "index": 24213, "source": "taco", "source_row_index": 7362, "source_split": "train" }
deepcoder_while_sandbox
[ { "content": "Solve the following programming problem. Provide a complete solution in Python.\n\nA famous Berland's painter Kalevitch likes to shock the public. One of his last obsessions is chess. For more than a thousand years people have been playing this old game on uninteresting, monotonous boards. Kalevit...
code_mechanism
{ "ground_truth": "{\"inputs\": [\"BBBBBBBB\\nWBWWBBBW\\nBBBBBBBB\\nWBWWBBBW\\nWBWWBBBW\\nWBWWBBBW\\nWBWWBBBW\\nBBBBBBBB\\n\", \"BBBBBBBB\\nBBBBBBBB\\nBBBBBBBB\\nBBBBBBBB\\nBBBBBBBB\\nBBBBBBBB\\nBBBBBBBB\\nBWBBWBWB\\n\", \"BBBBBBBB\\nWWWBBBBB\\nWWWBBBBB\\nBBBBBBBB\\nWWWBBBBB\\nWWWBBBBB\\nBBBBBBBB\\nBBBBBBBB\\n\", \"B...
{ "index": 24214, "source": "taco", "source_row_index": 7363, "source_split": "train" }
deepcoder_while_sandbox
[ { "content": "Solve the following programming problem. Provide a complete solution in Python.\n\nIt's now the season of TAKOYAKI FESTIVAL!\nThis year, N takoyaki (a ball-shaped food with a piece of octopus inside) will be served. The deliciousness of the i-th takoyaki is d_i.\nAs is commonly known, when you eat...
code_mechanism
{ "ground_truth": "{\"inputs\": [\"3\\n3 1 2\\n\", \"7\\n5 0 7 8 3 3 2\\n\", \"50\\n100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100\\n\", \"50\\n0 0 0 0 0 0 0 0 0 0 0...
{ "index": 24215, "source": "taco", "source_row_index": 7364, "source_split": "train" }
deepcoder_while_sandbox
[ { "content": "Solve the following programming problem. Provide a complete solution in Python.\n\nThere are four points: $A(x_1, y_1)$, $B(x_2, y_2)$, $C(x_3, y_3)$, and $D(x_4, y_4)$. Write a program which determines whether the line $AB$ and the line $CD$ are parallel. If those two lines are parallel, your pro...
code_mechanism
{ "ground_truth": "{\"inputs\": [\"2\\n0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0\\n3.0 2.0 9.680227793087974 6.0 13.0 5.0 7.0 9.0\", \"2\\n0.943552035027174 0.0 1.0 1.0 1.0 0.0 2.0 1.0\\n3.0 2.0 9.680227793087974 6.0 13.541356008746918 5.95543610948743 7.0 9.233114893271226\", \"2\\n0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0\\n3.0 2.0 9....
{ "index": 24216, "source": "taco", "source_row_index": 7365, "source_split": "train" }
deepcoder_while_sandbox
[ { "content": "Solve the following programming problem. Provide a complete solution in Python.\n\n# Task\n Suppose there are `n` people standing in a circle and they are numbered 1 through n in order. \n \n Person 1 starts off with a sword and kills person 2. He then passes the sword to the next person still sta...
code_mechanism
{ "ground_truth": "{\"fn_name\": \"circle_slash\", \"inputs\": [[5], [11], [1], [2], [3], [4], [8], [16], [15], [31]], \"outputs\": [[3], [7], [1], [1], [3], [1], [1], [1], [15], [31]]}", "style": "rule" }
{ "index": 24217, "source": "taco", "source_row_index": 7366, "source_split": "train" }
deepcoder_while_sandbox
[ { "content": "Solve the following programming problem. Provide a complete solution in Python.\n\nTo introduce the problem think to my neighbor who drives a tanker truck. \nThe level indicator is down and he is worried\nbecause he does not know if he will be able to make deliveries. \nWe put the truck on a horiz...
code_mechanism
{ "ground_truth": "{\"fn_name\": \"tankvol\", \"inputs\": [[5, 7, 3848], [2, 7, 3848], [2, 8, 5026], [4, 9, 6361], [3, 10, 7853], [3, 5, 1963], [4, 7, 3848], [0, 7, 3848], [7, 7, 3848], [2, 5, 1963], [2, 4, 1256], [4, 10, 7853], [3, 9, 6361], [2, 10, 7853], [5, 9, 6361], [5, 6, 2827], [1, 4, 1256]], \"outputs\": [[29...
{ "index": 24218, "source": "taco", "source_row_index": 7367, "source_split": "train" }
deepcoder_while_sandbox
[ { "content": "Solve the following programming problem. Provide a complete solution in Python.\n\nYou're given a string of dominos. For each slot, there are 3 options:\n\n * \"|\" represents a standing domino\n\n * \"/\" represents a knocked over domino\n\n * \" \" represents a space where there is no domino\...
code_mechanism
{ "ground_truth": "{\"fn_name\": \"domino_reaction\", \"inputs\": [[\"||| ||||//| |/\"], [\"|||||\"], [\" ///\"], [\"\"], [\" \"], [\" |\"], [\"||||| |||\"], [\"|||||/|||\"]], \"outputs\": [[\"/// ||||//| |/\"], [\"/////\"], [\" ///\"], [\"\"], [\" \"], [\" |\"], [\"///// |||\"], [\"//////|||\"]]}", "style": "rule"...
{ "index": 24219, "source": "taco", "source_row_index": 7368, "source_split": "train" }
deepcoder_while_sandbox
[ { "content": "Solve the following programming problem. Provide a complete solution in Python.\n\nThere are N people numbered 1 to N. Each of them is either an honest person whose testimonies are always correct or an unkind person whose testimonies may be correct or not.\nPerson i gives A_i testimonies. The j-th...
code_mechanism
{ "ground_truth": "{\"inputs\": [\"3\\n1\\n2 1\\n1\\n1 1\\n1\\n2 0\\n\", \"3\\n2\\n2 1\\n3 0\\n2\\n3 1\\n1 0\\n2\\n1 1\\n2 0\\n\", \"2\\n1\\n2 0\\n1\\n1 0\\n\", \"15\\n14\\n2 1\\n3 1\\n4 1\\n5 1\\n6 1\\n7 1\\n8 1\\n9 1\\n10 1\\n11 1\\n12 1\\n13 1\\n14 1\\n15 1\\n14\\n1 1\\n3 1\\n4 1\\n5 1\\n6 1\\n7 1\\n8 1\\n9 1\\n10...
{ "index": 24220, "source": "taco", "source_row_index": 7369, "source_split": "train" }
deepcoder_while_sandbox
[ { "content": "Solve the following programming problem. Provide a complete solution in Python.\n\nProblem\n\nLet $ f (x) $ be the sum of each digit when the non-negative integer $ x $ is expressed in binary.\nGiven a positive integer $ N $, output the largest of $ f (0) $, $ f (1) $, ..., $ f (N) $.\n\n\nExample...
code_mechanism
{ "ground_truth": "{\"inputs\": [\"14\", \"22\", \"41\", \"70\", \"6\", \"1\", \"170\", \"264\", \"585\", \"1663\", \"2604\", \"5020\", \"10830\", \"18\", \"21\", \"37\", \"36\", \"11\", \"19\", \"10\", \"5\", \"12\", \"4\", \"75\", \"3\", \"39\", \"13\", \"17\", \"120\", \"8\", \"26\", \"23\", \"7\", \"15\", \"25\",...
{ "index": 24221, "source": "taco", "source_row_index": 7370, "source_split": "train" }
deepcoder_while_sandbox
[ { "content": "Solve the following programming problem. Provide a complete solution in Python.\n\nAll cities of Lineland are located on the Ox coordinate axis. Thus, each city is associated with its position x_{i} — a coordinate on the Ox axis. No two cities are located at a single point.\n\nLineland residents l...
code_mechanism
{ "ground_truth": "{\"inputs\": [\"4\\n-5 -2 2 7\\n\", \"2\\n-1 1\\n\", \"3\\n-1 0 1\\n\", \"4\\n-1 0 1 3\\n\", \"3\\n-1000000000 0 1000000000\\n\", \"2\\n-1000000000 1000000000\\n\", \"10\\n1 10 12 15 59 68 130 912 1239 9123\\n\", \"5\\n-2 -1 0 1 2\\n\", \"5\\n-2 -1 0 1 3\\n\", \"3\\n-10000 1 10000\\n\", \"5\\n-1000...
{ "index": 24222, "source": "taco", "source_row_index": 7371, "source_split": "train" }
deepcoder_while_sandbox
[ { "content": "Solve the following programming problem. Provide a complete solution in Python.\n\nYou are given an array of positive integers $a = [a_0, a_1, \\dots, a_{n - 1}]$ ($n \\ge 2$).\n\nIn one step, the array $a$ is replaced with another array of length $n$, in which each element is the greatest common ...
code_mechanism
{ "ground_truth": "{\"inputs\": [\"5\\n4\\n16 24 10 5\\n4\\n42 42 42 42\\n3\\n4 6 4\\n5\\n1 2 3 4 5\\n6\\n9 9 27 9 9 63\\n\", \"1\\n97\\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 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 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": 24223, "source": "taco", "source_row_index": 7372, "source_split": "train" }
deepcoder_while_sandbox
[ { "content": "Solve the following programming problem. Provide a complete solution in Python.\n\nThere is a grid with H rows and W columns.\n\nThe square at the i-th row and j-th column contains a string S_{i,j} of length 5.\n\nThe rows are labeled with the numbers from 1 through H, and the columns are labeled ...
code_mechanism
{ "ground_truth": "{\"inputs\": [\"15 10\\nsnake snake snake snake snake snake snake snake snake snake\\nsnake snake snake snake snake snake snake snake snake snake\\nsnake snake snake snake snake snake snake snake snake snake\\nsnake snake snake snake snake snake snake snake snake snake\\nsnake snake snake snake sna...
{ "index": 24224, "source": "taco", "source_row_index": 7373, "source_split": "train" }
deepcoder_while_sandbox
[ { "content": "Solve the following programming problem. Provide a complete solution in Python.\n\nIn some other world, today is December D-th.\nWrite a program that prints Christmas if D = 25, Christmas Eve if D = 24, Christmas Eve Eve if D = 23 and Christmas Eve Eve Eve if D = 22.\n\n-----Constraints-----\n - 2...
code_mechanism
{ "ground_truth": "{\"inputs\": [\"25\\n\", \"22\\n\", \"23\\n\", \"24\\n\", \"13\", \"18\", \"4\", \"8\", \"6\", \"0\", \"-1\", \"-2\", \"1\", \"2\", \"3\", \"7\", \"5\", \"-4\", \"-3\", \"-6\", \"-10\", \"-7\", \"-8\", \"10\", \"9\", \"11\", \"19\", \"15\", \"-5\", \"14\", \"12\", \"17\", \"16\", \"21\", \"-12\", \...
{ "index": 24225, "source": "taco", "source_row_index": 7374, "source_split": "train" }
deepcoder_while_sandbox
[ { "content": "Solve the following programming problem. Provide a complete solution in Python.\n\nYour company’s next product will be a new game, which is a three-dimensional variant of the classic game “Tic-Tac-Toe”. Two players place balls in a three-dimensional space (board), and try to make a sequence of a c...
code_mechanism
{ "ground_truth": "{\"inputs\": [\"3 3 3\\n1 1\\n1 1\\n1 1\\n3 3 7\\n2 2\\n1 3\\n1 1\\n2 3\\n2 1\\n3 3\\n3 1\\n4 3 15\\n1 1\\n0 2\\n1 1\\n3 3\\n3 3\\n1 1\\n3 3\\n3 3\\n4 4\\n1 1\\n4 4\\n4 4\\n4 4\\n4 1\\n2 2\\n0 0 0\", \"3 3 3\\n1 1\\n1 1\\n1 1\\n3 3 7\\n3 2\\n1 3\\n1 1\\n2 3\\n2 1\\n3 3\\n3 1\\n4 3 15\\n1 1\\n2 2\\n...
{ "index": 24226, "source": "taco", "source_row_index": 7375, "source_split": "train" }
deepcoder_while_sandbox
[ { "content": "Solve the following programming problem. Provide a complete solution in Python.\n\nThis is the easy version of the problem. The difference between versions is the constraints on $n$ and $a_i$. You can make hacks only if all versions of the problem are solved.\n\nFirst, Aoi came up with the followi...
code_mechanism
{ "ground_truth": "{\"inputs\": [\"3 2\\n3 4 5\\n\", \"4 3\\n2 3 5 6\\n\", \"4 3\\n9 1 1 1\\n\", \"2 2\\n654 1162\\n\", \"5 5\\n1182 1182 1182 1183 1182\\n\", \"5 2\\n1834 1833 1836 1836 1836\\n\", \"5 2\\n679 678 679 678 677\\n\", \"5 3\\n818 819 820 819 820\\n\", \"3 2\\n795 611 751\\n\", \"4 2\\n1639 1165 228 810\...
{ "index": 24227, "source": "taco", "source_row_index": 7376, "source_split": "train" }
deepcoder_while_sandbox
[ { "content": "Solve the following programming problem. Provide a complete solution in Python.\n\nRead problems statements in Mandarin Chinese and Russian. \n\nYou are given two positive integers – A and B. You have to check whether A is divisible by all the prime divisors of B.\n\n------ Input ------ \n\nThe f...
code_mechanism
{ "ground_truth": "{\"inputs\": [\"3\\n120 75\\n128 16\\n7 8\", \"3\\n120 75\\n128 16\\n7 11\", \"3\\n120 137\\n128 16\\n7 11\", \"3\\n53 136\\n128 16\\n0 11\", \"3\\n120 16\\n128 4\\n4 4\", \"3\\n215 16\\n128 12\\n6 4\", \"3\\n82 199\\n339 16\\n1 5\", \"3\\n120 75\\n184 5\\n16 18\", \"3\\n120 75\\n171 16\\n0 11\", \...
{ "index": 24228, "source": "taco", "source_row_index": 7377, "source_split": "train" }
deepcoder_while_sandbox
[ { "content": "Solve the following programming problem. Provide a complete solution in Python.\n\nThe brave Knight came to the King and asked permission to marry the princess. The King knew that the Knight was brave, but he also wanted to know if he was smart enough. So he asked him to solve the following task.\...
code_mechanism
{ "ground_truth": "{\"inputs\": [\"3\\n6 3 2 5 4 1\\n\", \"2\\n3 4 2 1\\n\", \"4\\n1 2 3 4 5 6 7 8\\n\", \"3\\n5 4 1 6 3 2\\n\", \"4\\n6 5 8 7 2 1 4 3\\n\", \"9\\n16 5 18 7 2 9 4 11 6 13 8 15 10 17 12 1 14 3\\n\", \"15\\n11 22 13 24 15 26 17 28 19 30 21 2 23 4 25 6 27 8 29 10 1 12 3 14 5 16 7 18 9 20\\n\", \"3\\n5 4 ...
{ "index": 24229, "source": "taco", "source_row_index": 7378, "source_split": "train" }
deepcoder_while_sandbox
[ { "content": "Solve the following programming problem. Provide a complete solution in Python.\n\n# Task\n Given an integer `product`, find the smallest positive integer the product of whose digits is equal to product. If there is no such integer, return -1 instead.\n\n# Example\n\n For `product = 1`, the output...
code_mechanism
{ "ground_truth": "{\"fn_name\": \"digits_product\", \"inputs\": [[12], [19], [450], [0], [13], [1], [5], [10]], \"outputs\": [[26], [-1], [2559], [10], [-1], [11], [15], [25]]}", "style": "rule" }
{ "index": 24230, "source": "taco", "source_row_index": 7379, "source_split": "train" }
deepcoder_while_sandbox
[ { "content": "Solve the following programming problem. Provide a complete solution in Python.\n\nWe are still with squared integers.\n\nGiven 4 integers `a, b, c, d` we form the sum of the squares of `a` and `b`\nand then the sum of the squares of `c` and `d`. We multiply the two sums hence a number `n` and we ...
code_mechanism
{ "ground_truth": "{\"fn_name\": \"prod2sum\", \"inputs\": [[1, 2, 1, 3], [2, 3, 4, 5], [1, 2, 2, 3], [1, 1, 3, 5], [10, 11, 12, 13], [1, 20, -4, -5], [100, 100, 100, 100], [0, 0, 0, 0], [-14, 12, -10, 8], [7, 96, -1, 81], [112, 0, 0, 1]], \"outputs\": [[[[1, 7], [5, 5]]], [[[2, 23], [7, 22]]], [[[1, 8], [4, 7]]], [[...
{ "index": 24231, "source": "taco", "source_row_index": 7380, "source_split": "train" }
deepcoder_while_sandbox
[ { "content": "Solve the following programming problem. Provide a complete solution in Python.\n\nThere is a new attraction in Singapore Zoo: The Infinite Zoo.\n\nThe Infinite Zoo can be represented by a graph with an infinite number of vertices labeled $1,2,3,\\ldots$. There is a directed edge from vertex $u$ t...
code_mechanism
{ "ground_truth": "{\"inputs\": [\"5\\n1 4\\n3 6\\n1 6\\n6 2\\n5 5\\n\", \"5\\n1 4\\n3 7\\n1 6\\n6 2\\n5 5\\n\", \"5\\n1 5\\n3 6\\n1 6\\n6 2\\n5 5\\n\", \"5\\n1 5\\n3 6\\n1 6\\n6 2\\n4 5\\n\", \"5\\n1 2\\n3 7\\n2 6\\n3 2\\n6 5\\n\", \"5\\n1 3\\n3 7\\n2 6\\n3 2\\n6 5\\n\", \"5\\n1 3\\n3 7\\n2 3\\n1 2\\n6 5\\n\", \"5\\...
{ "index": 24232, "source": "taco", "source_row_index": 7381, "source_split": "train" }
deepcoder_while_sandbox
[ { "content": "Solve the following programming problem. Provide a complete solution in Python.\n\nComplete the solution so that it strips all text that follows any of a set of comment markers passed in. Any whitespace at the end of the line should also be stripped out. \n\n**Example:**\n\nGiven an input string o...
code_mechanism
{ "ground_truth": "{\"fn_name\": \"solution\", \"inputs\": [[\"apples, pears # and bananas\\ngrapes\\nbananas !apples\", [\"#\", \"!\"]], [\"a #b\\nc\\nd $e f g\", [\"#\", \"$\"]], [\"apples, pears # and bananas\\ngrapes\\nbananas !#apples\", [\"#\", \"!\"]], [\"apples, pears # and bananas\\ngrapes\\nbananas #!apples...
{ "index": 24233, "source": "taco", "source_row_index": 7382, "source_split": "train" }
deepcoder_while_sandbox
[ { "content": "Solve the following programming problem. Provide a complete solution in Python.\n\nMost C/C++ programmers know about excellent opportunities that preprocessor #define directives give; but many know as well about the problems that can arise because of their careless use.\n\nIn this problem we consi...
code_mechanism
{ "ground_truth": "{\"inputs\": [\"1\\n#define sum x+y\\nsum*r\\n\", \"3\\n#define uYdw ((9-x-3) )\\n#define fy (((x+21)))\\n#define nY ((2+x)-46)\\n141141432\\n\", \"3\\n#define T ((b/1 +1))\\n#define pm (s)-43-(s)\\n#define jkNBpvDZl ((x ))/65\\n(((58*7)))\\n\", \"1\\n#define sum x+y\\nr*sum\\n\", \"3\\n#define nul...
{ "index": 24234, "source": "taco", "source_row_index": 7383, "source_split": "train" }
deepcoder_while_sandbox
[ { "content": "Solve the following programming problem. Provide a complete solution in Python.\n\nFind the length between 2 co-ordinates. The co-ordinates are made of integers between -20 and 20 and will be given in the form of a 2D array:\n\n(0,0) and (5,-7) would be [ [ 0 , 0 ] , [ 5, -7 ] ]\n\nThe function m...
code_mechanism
{ "ground_truth": "{\"fn_name\": \"length_of_line\", \"inputs\": [[[[0, 0], [1, 1]]], [[[0, 0], [-5, -6]]], [[[0, 0], [10, 15]]], [[[0, 0], [5, 1]]], [[[0, 0], [5, 4]]], [[[0, 0], [-7, 4]]], [[[0, 0], [0, 0]]], [[[-3, 4], [10, 5]]]], \"outputs\": [[\"1.41\"], [\"7.81\"], [\"18.03\"], [\"5.10\"], [\"6.40\"], [\"8.06\"...
{ "index": 24235, "source": "taco", "source_row_index": 7384, "source_split": "train" }
deepcoder_while_sandbox
[ { "content": "Solve the following programming problem. Provide a complete solution in Python.\n\nA connected undirected graph is called a vertex cactus, if each vertex of this graph belongs to at most one simple cycle.\n\nA simple cycle in a undirected graph is a sequence of distinct vertices v1, v2, ..., vt (t...
code_mechanism
{ "ground_truth": "{\"inputs\": [\"2 1\\n1 2\\n3\\n1 2\\n1 2\\n2 1\\n\", \"5 4\\n1 3\\n2 3\\n4 3\\n1 5\\n3\\n1 3\\n2 4\\n5 2\\n\", \"6 6\\n1 2\\n2 3\\n3 4\\n4 5\\n5 6\\n6 1\\n4\\n1 2\\n1 6\\n6 5\\n4 3\\n\", \"40 43\\n1 2\\n1 3\\n1 4\\n4 5\\n5 6\\n1 7\\n5 8\\n7 9\\n2 10\\n10 11\\n11 12\\n2 13\\n13 14\\n14 15\\n15 16\\...
{ "index": 24236, "source": "taco", "source_row_index": 7385, "source_split": "train" }
deepcoder_while_sandbox
[ { "content": "Solve the following programming problem. Provide a complete solution in Python.\n\nThere are n points marked on the plane. The points are situated in such a way that they form a regular polygon (marked points are its vertices, and they are numbered in counter-clockwise order). You can draw n - 1 s...
code_mechanism
{ "ground_truth": "{\"inputs\": [\"3\\n0 0 1\\n0 0 1\\n1 1 0\\n\", \"4\\n0 1 1 1\\n1 0 1 1\\n1 1 0 1\\n1 1 1 0\\n\", \"3\\n0 0 0\\n0 0 1\\n0 1 0\\n\", \"4\\n0 0 0 1\\n0 0 0 0\\n0 0 0 1\\n1 0 1 0\\n\", \"4\\n0 0 1 0\\n0 0 0 1\\n1 0 0 0\\n0 1 0 0\\n\", \"10\\n0 0 0 0 0 0 1 0 0 0\\n0 0 0 0 0 0 0 0 0 0\\n0 0 0 1 0 0 0 0 ...
{ "index": 24237, "source": "taco", "source_row_index": 7386, "source_split": "train" }
deepcoder_while_sandbox
[ { "content": "Solve the following programming problem. Provide a complete solution in Python.\n\nLet's define the permutation of length n as an array p = [p1, p2, ..., pn] consisting of n distinct integers from range from 1 to n. We say that this permutation maps value 1 into the value p1, value 2 into the valu...
code_mechanism
{ "ground_truth": "{\"inputs\": [\"31 1899100\\n\", \"16 747\\n\", \"44 863791309\\n\", \"25 121393\\n\", \"15 463\\n\", \"36 7074882\\n\", \"50 20365011074\\n\", \"34 2412850\\n\", \"39 68773650\\n\", \"24 47430\\n\", \"18 1809\\n\", \"19 859\\n\", \"10 89\\n\", \"6 10\\n\", \"32 1314567\\n\", \"2 2\\n\", \"23 45599...
{ "index": 24238, "source": "taco", "source_row_index": 7387, "source_split": "train" }
deepcoder_while_sandbox
[ { "content": "Solve the following programming problem. Provide a complete solution in Python.\n\nCreate a function named `divisors`/`Divisors` that takes an integer `n > 1` and returns an array with all of the integer's divisors(except for 1 and the number itself), from smallest to largest. If the number is pri...
code_mechanism
{ "ground_truth": "{\"fn_name\": \"divisors\", \"inputs\": [[15], [253], [24], [13], [3], [29]], \"outputs\": [[[3, 5]], [[11, 23]], [[2, 3, 4, 6, 8, 12]], [\"13 is prime\"], [\"3 is prime\"], [\"29 is prime\"]]}", "style": "rule" }
{ "index": 24239, "source": "taco", "source_row_index": 7388, "source_split": "train" }
deepcoder_while_sandbox
[ { "content": "Solve the following programming problem. Provide a complete solution in Python.\n\n```if-not:sql\nImplement a function that receives two IPv4 addresses, and returns the number of addresses between them (including the first one, excluding the last one).\n```\n\n```if:sql\nGiven a database of first ...
code_mechanism
{ "ground_truth": "{\"fn_name\": \"ips_between\", \"inputs\": [[\"150.0.0.0\", \"150.0.0.1\"], [\"10.0.0.0\", \"10.0.0.50\"], [\"20.0.0.10\", \"20.0.1.0\"], [\"10.11.12.13\", \"10.11.13.0\"], [\"160.0.0.0\", \"160.0.1.0\"], [\"170.0.0.0\", \"170.1.0.0\"], [\"50.0.0.0\", \"50.1.1.1\"], [\"180.0.0.0\", \"181.0.0.0\"], ...
{ "index": 24240, "source": "taco", "source_row_index": 7389, "source_split": "train" }
deepcoder_while_sandbox
[ { "content": "Solve the following programming problem. Provide a complete solution in Python.\n\nThis problem is same as the previous one, but has larger constraints.\n\nIt was a Sunday morning when the three friends Selena, Shiro and Katie decided to have a trip to the nearby power station (do not try this at ...
code_mechanism
{ "ground_truth": "{\"inputs\": [\"4\\n0 0\\n1 1\\n0 3\\n1 2\", \"4\\n0 0\\n0 2\\n0 4\\n2 0\", \"3\\n-1 -1\\n1 0\\n3 1\", \"4\\n-10000 -10000\\n-10000 -9999\\n10000 10000\\n9999 10000\\n\", \"16\\n0 0\\n0 2\\n0 4\\n0 6\\n2 0\\n2 2\\n2 4\\n2 6\\n4 0\\n4 2\\n4 4\\n4 6\\n6 0\\n6 2\\n6 4\\n6 6\\n\", \"4\\n-10000 -10000\\...
{ "index": 24241, "source": "taco", "source_row_index": 7390, "source_split": "train" }
deepcoder_while_sandbox
[ { "content": "Solve the following programming problem. Provide a complete solution in Python.\n\nThe only difference between easy and hard versions is the length of the string. You can hack this problem if you solve it. But you can hack the previous problem only if you solve both problems.\n\nKirk has a binary ...
code_mechanism
{ "ground_truth": "{\"inputs\": [\"110\\n\", \"010\\n\", \"0001111\\n\", \"0111001100111011101000\\n\", \"0\\n\", \"1\\n\", \"0000000000000000\\n\", \"0100000001000001\\n\", \"0000100010001110\\n\", \"1001101000001101\\n\", \"0010000110000100\\n\", \"1111101000110110\\n\", \"1111111111111010\\n\", \"1111111111111111\...
{ "index": 24242, "source": "taco", "source_row_index": 7391, "source_split": "train" }
deepcoder_while_sandbox
[ { "content": "Solve the following programming problem. Provide a complete solution in Python.\n\nSurrounding Area\n\nLand fence\n\nEnglish text is not available in this practice contest.\n\nTwo real estate agents were boarding a passenger ship to the southern island. Blue sky, refreshing breeze ... The two enjo...
code_mechanism
{ "ground_truth": "{\"inputs\": [\"10 10\\n.....W....\\n....W.W...\\n...W...W..\\n....W...W.\\n.....W...W\\n......W.W.\\nBBB....W..\\n..B..BBBBB\\n..B..B....\\n..B..B..W.\\n5 3\\n.B...\\n...BB\\n.....\\n1 1\\n.\\n0 0\", \"10 10\\n.....W....\\n....W.W...\\n..W...W...\\n....W...W.\\n.....W...W\\n......W.W.\\nBBB....W.....
{ "index": 24243, "source": "taco", "source_row_index": 7392, "source_split": "train" }
deepcoder_while_sandbox
[ { "content": "Solve the following programming problem. Provide a complete solution in Python.\n\nConsider some set of distinct characters $A$ and some string $S$, consisting of exactly $n$ characters, where each character is present in $A$.\n\nYou are given an array of $m$ integers $b$ ($b_1 < b_2 < \\dots < b_...
code_mechanism
{ "ground_truth": "{\"inputs\": [\"3 1 2\\n1\\n\", \"9 2 26\\n2 3\\n\", \"12 3 1\\n2 5 6\\n\", \"2 1 1\\n1\\n\", \"2 1 234\\n1\\n\", \"6 2 5\\n1 3\\n\", \"2 1 1000000000\\n1\\n\", \"1000000000 1 1\\n1\\n\", \"1000000000 2 2\\n1 500000000\\n\", \"8 1 8\\n2\\n\", \"1000000000 1 1\\n1\\n\", \"1000000000 2 2\\n1 50000000...
{ "index": 24244, "source": "taco", "source_row_index": 7393, "source_split": "train" }
deepcoder_while_sandbox
[ { "content": "Solve the following programming problem. Provide a complete solution in Python.\n\nThere are n employees in Alternative Cake Manufacturing (ACM). They are now voting on some very important question and the leading world media are trying to predict the outcome of the vote.\n\nEach of the employees ...
code_mechanism
{ "ground_truth": "{\"inputs\": [\"5\\nDDRRR\\n\", \"6\\nDDRRRR\\n\", \"1\\nD\\n\", \"1\\nR\\n\", \"2\\nDR\\n\", \"3\\nRDD\\n\", \"3\\nDRD\\n\", \"4\\nDRRD\\n\", \"4\\nDRRR\\n\", \"4\\nRDRD\\n\", \"5\\nDRDRR\\n\", \"4\\nRRRR\\n\", \"5\\nRDDRD\\n\", \"5\\nDDRRD\\n\", \"5\\nDRRRD\\n\", \"5\\nDDDDD\\n\", \"6\\nDRRDDR\\n...
{ "index": 24245, "source": "taco", "source_row_index": 7394, "source_split": "train" }
deepcoder_while_sandbox
[ { "content": "Solve the following programming problem. Provide a complete solution in Python.\n\nIahub is so happy about inventing bubble sort graphs that he's staying all day long at the office and writing permutations. Iahubina is angry that she is no more important for Iahub. When Iahub goes away, Iahubina c...
code_mechanism
{ "ground_truth": "{\"inputs\": [\"5\\n-1 -1 4 3 -1\\n\", \"8\\n2 4 5 3 -1 8 -1 6\\n\", \"7\\n-1 -1 4 -1 7 1 6\\n\", \"6\\n-1 -1 -1 -1 -1 -1\\n\", \"2\\n-1 -1\\n\", \"10\\n4 10 -1 1 6 8 9 2 -1 -1\\n\", \"20\\n-1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1\\n\", \"6\\n-1 -1 -1 -1 -1 -1\\n\", \"7\\n-1 -1 4...
{ "index": 24246, "source": "taco", "source_row_index": 7395, "source_split": "train" }
deepcoder_while_sandbox
[ { "content": "Solve the following programming problem. Provide a complete solution in Python.\n\nVasily the Programmer loves romance, so this year he decided to illuminate his room with candles.\n\nVasily has a candles.When Vasily lights up a new candle, it first burns for an hour and then it goes out. Vasily i...
code_mechanism
{ "ground_truth": "{\"inputs\": [\"4 2\\n\", \"6 3\\n\", \"1000 1000\\n\", \"123 5\\n\", \"1000 2\\n\", \"1 2\\n\", \"1 3\\n\", \"1 4\\n\", \"2 2\\n\", \"3 2\\n\", \"3 3\\n\", \"999 2\\n\", \"1000 3\\n\", \"1000 4\\n\", \"1 1000\\n\", \"80 970\\n\", \"80 970\\n\", \"80 970\\n\", \"80 970\\n\", \"80 970\\n\", \"80 970...
{ "index": 24247, "source": "taco", "source_row_index": 7396, "source_split": "train" }
deepcoder_while_sandbox
[ { "content": "Solve the following programming problem. Provide a complete solution in Python.\n\nEve is a beginner stand-up comedian. Her first show gathered a grand total of two spectators: Alice and Bob.\n\nEve prepared $a_1 + a_2 + a_3 + a_4$ jokes to tell, grouped by their type:\n\ntype 1: both Alice and Bo...
code_mechanism
{ "ground_truth": "{\"inputs\": [\"4\\n5 0 0 0\\n0 0 0 5\\n2 5 10 6\\n3 0 0 7\\n\", \"1\\n1001 100000000 100000000 100000000\\n\", \"1\\n1 100000000 100000000 100000000\\n\", \"1\\n25 5 5 5\\n\", \"1\\n4001 0 0 0\\n\", \"1\\n1 100000000 100000000 1234\\n\", \"1\\n1 100000000 100000000 1238\\n\", \"1\\n1 100000000 100...
{ "index": 24248, "source": "taco", "source_row_index": 7397, "source_split": "train" }
deepcoder_while_sandbox
[ { "content": "Solve the following programming problem. Provide a complete solution in Python.\n\nAfter their adventure with the magic mirror Kay and Gerda have returned home and sometimes give free ice cream to kids in the summer.\n\nAt the start of the day they have x ice cream packs. Since the ice cream is fr...
code_mechanism
{ "ground_truth": "{\"inputs\": [\"5 7\\n+ 5\\n- 10\\n- 20\\n+ 40\\n- 20\\n\", \"5 17\\n- 16\\n- 2\\n- 98\\n+ 100\\n- 98\\n\", \"6 1000000000\\n+ 1000000000\\n+ 1000000000\\n+ 1000000000\\n+ 1000000000\\n+ 1000000000\\n+ 1000000000\\n\", \"5 12\\n- 12\\n+ 7\\n- 6\\n- 1\\n+ 46\\n\", \"11 1000\\n- 100\\n+ 100\\n+ 100\\...
{ "index": 24249, "source": "taco", "source_row_index": 7398, "source_split": "train" }
deepcoder_while_sandbox
[ { "content": "Solve the following programming problem. Provide a complete solution in Python.\n\nThis is the easy version of this problem. The only difference between easy and hard versions is the constraints on $k$ and $m$ (in this version $k=2$ and $m=3$). Also, in this version of the problem, you DON'T NEED ...
code_mechanism
{ "ground_truth": "{\"inputs\": [\"4\\n4\\n1 2 4 3\\n4\\n1 1 1 1\\n1\\n1\\n10\\n5 6 1 3 2 9 8 1 2 4\\n\", \"2\\n5\\n1 1 1 1 1\\n4\\n1 1 1 1\\n\", \"3\\n1\\n1\\n1\\n1\\n1\\n1\\n\", \"2\\n2\\n2 2\\n1\\n1\\n\", \"10\\n3\\n1 1 1\\n1\\n1\\n4\\n3 4 3 3\\n1\\n1\\n7\\n7 1 1 5 3 6 5\\n3\\n2 2 1\\n9\\n4 1 7 1 1 6 7 1 7\\n5\\n2...
{ "index": 24250, "source": "taco", "source_row_index": 7399, "source_split": "train" }
deepcoder_while_sandbox
[ { "content": "Solve the following programming problem. Provide a complete solution in Python.\n\nYou are given an array $a$ of length $n$ consisting of integers. You can apply the following operation, consisting of several steps, on the array $a$ zero or more times:\n\nyou select two different numbers in the ar...
code_mechanism
{ "ground_truth": "{\"inputs\": [\"5\\n6\\n1 6 1 1 4 4\\n2\\n1 2\\n2\\n1 1\\n5\\n4 5 4 5 4\\n6\\n2 3 2 1 3 1\\n\", \"1\\n12\\n2 2 2 2 4 4 4 4 6 6 6 6\\n\", \"1\\n12\\n2 2 2 2 4 4 4 4 6 6 6 6\\n\", \"1\\n12\\n1 2 2 2 4 4 4 4 6 6 6 6\\n\", \"5\\n6\\n2 6 1 1 4 4\\n2\\n1 2\\n2\\n1 1\\n5\\n4 5 4 5 4\\n6\\n2 3 2 1 3 1\\n\"...
{ "index": 24251, "source": "taco", "source_row_index": 7400, "source_split": "train" }
deepcoder_while_sandbox
[ { "content": "Solve the following programming problem. Provide a complete solution in Python.\n\nYou are given n patterns p_1, p_2, ..., p_n and m strings s_1, s_2, ..., s_m. Each pattern p_i consists of k characters that are either lowercase Latin letters or wildcard characters (denoted by underscores). All pa...
code_mechanism
{ "ground_truth": "{\"inputs\": [\"10 10 3\\ncaa\\nc_c\\nba_\\naca\\nabb\\n_cc\\n_ba\\nbac\\nccb\\n_ab\\nabb 1\\ncca 8\\nacb 4\\ncbb 2\\nbaa 10\\nbba 8\\nbca 1\\ncab 8\\naaa 2\\nccb 6\\n\", \"5 10 1\\n_\\nb\\nc\\nd\\na\\nc 2\\na 5\\nb 5\\nb 2\\nd 5\\na 3\\nd 5\\nc 2\\nb 2\\nd 2\\n\", \"5 5 3\\ncaa\\nabb\\ncbb\\naac\\...
{ "index": 24252, "source": "taco", "source_row_index": 7401, "source_split": "train" }
deepcoder_while_sandbox
[ { "content": "Solve the following programming problem. Provide a complete solution in Python.\n\nYou are given a set of points on a straight line. Each point has a color assigned to it. For point a, its neighbors are the points which don't have any other points between them and a. Each point has at most two nei...
code_mechanism
{ "ground_truth": "{\"inputs\": [\"aabb\\n\", \"aabcaa\\n\", \"abbcccbba\\n\", \"aaaaaaaaaaa\\n\", \"aaaaaaaaabbbbbaaaabaaaaaaaaaaaaaaaaabaaaaaabbbbbbbaaabbbbbbbbbbbbbbbbbbbbbaaaaaaaaaaaaaaaaaaaaaaaaaa\\n\", \"abc\\n\", \"a\\n\", \"ab\\n\", \"ba\\n\", \"aaabbb\\n\", \"abababababab\\n\", \"aaabbbbbbaaa\\n\", \"bbbbbbb...
{ "index": 24253, "source": "taco", "source_row_index": 7402, "source_split": "train" }
deepcoder_while_sandbox
[ { "content": "Solve the following programming problem. Provide a complete solution in Python.\n\nGiven is a positive integer N.\nWe will choose an integer K between 2 and N (inclusive), then we will repeat the operation below until N becomes less than K.\n - Operation: if K divides N, replace N with N/K; otherw...
code_mechanism
{ "ground_truth": "{\"inputs\": [\"6\\n\", \"3141\\n\", \"314159265358\\n\", \"1000000000000\\n\", \"642507465600\\n\", \"2\\n\", \"4294967296\\n\", \"260522\\n\", \"914575\\n\", \"436426\\n\", \"540024979445\\n\", \"917861648772\\n\", \"962623690081\\n\", \"523968956449\\n\", \"145329450841\\n\", \"2106351025\\n\", ...
{ "index": 24254, "source": "taco", "source_row_index": 7403, "source_split": "train" }
deepcoder_while_sandbox
[ { "content": "Solve the following programming problem. Provide a complete solution in Python.\n\nDuring a New Year special offer the \"Sudislavl Bars\" offered n promo codes. Each promo code consists of exactly six digits and gives right to one free cocktail at the bar \"Mosquito Shelter\". Of course, all the p...
code_mechanism
{ "ground_truth": "{\"inputs\": [\"2\\n000000\\n999999\\n\", \"6\\n211111\\n212111\\n222111\\n111111\\n112111\\n121111\\n\", \"1\\n123456\\n\", \"2\\n000000\\n099999\\n\", \"2\\n000000\\n009999\\n\", \"2\\n000000\\n000999\\n\", \"2\\n000000\\n000099\\n\", \"2\\n000000\\n000009\\n\", \"1\\n000000\\n\", \"1\\n999999\\n...
{ "index": 24255, "source": "taco", "source_row_index": 7404, "source_split": "train" }
deepcoder_while_sandbox
[ { "content": "Solve the following programming problem. Provide a complete solution in Python.\n\nFor a given sequence $A = \\\\{a_0, a_1, ..., a_{n-1}\\\\}$ which is sorted by ascending order, find a specific value $k$ given as a query.\n\nConstraints\n\n* $1 \\leq n \\leq 100,000$\n* $1 \\leq q \\leq 200,000$\...
code_mechanism
{ "ground_truth": "{\"inputs\": [\"4\\n1 2 2 4\\n3\\n2\\n3\\n6\", \"4\\n1 1 2 4\\n3\\n0\\n3\\n8\", \"4\\n0 1 2 7\\n3\\n0\\n7\\n10\", \"4\\n0 1 2 6\\n3\\n0\\n3\\n6\", \"4\\n1 2 1 4\\n2\\n0\\n3\\n8\", \"4\\n0 1 2 7\\n1\\n0\\n5\\n3\", \"4\\n0 2 3 4\\n3\\n2\\n3\\n4\", \"4\\n0 1 2 7\\n1\\n-1\\n5\\n3\", \"4\\n0 2 1 3\\n3\\...
{ "index": 24256, "source": "taco", "source_row_index": 7405, "source_split": "train" }
deepcoder_while_sandbox
[ { "content": "Solve the following programming problem. Provide a complete solution in Python.\n\nSquirrel Liss is interested in sequences. She also has preferences of integers. She thinks n integers a1, a2, ..., an are good.\n\nNow she is interested in good sequences. A sequence x1, x2, ..., xk is called good i...
code_mechanism
{ "ground_truth": "{\"inputs\": [\"2\\n1009 2018\\n\", \"7\\n1 2 3 4 7 9 10\\n\", \"2\\n601 1202\\n\", \"8\\n3 4 5 6 7 8 9 10\\n\", \"2\\n5101 10202\\n\", \"3\\n21 67 243\\n\", \"5\\n2 3 7 9 10\\n\", \"1\\n99991\\n\", \"3\\n1 4 7\\n\", \"3\\n3 14 22\\n\", \"10\\n2 4 8 67 128 324 789 1296 39877 98383\\n\", \"10\\n2 3 ...
{ "index": 24257, "source": "taco", "source_row_index": 7406, "source_split": "train" }
deepcoder_while_sandbox
[ { "content": "Solve the following programming problem. Provide a complete solution in Python.\n\nPolycarp knows that if the sum of the digits of a number is divisible by $3$, then the number itself is divisible by $3$. He assumes that the numbers, the sum of the digits of which is divisible by $4$, are also som...
code_mechanism
{ "ground_truth": "{\"inputs\": [\"432\\n\", \"99\\n\", \"237\\n\", \"42\\n\", \"1\\n\", \"2\\n\", \"1000\\n\", \"898\\n\", \"997\\n\", \"999\\n\", \"399\\n\", \"8\\n\", \"120\\n\", \"909\\n\", \"9\\n\", \"398\\n\", \"7\\n\", \"799\\n\", \"970\\n\", \"188\\n\", \"4\\n\", \"38\\n\", \"12\\n\", \"3\\n\", \"518\\n\", \"...
{ "index": 24258, "source": "taco", "source_row_index": 7407, "source_split": "train" }
deepcoder_while_sandbox
[ { "content": "Solve the following programming problem. Provide a complete solution in Python.\n\nTakahashi has A untasty cookies containing antidotes, B tasty cookies containing antidotes and C tasty cookies containing poison.\n\nEating a cookie containing poison results in a stomachache, and eating a cookie co...
code_mechanism
{ "ground_truth": "{\"inputs\": [\"0 1 4\", \"14 8 1\", \"9 2 9\", \"0 0 4\", \"14 8 2\", \"3 2 9\", \"11 15 2\", \"11 15 4\", \"3 0 12\", \"0 2 0\", \"11 15 0\", \"0 0 0\", \"16 5 0\", \"-2 0 0\", \"3 1 27\", \"-1 1 -4\", \"6 -2 0\", \"-1 -2 0\", \"-2 -2 -1\", \"-4 -2 -1\", \"0 -2 -4\", \"0 -2 -6\", \"1 -8 7\", \"1 ...
{ "index": 24259, "source": "taco", "source_row_index": 7408, "source_split": "train" }
deepcoder_while_sandbox
[ { "content": "Solve the following programming problem. Provide a complete solution in Python.\n\nIn the Kingdom of AtCoder, only banknotes are used as currency. There are 10^{100}+1 kinds of banknotes, with the values of 1, 10, 10^2, 10^3, \\dots, 10^{(10^{100})}. You have come shopping at a mall and are now bu...
code_mechanism
{ "ground_truth": "{\"inputs\": [\"36\\n\", \"91\\n\", \"314159265358979323846264338327950288419716939937551058209749445923078164062862089986280348253421170\\n\", \"30\", \"476640020082194381531155118436783393866726953614433851622190777875571135215042541028243752681838573\", \"22\", \"41\", \"402419059500366785869358...
{ "index": 24260, "source": "taco", "source_row_index": 7409, "source_split": "train" }
deepcoder_while_sandbox
[ { "content": "Solve the following programming problem. Provide a complete solution in Python.\n\nBob has a favorite number k and ai of length n. Now he asks you to answer m queries. Each query is given by a pair li and ri and asks you to count the number of pairs of integers i and j, such that l ≤ i ≤ j ≤ r and...
code_mechanism
{ "ground_truth": "{\"inputs\": [\"6 2 4\\n1 2 1 1 0 3\\n1 6\\n3 5\\n\", \"5 3 1\\n0 1 1 1 1\\n1 5\\n2 4\\n1 3\\n\", \"6 2 3\\n1 4 1 1 0 3\\n1 6\\n3 5\\n\", \"5 3 1\\n0 1 1 1 1\\n1 5\\n2 4\\n1 2\\n\", \"5 3 0\\n0 1 1 1 1\\n1 5\\n2 4\\n1 2\\n\", \"6 2 4\\n1 2 1 1 1 5\\n1 6\\n3 5\\n\", \"5 3 1\\n0 1 2 1 1\\n1 5\\n2 4\\...
{ "index": 24261, "source": "taco", "source_row_index": 7410, "source_split": "train" }
deepcoder_while_sandbox
[ { "content": "Solve the following programming problem. Provide a complete solution in Python.\n\nLet's denote a function $f(x)$ in such a way: we add $1$ to $x$, then, while there is at least one trailing zero in the resulting number, we remove that zero. For example, $f(599) = 6$: $599 + 1 = 600 \\rightarrow...
code_mechanism
{ "ground_truth": "{\"inputs\": [\"1098\\n\", \"10\\n\", \"1000000000\\n\", \"1\\n\", \"9\\n\", \"10119\\n\", \"1337\\n\", \"51\\n\", \"99\\n\", \"79\\n\", \"29\\n\", \"633\\n\", \"9000\\n\", \"99999999\\n\", \"932415950\\n\", \"90\\n\", \"45\\n\", \"22\\n\", \"987654321\\n\", \"599\\n\", \"54\\n\", \"73180\\n\", \"9...
{ "index": 24262, "source": "taco", "source_row_index": 7411, "source_split": "train" }
deepcoder_while_sandbox
[ { "content": "Solve the following programming problem. Provide a complete solution in Python.\n\nImplement the function which should return `true` if given object is a vowel (meaning `a, e, i, o, u`), and `false` otherwise.", "role": "user" } ]
code_mechanism
{ "ground_truth": "{\"fn_name\": \"is_vowel\", \"inputs\": [[\"\"], [\"a\"], [\"E\"], [\"ou\"], [\"z\"], [\"lol\"]], \"outputs\": [[false], [true], [true], [false], [false], [false]]}", "style": "rule" }
{ "index": 24263, "source": "taco", "source_row_index": 7412, "source_split": "train" }
deepcoder_while_sandbox
[ { "content": "Solve the following programming problem. Provide a complete solution in Python.\n\nVasya's bicycle chain drive consists of two parts: n stars are attached to the pedal axle, m stars are attached to the rear wheel axle. The chain helps to rotate the rear wheel by transmitting the pedal rotation.\n\...
code_mechanism
{ "ground_truth": "{\"inputs\": [\"1\\n1\\n2\\n1 2\\n\", \"50\\n17 20 22 28 36 38 46 47 48 50 52 57 58 62 63 69 70 74 75 78 79 81 82 86 87 90 93 95 103 202 292 442 1756 1769 2208 2311 2799 2957 3483 4280 4324 4932 5109 5204 6225 6354 6561 7136 8754 9670\\n40\\n68 214 957 1649 1940 2078 2134 2716 3492 3686 4462 4559 4...
{ "index": 24264, "source": "taco", "source_row_index": 7413, "source_split": "train" }
deepcoder_while_sandbox
[ { "content": "Solve the following programming problem. Provide a complete solution in Python.\n\nConsider the following process. You have a binary string (a string where each character is either 0 or 1) $w$ of length $n$ and an integer $x$. You build a new binary string $s$ consisting of $n$ characters. The $i$...
code_mechanism
{ "ground_truth": "{\"inputs\": [\"3\\n101110\\n2\\n01\\n1\\n110\\n1\\n\", \"3\\n100110\\n2\\n01\\n1\\n110\\n1\\n\", \"3\\n100110\\n2\\n01\\n1\\n111\\n1\\n\", \"3\\n100110\\n2\\n01\\n2\\n011\\n1\\n\", \"3\\n000110\\n2\\n01\\n2\\n011\\n1\\n\", \"3\\n001110\\n2\\n01\\n2\\n111\\n1\\n\", \"3\\n001110\\n2\\n01\\n2\\n101\\...
{ "index": 24265, "source": "taco", "source_row_index": 7414, "source_split": "train" }
deepcoder_while_sandbox
[ { "content": "Solve the following programming problem. Provide a complete solution in Python.\n\nA number is called powerful if it is a power of two or a factorial. In other words, the number $m$ is powerful if there exists a non-negative integer $d$ such that $m=2^d$ or $m=d!$, where $d!=1\\cdot 2\\cdot \\ldot...
code_mechanism
{ "ground_truth": "{\"inputs\": [\"4\\n7\\n11\\n240\\n17179869184\\n\", \"100\\n1\\n2\\n3\\n4\\n5\\n6\\n7\\n8\\n9\\n10\\n11\\n12\\n13\\n14\\n15\\n16\\n17\\n18\\n19\\n20\\n21\\n22\\n23\\n24\\n25\\n26\\n27\\n28\\n29\\n30\\n31\\n32\\n33\\n34\\n35\\n36\\n37\\n38\\n39\\n40\\n41\\n42\\n43\\n44\\n45\\n46\\n47\\n48\\n49\\n50...
{ "index": 24266, "source": "taco", "source_row_index": 7415, "source_split": "train" }
deepcoder_while_sandbox
[ { "content": "Solve the following programming problem. Provide a complete solution in Python.\n\nTheatre Square in the capital city of Berland has a rectangular shape with the size n × m meters. On the occasion of the city's anniversary, a decision was taken to pave the Square with square granite flagstones. Ea...
code_mechanism
{ "ground_truth": "{\"inputs\": [\"1 1 3\\n\", \"1000000000 1000000000 1\\n\", \"2 1 2\\n\", \"222 332 5\\n\", \"2 2 1\\n\", \"456784567 1000000000 51\\n\", \"1001 1000 10\\n\", \"2 3 4\\n\", \"1000000000 1000000000 999999999\\n\", \"2 1 1\\n\", \"100 10001 1000000000\\n\", \"39916800 134217728 40320\\n\", \"12 13 4\...
{ "index": 24267, "source": "taco", "source_row_index": 7416, "source_split": "train" }
deepcoder_while_sandbox
[ { "content": "Solve the following programming problem. Provide a complete solution in Python.\n\nYou're given an array $b$ of length $n$. Let's define another array $a$, also of length $n$, for which $a_i = 2^{b_i}$ ($1 \\leq i \\leq n$). \n\nValerii says that every two non-intersecting subarrays of $a$ have di...
code_mechanism
{ "ground_truth": "{\"inputs\": [\"2\\n6\\n4 3 0 1 2 0\\n2\\n2 5\\n\", \"1\\n3\\n1 1 2\\n\", \"1\\n3\\n1 1 1\\n\", \"1\\n3\\n1 2 3\\n\", \"1\\n3\\n1 2 3\\n\", \"1\\n3\\n1 1 1\\n\", \"1\\n3\\n1 1 2\\n\", \"1\\n3\\n1 2 2\\n\", \"2\\n6\\n0 3 0 1 2 0\\n2\\n2 5\\n\", \"1\\n3\\n0 2 1\\n\", \"1\\n3\\n0 1 1\\n\", \"1\\n3\\n0...
{ "index": 24268, "source": "taco", "source_row_index": 7417, "source_split": "train" }
deepcoder_while_sandbox
[ { "content": "Solve the following programming problem. Provide a complete solution in Python.\n\nF: Tea Party\n\nYun decided to hold a tea party at the company.\n\nThe shop sells $ N $ sets of bread, each containing $ A_1, A_2, A_3, \\ dots, A_N $.\n\nYun decided to make a sandwich by combining two breads into ...
code_mechanism
{ "ground_truth": "{\"inputs\": [\"5\\n4 3 5 6 7\", \"5\\n4 3 5 10 7\", \"5\\n4 3 5 10 9\", \"5\\n4 6 5 10 9\", \"5\\n4 12 5 10 9\", \"5\\n4 12 5 0 9\", \"5\\n4 12 5 0 3\", \"5\\n1 12 5 0 3\", \"5\\n2 3 3 6 7\", \"5\\n4 3 5 10 17\", \"5\\n4 6 9 10 9\", \"5\\n6 12 5 0 9\", \"5\\n6 2 5 0 3\", \"5\\n2 12 7 0 0\", \"5\\n...
{ "index": 24269, "source": "taco", "source_row_index": 7418, "source_split": "train" }
deepcoder_while_sandbox
[ { "content": "Solve the following programming problem. Provide a complete solution in Python.\n\nOn the Planet AtCoder, there are four types of bases: A, C, G and T. A bonds with T, and C bonds with G.\nYou are given a letter b as input, which is A, C, G or T. Write a program that prints the letter representing...
code_mechanism
{ "ground_truth": "{\"inputs\": [\"A\\n\", \"G\\n\", \"C\\n\", \"T\\n\", \"C\", \"T\", \"C\", \"T\", \"G\", \"A\"], \"outputs\": [\"T\\n\", \"C\\n\", \"G\\n\", \"A\\n\", \"G\\n\", \"A\\n\", \"G\\n\", \"A\\n\", \"C\", \"T\"]}", "style": "rule" }
{ "index": 24270, "source": "taco", "source_row_index": 7419, "source_split": "train" }
deepcoder_while_sandbox
[ { "content": "Solve the following programming problem. Provide a complete solution in Python.\n\nWhen Mr. Kay was browsing a certain SNS as usual, the problem that \"there are people who can solve IQ150 or more\" came to the timeline. Mr. Kay has an IQ of over 150, so he solved the problem in an instant without...
code_mechanism
{ "ground_truth": "{\"inputs\": [\"5\", \"2\", \"68\", \"2286\", \"7\", \"1\", \"4\", \"27\", \"8\", \"3\", \"49\", \"6\", \"82\", \"75\", \"123\", \"188\", \"13\", \"12\", \"14\", \"24\", \"9\", \"10\", \"15\", \"11\", \"48\", \"18\", \"50\", \"45\", \"31\", \"194\", \"310\", \"30\", \"17\", \"16\", \"28\", \"70\", ...
{ "index": 24271, "source": "taco", "source_row_index": 7420, "source_split": "train" }
deepcoder_while_sandbox
[ { "content": "Solve the following programming problem. Provide a complete solution in Python.\n\nYou've gotten an n × m sheet of squared paper. Some of its squares are painted. Let's mark the set of all painted squares as A. Set A is connected. Your task is to find the minimum number of squares that we can dele...
code_mechanism
{ "ground_truth": "{\"inputs\": [\"3 3\\n###\\n#.#\\n###\\n\", \"2 2\\n.#\\n.#\\n\", \"2 2\\n.#\\n##\\n\", \"2 5\\n#####\\n##.##\\n\", \"2 2\\n##\\n#.\\n\", \"5 3\\n###\\n###\\n.#.\\n###\\n###\\n\", \"1 2\\n##\\n\", \"5 7\\n.#####.\\n.#...#.\\n###.###\\n#.#.#.#\\n###.###\\n\", \"5 5\\n#####\\n#####\\n#....\\n#####\\n...
{ "index": 24272, "source": "taco", "source_row_index": 7421, "source_split": "train" }
deepcoder_while_sandbox
[ { "content": "Solve the following programming problem. Provide a complete solution in Python.\n\nTakahashi has A cookies, and Aoki has B cookies.\nTakahashi will do the following action K times:\n - If Takahashi has one or more cookies, eat one of his cookies.\n - Otherwise, if Aoki has one or more cookies, eat...
code_mechanism
{ "ground_truth": "{\"inputs\": [\"2 3 3\\n\", \"500000000000 500000000000 1000000000000\\n\", \"500000000000 500000000001 1000000000000\\n\", \"500000000000 499999999999 1000000000000\\n\", \"0 0 0\\n\", \"0 0 1000000000000\\n\", \"0 1000000000000 0\\n\", \"0 1000000000000 1000000000000\\n\", \"1000000000000 0 0\\n\...
{ "index": 24273, "source": "taco", "source_row_index": 7422, "source_split": "train" }
deepcoder_while_sandbox
[ { "content": "Solve the following programming problem. Provide a complete solution in Python.\n\nWrite a program which prints $n$-th fibonacci number for a given integer $n$. The $n$-th fibonacci number is defined by the following recursive formula:\n\n\\begin{equation*} fib(n)= \\left \\\\{ \\begin{array}{ll} ...
code_mechanism
{ "ground_truth": "{\"inputs\": [\"1\", \"2\", \"4\", \"8\", \"6\", \"15\", \"7\", \"24\", \"14\", \"5\", \"13\", \"11\", \"22\", \"9\", \"29\", \"12\", \"10\", \"41\", \"16\", \"30\", \"21\", \"28\", \"17\", \"34\", \"18\", \"38\", \"31\", \"44\", \"36\", \"32\", \"33\", \"23\", \"19\", \"27\", \"20\", \"37\", \"25\...
{ "index": 24274, "source": "taco", "source_row_index": 7423, "source_split": "train" }
deepcoder_while_sandbox
[ { "content": "Solve the following programming problem. Provide a complete solution in Python.\n\n# Task\n You are given a decimal number `n` as a **string**. Transform it into an array of numbers (given as **strings** again), such that each number has only one nonzero digit and their sum equals n.\n\n Each numb...
code_mechanism
{ "ground_truth": "{\"fn_name\": \"split_exp\", \"inputs\": [[\"7970521.5544\"], [\"7496314\"], [\"0\"], [\"6\"], [\"1.0000000000\"], [\"0000000000.1\"], [\"1010101\"], [\"1234567890.1234567890\"]], \"outputs\": [[[\"7000000\", \"900000\", \"70000\", \"500\", \"20\", \"1\", \".5\", \".05\", \".004\", \".0004\"]], [[\...
{ "index": 24275, "source": "taco", "source_row_index": 7424, "source_split": "train" }
deepcoder_while_sandbox
[ { "content": "Solve the following programming problem. Provide a complete solution in Python.\n\nEverlasting Sa-Ga, a new, hot and very popular role-playing game, is out on October 19, 2008. Fans have been looking forward to a new title of Everlasting Sa-Ga.\n\nLittle Jimmy is in trouble. He is a seven-year-old...
code_mechanism
{ "ground_truth": "{\"inputs\": [\"10 3\\n30 20\\n0 0\", \"9 15\\n30 20\\n0 0\", \"10 3\\n44 33\\n0 0\", \"10 4\\n11 70\\n0 0\", \"10 3\\n8 20\\n0 0\", \"4 3\\n8 20\\n0 0\", \"4 3\\n12 20\\n0 0\", \"10 3\\n30 33\\n0 0\", \"10 3\\n8 35\\n0 0\", \"8 3\\n8 20\\n0 0\", \"4 5\\n12 20\\n0 0\", \"9 15\\n30 3\\n0 0\", \"2 3\...
{ "index": 24276, "source": "taco", "source_row_index": 7425, "source_split": "train" }
deepcoder_while_sandbox
[ { "content": "Solve the following programming problem. Provide a complete solution in Python.\n\nTanechka is shopping in the toy shop. There are exactly $n$ toys in the shop for sale, the cost of the $i$-th toy is $i$ burles. She wants to choose two toys in such a way that their total cost is $k$ burles. How ma...
code_mechanism
{ "ground_truth": "{\"inputs\": [\"8 5\\n\", \"8 15\\n\", \"7 20\\n\", \"1000000000000 1000000000001\\n\", \"1 1\\n\", \"44999999999177 100000000000000\\n\", \"100000000000000 100000000000000\\n\", \"100000000000 130000000001\\n\", \"99999999999999 65536\\n\", \"1010101010 1010101010\\n\", \"100000000000000 999999999...
{ "index": 24277, "source": "taco", "source_row_index": 7426, "source_split": "train" }
deepcoder_while_sandbox
[ { "content": "Solve the following programming problem. Provide a complete solution in Python.\n\nThere are N integers written on a blackboard. The i-th integer is A_i, and the greatest common divisor of these integers is 1.\n\nTakahashi and Aoki will play a game using these integers. In this game, starting from...
code_mechanism
{ "ground_truth": "{\"inputs\": [\"3\\n3 9 7\", \"4\\n1 2 1 9\", \"4\\n1 2 1 8\", \"5\\n7 2 8 8 8\", \"3\\n3 9 9\", \"3\\n3 1 9\", \"4\\n1 2 1 13\", \"3\\n1 1 9\", \"4\\n1 2 1 22\", \"3\\n0 1 9\", \"4\\n1 1 1 22\", \"3\\n0 1 5\", \"4\\n0 1 1 22\", \"4\\n0 0 1 22\", \"4\\n0 -1 1 22\", \"4\\n0 0 1 1\", \"4\\n0 0 1 2\",...
{ "index": 24278, "source": "taco", "source_row_index": 7427, "source_split": "train" }
deepcoder_while_sandbox
[ { "content": "Solve the following programming problem. Provide a complete solution in Python.\n\nIn this Kata, you will be given a number `n` (`n > 0`) and your task will be to return the smallest square number `N` (`N > 0`) such that `n + N` is also a perfect square. If there is no answer, return `-1` (`nil` i...
code_mechanism
{ "ground_truth": "{\"fn_name\": \"solve\", \"inputs\": [[1], [2], [3], [4], [5], [7], [8], [9], [10], [11], [13], [17], [88901], [290101]], \"outputs\": [[-1], [-1], [1], [-1], [4], [9], [1], [16], [-1], [25], [36], [64], [5428900], [429235524]]}", "style": "rule" }
{ "index": 24279, "source": "taco", "source_row_index": 7428, "source_split": "train" }
deepcoder_while_sandbox
[ { "content": "Solve the following programming problem. Provide a complete solution in Python.\n\nA game is played on a strip consisting of N cells consecutively numbered from 1 to N.\n\nAlice has her token on cell A. Borys has his token on a different cell B.\n\nPlayers take turns, Alice moves first. The moving...
code_mechanism
{ "ground_truth": "{\"inputs\": [\"9 23 42\", \"8 2 4\", \"3 1 2\", \"9 23 18\", \"3 2 2\", \"8 2 3\", \"9 23 23\", \"0 2 2\", \"7 2 3\", \"9 44 23\", \"0 2 1\", \"7 2 5\", \"9 44 0\", \"0 0 1\", \"7 1 5\", \"9 38 0\", \"0 1 1\", \"7 1 4\", \"1 38 0\", \"0 1 0\", \"8 1 4\", \"1 38 1\", \"0 2 0\", \"8 1 7\", \"1 31 0\...
{ "index": 24280, "source": "taco", "source_row_index": 7429, "source_split": "train" }
deepcoder_while_sandbox
[ { "content": "Solve the following programming problem. Provide a complete solution in Python.\n\nYou have an array a of length n. For every positive integer x you are going to perform the following operation during the x-th second:\n\n * Select some distinct indices i_{1}, i_{2}, …, i_{k} which are between 1 a...
code_mechanism
{ "ground_truth": "{\"inputs\": [\"6\\n3\\n1000000000 0 -1000000000\\n1\\n6\\n2\\n-1000000000 1000000000\\n2\\n1000000000 -1000000000\\n2\\n1000000000 1000000000\\n2\\n-1000000000 -1000000000\\n\", \"6\\n3\\n1000000000 0 -1000000000\\n1\\n6\\n2\\n-1000000000 1000000000\\n2\\n1000000000 -1000000000\\n2\\n1000000000 10...
{ "index": 24281, "source": "taco", "source_row_index": 7430, "source_split": "train" }
deepcoder_while_sandbox
[ { "content": "Solve the following programming problem. Provide a complete solution in Python.\n\nCaptain Flint and his crew keep heading to a savage shore of Byteland for several months already, drinking rum and telling stories. In such moments uncle Bogdan often remembers his nephew Denis. Today, he has told a...
code_mechanism
{ "ground_truth": "{\"inputs\": [\"2\\n1\\n3\\n\", \"1\\n2\\n\", \"1\\n2\\n\", \"2\\n87911\\n94124\\n\", \"20\\n1057\\n7092\\n1990\\n3013\\n7002\\n18597\\n2726\\n6319\\n1248\\n5690\\n3467\\n4270\\n6973\\n2935\\n100000\\n19329\\n1836\\n1100\\n2599\\n2579\\n\", \"5\\n46809\\n40813\\n42036\\n43977\\n24229\\n\", \"2\\n10...
{ "index": 24282, "source": "taco", "source_row_index": 7431, "source_split": "train" }
deepcoder_while_sandbox
[ { "content": "Solve the following programming problem. Provide a complete solution in Python.\n\nMonocarp has forgotten the password to his mobile phone. The password consists of $4$ digits from $0$ to $9$ (note that it can start with the digit $0$).\n\nMonocarp remembers that his password had exactly two diffe...
code_mechanism
{ "ground_truth": "{\"inputs\": [\"2\\n8\\n0 1 2 4 5 6 8 9\\n1\\n8\\n\", \"7\\n1\\n8\\n1\\n8\\n1\\n8\\n1\\n8\\n1\\n8\\n1\\n8\\n1\\n8\\n\", \"7\\n1\\n1\\n1\\n1\\n1\\n1\\n1\\n1\\n1\\n1\\n1\\n1\\n1\\n1\\n\", \"1\\n8\\n0 1 2 4 5 6 8 9\\n\", \"3\\n8\\n0 1 2 4 5 6 8 9\\n1\\n8\\n1\\n8\\n\", \"1\\n1\\n8\\n\", \"1\\n4\\n0 1 4...
{ "index": 24283, "source": "taco", "source_row_index": 7432, "source_split": "train" }
deepcoder_while_sandbox
[ { "content": "Solve the following programming problem. Provide a complete solution in Python.\n\nThe Hedgehog recently remembered one of his favorite childhood activities, — solving puzzles, and got into it with new vigor. He would sit day in, day out with his friend buried into thousands of tiny pieces of the ...
code_mechanism
{ "ground_truth": "{\"inputs\": [\"12 18\\nCBBCAACABACCACABBC\\nABCAACABAABCBCBCCC\\nBCAACCCBBBABBACBBA\\nACCBCBBBAABACCACCC\\nCAABCCCACACCBACACC\\nBBBCBCACCABCCBCBBB\\nBAABBCACAAAAACCBCB\\nBAABAABACBCABACBCA\\nAABCBCCBCCABACCCAC\\nCCBBBAACCCBCACCCBB\\nCBABACBBBABCBACCCB\\nAABACCCBCCACBCACCB\\n\", \"10 11\\nABBBAABAB...
{ "index": 24284, "source": "taco", "source_row_index": 7433, "source_split": "train" }
deepcoder_while_sandbox
[ { "content": "Solve the following programming problem. Provide a complete solution in Python.\n\nNastya owns too many arrays now, so she wants to delete the least important of them. However, she discovered that this array is magic! Nastya now knows that the array has the following properties:\n\n In one second...
code_mechanism
{ "ground_truth": "{\"inputs\": [\"5\\n1 1 1 1 1\\n\", \"3\\n2 0 -1\\n\", \"4\\n5 -6 -5 1\\n\", \"1\\n0\\n\", \"2\\n21794 -79194\\n\", \"3\\n-63526 95085 -5239\\n\", \"3\\n0 53372 -20572\\n\", \"13\\n-2075 -32242 27034 -37618 -96962 82203 64846 48249 -71761 28908 -21222 -61370 46899\\n\", \"5\\n806 0 1308 1954 683\\n...
{ "index": 24285, "source": "taco", "source_row_index": 7434, "source_split": "train" }
deepcoder_while_sandbox
[ { "content": "Solve the following programming problem. Provide a complete solution in Python.\n\nproblem\n\nThere are $ N $ propositions, named $ 1, 2, \\ cdots, N $, respectively. Also, $ M $ information about the propositions is given. The $ i $ th information is \"$ a_i $$\". Given in the form \"b_i $\", whi...
code_mechanism
{ "ground_truth": "{\"inputs\": [\"5 2\\n1 2\\n2 2\", \"3 2\\n1 2\\n2 1\", \"3 2\\n1 2\\n3 1\", \"6 2\\n1 2\\n2 1\", \"9 2\\n1 2\\n2 4\", \"6 2\\n1 1\\n2 1\", \"17 2\\n1 2\\n2 4\", \"4 2\\n2 2\\n3 1\", \"26 2\\n2 2\\n4 4\", \"12 2\\n2 2\\n4 4\", \"1 0\\n2 2\\n1 1\", \"17 2\\n1 2\\n2 1\", \"7 1\\n2 1\\n3 0\", \"28 2\\...
{ "index": 24286, "source": "taco", "source_row_index": 7435, "source_split": "train" }