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\nMonocarp has been collecting rare magazines for quite a while, and now he has decided to sell them. He distributed the magazines between $n$ boxes, arranged in a row. The $i$-th box contains $a_i$ magazines. Some of...
code_mechanism
{ "ground_truth": "{\"inputs\": [\"4\\n5\\n01110\\n10 5 8 9 6\\n6\\n011011\\n20 10 9 30 20 19\\n4\\n0000\\n100 100 100 100\\n4\\n0111\\n5 4 5 1\\n\", \"7\\n3\\n101\\n1 1 1\\n3\\n101\\n1 1 1\\n3\\n101\\n1 1 1\\n3\\n101\\n1 1 1\\n3\\n101\\n1 1 1\\n3\\n101\\n1 1 1\\n3\\n101\\n1 1 1\\n\", \"7\\n6\\n011011\\n20 10 9 30 20...
{ "index": 24000, "source": "taco", "source_row_index": 7149, "source_split": "train" }
deepcoder_while_sandbox
[ { "content": "Solve the following programming problem. Provide a complete solution in Python.\n\nAnalyzing the mistakes people make while typing search queries is a complex and an interesting work. As there is no guaranteed way to determine what the user originally meant by typing some query, we have to use dif...
code_mechanism
{ "ground_truth": "{\"inputs\": [\"7\\nreading\\ntrading\\n\", \"5\\nsweet\\nsheep\\n\", \"3\\ntoy\\ntry\\n\", \"5\\nspare\\nspars\\n\", \"1\\na\\nb\\n\", \"1\\nz\\ny\\n\", \"2\\nab\\nac\\n\", \"2\\nba\\nca\\n\", \"2\\nac\\ncb\\n\", \"100\\neebdeddddbecdbddaaecbbaccbecdeacedddcaddcdebedbabbceeeadecadbbeaecdaeabbceacb...
{ "index": 24001, "source": "taco", "source_row_index": 7150, "source_split": "train" }
deepcoder_while_sandbox
[ { "content": "Solve the following programming problem. Provide a complete solution in Python.\n\nYou are given integer n. You have to arrange numbers from 1 to 2n, using each of them exactly once, on the circle, so that the following condition would be satisfied:\n\nFor every n consecutive numbers on the circle...
code_mechanism
{ "ground_truth": "{\"inputs\": [\"100000\\n\", \"64\\n\", \"2\\n\", \"11\\n\", \"4097\\n\", \"6\\n\", \"1024\\n\", \"9\\n\", \"14786\\n\", \"78946\\n\", \"10\\n\", \"5\\n\", \"65\\n\", \"14785\\n\", \"63\\n\", \"4096\\n\", \"1\\n\", \"80\\n\", \"4045\\n\", \"7\\n\", \"831\\n\", \"95\\n\", \"19\\n\", \"7015\\n\", \"1...
{ "index": 24002, "source": "taco", "source_row_index": 7151, "source_split": "train" }
deepcoder_while_sandbox
[ { "content": "Solve the following programming problem. Provide a complete solution in Python.\n\nThere is a city that can be represented as a square grid with corner points in $(0, 0)$ and $(10^6, 10^6)$.\n\nThe city has $n$ vertical and $m$ horizontal streets that goes across the whole city, i. e. the $i$-th v...
code_mechanism
{ "ground_truth": "{\"inputs\": [\"2\\n2 2 4\\n0 1000000\\n0 1000000\\n1 0\\n1000000 1\\n999999 1000000\\n0 999999\\n5 4 9\\n0 1 2 6 1000000\\n0 4 8 1000000\\n4 4\\n2 5\\n2 2\\n6 3\\n1000000 1\\n3 8\\n5 8\\n8 8\\n6 8\\n\", \"1\\n2 2 2\\n0 1000000\\n0 1000000\\n1556 1000000\\n0 34\\n\", \"1\\n2 2 2\\n0 1000000\\n0 100...
{ "index": 24003, "source": "taco", "source_row_index": 7152, "source_split": "train" }
deepcoder_while_sandbox
[ { "content": "Solve the following programming problem. Provide a complete solution in Python.\n\nEverybody knows that opposites attract. That is the key principle of the \"Perfect Matching\" dating agency. The \"Perfect Matching\" matchmakers have classified each registered customer by his interests and assigne...
code_mechanism
{ "ground_truth": "{\"inputs\": [\"2\\n0 0\\n\", \"10\\n1 -1 2 -2 3 -3 4 -4 0 0\\n\", \"4\\n1 -1 1 -1\\n\", \"5\\n-3 2 1 -1 3\\n\", \"4\\n-10 10 -10 10\\n\", \"1\\n0\\n\", \"7\\n0 10 -10 10 -10 10 10\\n\", \"2\\n-1 2\\n\", \"1\\n5\\n\", \"4\\n1 -1 2 -2\\n\", \"2\\n-10 10\\n\", \"2\\n-3 3\\n\", \"2\\n1 5\\n\", \"3\\n-...
{ "index": 24004, "source": "taco", "source_row_index": 7153, "source_split": "train" }
deepcoder_while_sandbox
[ { "content": "Solve the following programming problem. Provide a complete solution in Python.\n\nThere is a blackboard on which all integers from -10^{18} through 10^{18} are written, each of them appearing once. Takahashi will repeat the following sequence of operations any number of times he likes, possibly z...
code_mechanism
{ "ground_truth": "{\"inputs\": [\"17 7 4298580\", \"123 35 678901234\", \"9 0 702443618\", \"6 1 998244353\", \"4 3 998244353\", \"17 12 4298580\", \"12 1 998244353\", \"17 1 702443618\", \"1 1 702443618\", \"8 3 776418056\", \"8 5 776418056\", \"13 5 31717648\", \"13 4 9645713\", \"13 3 9645713\", \"11 3 9645713\",...
{ "index": 24005, "source": "taco", "source_row_index": 7154, "source_split": "train" }
deepcoder_while_sandbox
[ { "content": "Solve the following programming problem. Provide a complete solution in Python.\n\nGiven are integers N and K.\nHow many quadruples of integers (a,b,c,d) satisfy both of the following conditions?\n - 1 \\leq a,b,c,d \\leq N\n - a+b-c-d=K\n\n-----Constraints-----\n - 1 \\leq N \\leq 10^5\n - -2(N-1...
code_mechanism
{ "ground_truth": "{\"inputs\": [\"2 1\\n\", \"2525 -425\\n\", \"1 0\\n\", \"42687 -70956\\n\", \"23294 13184\\n\", \"97692 12674\\n\", \"24115 24178\\n\", \"66977 75123\\n\", \"55684 -111366\\n\", \"13582 27162\\n\", \"79303 -158603\\n\", \"76435 152867\\n\", \"100000 51090\\n\", \"100000 -8286\\n\", \"100000 -87789...
{ "index": 24006, "source": "taco", "source_row_index": 7155, "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 an array of integers and your task is to return the number of arithmetic progressions of size `3` that are possible from that list. In each progression, the differences between the el...
code_mechanism
{ "ground_truth": "{\"fn_name\": \"solve\", \"inputs\": [[[1, 2, 3, 4, 5]], [[1, 2, 3, 5, 7, 9]], [[0, 5, 8, 9, 11, 13, 14, 16, 17, 19]], [[0, 1, 2, 3, 5, 6, 7, 11, 13, 15, 17, 19]], [[0, 1, 4, 5, 7, 9, 10, 13, 15, 16, 18, 19]], [[0, 1, 2, 3, 5, 8, 11, 13, 14, 16, 18, 19]]], \"outputs\": [[4], [5], [10], [17], [15], ...
{ "index": 24007, "source": "taco", "source_row_index": 7156, "source_split": "train" }
deepcoder_while_sandbox
[ { "content": "Solve the following programming problem. Provide a complete solution in Python.\n\nFind the minimum number with the given sum of digits $s$ such that all digits in it are distinct (i.e. all digits are unique).\n\nFor example, if $s=20$, then the answer is $389$. This is the minimum number in which...
code_mechanism
{ "ground_truth": "{\"inputs\": [\"4\\n20\\n8\\n45\\n10\\n\", \"45\\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\\n\", \"45\\n45\\n45\\n45\\n45\\n45...
{ "index": 24008, "source": "taco", "source_row_index": 7157, "source_split": "train" }
deepcoder_while_sandbox
[ { "content": "Solve the following programming problem. Provide a complete solution in Python.\n\nIn Summer Informatics School, if a student doesn't behave well, teachers make a hole in his badge. And today one of the teachers caught a group of $n$ students doing yet another trick. \n\nLet's assume that all thes...
code_mechanism
{ "ground_truth": "{\"inputs\": [\"3\\n2 3 2\\n\", \"3\\n1 2 3\\n\", \"3\\n2 3 1\\n\", \"1\\n1\\n\", \"2\\n2 1\\n\", \"100\\n1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 6...
{ "index": 24009, "source": "taco", "source_row_index": 7158, "source_split": "train" }
deepcoder_while_sandbox
[ { "content": "Solve the following programming problem. Provide a complete solution in Python.\n\n# Task\nAfter a long night (work, play, study) you find yourself sleeping on a bench in a park. As you wake up and try to figure out what happened you start counting trees.\n\nYou notice there are different tree siz...
code_mechanism
{ "ground_truth": "{\"fn_name\": \"find_the_missing_tree\", \"inputs\": [[[1, 2, 2, 3, 3]], [[11, 2, 3, 3, 3, 11, 2, 2]], [[234, 76, 45, 99, 99, 99, 99, 45, 234, 234, 45, 45, 76, 234, 76]], [[1, 1, 1, 1, 1, 1, 1, 22, 22, 22, 22, 22, 22, 22, 3, 3, 3, 3, 3, 3]], [[10, 205, 3000, 3000, 10]], [[50, 408, 50, 50, 50, 50, 4...
{ "index": 24010, "source": "taco", "source_row_index": 7159, "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 constraints.\n\nA session has begun at Beland State University. Many students are taking exams.\n\nPolygraph Poligrafovich is going to examine a group of $n$ stu...
code_mechanism
{ "ground_truth": "{\"inputs\": [\"7 15\\n1 2 3 4 5 6 7\\n\", \"5 100\\n80 40 40 40 60\\n\", \"1 1\\n1\\n\", \"1 100\\n99\\n\", \"1 100\\n100\\n\", \"2 100\\n100 100\\n\", \"2 100\\n1 100\\n\", \"2 100\\n1 99\\n\", \"3 100\\n34 34 34\\n\", \"10 50\\n9 9 9 9 9 9 9 9 9 9\\n\", \"10 50\\n10 10 10 10 10 10 10 10 10 10\\n...
{ "index": 24011, "source": "taco", "source_row_index": 7160, "source_split": "train" }
deepcoder_while_sandbox
[ { "content": "Solve the following programming problem. Provide a complete solution in Python.\n\nPolycarp is writing the prototype of a graphic editor. He has already made up his mind that the basic image transformations in his editor will be: rotate the image 90 degrees clockwise, flip the image horizontally (...
code_mechanism
{ "ground_truth": "{\"inputs\": [\"3 2\\n.*.\\n.*.\\n\", \"1 100\\n.\\n.\\n.\\n.\\n.\\n.\\n.\\n.\\n.\\n.\\n.\\n.\\n.\\n.\\n.\\n.\\n.\\n.\\n.\\n.\\n.\\n.\\n.\\n.\\n.\\n.\\n.\\n.\\n.\\n.\\n.\\n.\\n.\\n.\\n.\\n.\\n.\\n.\\n.\\n.\\n.\\n.\\n.\\n.\\n.\\n.\\n.\\n.\\n.\\n.\\n.\\n.\\n.\\n.\\n.\\n.\\n.\\n.\\n.\\n.\\n.\\n.\\n.\\...
{ "index": 24012, "source": "taco", "source_row_index": 7161, "source_split": "train" }
deepcoder_while_sandbox
[ { "content": "Solve the following programming problem. Provide a complete solution in Python.\n\nBeing tired of participating in too many Codeforces rounds, Gildong decided to take some rest in a park. He sat down on a bench, and soon he found two rabbits hopping around. One of the rabbits was taller than the o...
code_mechanism
{ "ground_truth": "{\"inputs\": [\"5\\n0 10 2 3\\n0 10 3 3\\n900000000 1000000000 1 9999999\\n1 2 1 1\\n1 3 1 1\\n\", \"5\\n0 10 0 3\\n0 10 3 3\\n900000000 1000000000 1 9999999\\n1 2 1 1\\n1 3 1 1\\n\", \"5\\n0 10 -1 3\\n1 10 3 3\\n900000000 1000000000 1 9999999\\n1 2 1 1\\n1 3 1 1\\n\", \"5\\n0 10 -2 3\\n1 10 3 3\\n...
{ "index": 24013, "source": "taco", "source_row_index": 7162, "source_split": "train" }
deepcoder_while_sandbox
[ { "content": "Solve the following programming problem. Provide a complete solution in Python.\n\nThere are some rabbits in Singapore Zoo. To feed them, Zookeeper bought $n$ carrots with lengths $a_1, a_2, a_3, \\ldots, a_n$. However, rabbits are very fertile and multiply very quickly. Zookeeper now has $k$ rabb...
code_mechanism
{ "ground_truth": "{\"inputs\": [\"3 6\\n5 3 1\\n\", \"1 4\\n19\\n\", \"1 3\\n1000000\\n\", \"1 1\\n1\\n\", \"10 23\\n343 984 238 758983 231 74 231 548 893 543\\n\", \"20 40\\n2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2\\n\", \"29 99047\\n206580 305496 61753 908376 272137 803885 675070 665109 995787 667887 164508 634877 ...
{ "index": 24014, "source": "taco", "source_row_index": 7163, "source_split": "train" }
deepcoder_while_sandbox
[ { "content": "Solve the following programming problem. Provide a complete solution in Python.\n\nConsider all binary strings of length $m$ ($1 \\le m \\le 60$). A binary string is a string that consists of the characters 0 and 1 only. For example, 0110 is a binary string, and 012aba is not. Obviously, there are...
code_mechanism
{ "ground_truth": "{\"inputs\": [\"5\\n3 3\\n010\\n001\\n111\\n4 3\\n000\\n111\\n100\\n011\\n1 1\\n1\\n1 1\\n0\\n3 2\\n00\\n01\\n10\\n\", \"5\\n3 3\\n010\\n001\\n110\\n4 3\\n000\\n111\\n100\\n011\\n1 1\\n1\\n1 1\\n0\\n3 2\\n00\\n01\\n10\\n\", \"5\\n3 3\\n010\\n001\\n101\\n4 3\\n000\\n111\\n100\\n011\\n1 1\\n1\\n1 1\\...
{ "index": 24015, "source": "taco", "source_row_index": 7164, "source_split": "train" }
deepcoder_while_sandbox
[ { "content": "Solve the following programming problem. Provide a complete solution in Python.\n\nIn some countries of former Soviet Union there was a belief about lucky tickets. A transport ticket of any sort was believed to posess luck if sum of digits on the left half of its number was equal to the sum of dig...
code_mechanism
{ "ground_truth": "{\"fn_name\": \"luck_check\", \"inputs\": [[\"5555\"], [\"003111\"], [\"543970707\"], [\"439924\"], [\"943294329932\"], [\"000000\"], [\"454319\"], [\"1233499943\"], [\"935336\"]], \"outputs\": [[true], [true], [false], [false], [false], [true], [true], [false], [false]]}", "style": "rule" }
{ "index": 24016, "source": "taco", "source_row_index": 7165, "source_split": "train" }
deepcoder_while_sandbox
[ { "content": "Solve the following programming problem. Provide a complete solution in Python.\n\nIn the official contest this problem has a different statement, for which jury's solution was working incorrectly, and for this reason it was excluded from the contest. This mistake have been fixed and the current g...
code_mechanism
{ "ground_truth": "{\"inputs\": [\"8\\n729541013 135019377 88372488 319157478 682081360 558614617 258129110 790518782\\n\", \"18\\n515925896 832652240 279975694 570998878 28122427 209724246 898414431 709461320 358922485 439508829 403574907 358500312 596248410 968234748 187793884 728450713 30350176 528924900\\n\", \"2...
{ "index": 24017, "source": "taco", "source_row_index": 7166, "source_split": "train" }
deepcoder_while_sandbox
[ { "content": "Solve the following programming problem. Provide a complete solution in Python.\n\nFor given $n$ segments which are parallel to X-axis or Y-axis, find the number of intersections of them.\n\nConstraints\n\n* $1 \\leq n \\leq 100,000$\n* $ -1,000,000,000 \\leq x_1, y_1, x_2, y_2 \\leq 1,000,000,000...
code_mechanism
{ "ground_truth": "{\"inputs\": [\"6\\n2 2 2 5\\n1 3 5 3\\n4 1 4 4\\n5 2 7 2\\n6 1 6 3\\n4 5 6 7\", \"6\\n2 2 2 5\\n1 3 5 3\\n4 1 4 4\\n2 2 7 2\\n6 1 6 3\\n6 5 6 7\", \"6\\n2 2 2 5\\n1 3 2 3\\n4 1 4 4\\n5 2 7 2\\n6 1 6 3\\n4 5 6 7\", \"6\\n2 2 2 5\\n1 3 10 3\\n4 1 4 4\\n2 2 7 2\\n6 1 6 3\\n6 5 6 7\", \"6\\n2 2 2 5\\n...
{ "index": 24018, "source": "taco", "source_row_index": 7167, "source_split": "train" }
deepcoder_while_sandbox
[ { "content": "Solve the following programming problem. Provide a complete solution in Python.\n\nYou are given a prime number $p$, $n$ integers $a_1, a_2, \\ldots, a_n$, and an integer $k$. \n\nFind the number of pairs of indexes $(i, j)$ ($1 \\le i < j \\le n$) for which $(a_i + a_j)(a_i^2 + a_j^2) \\equiv k \...
code_mechanism
{ "ground_truth": "{\"inputs\": [\"3 3 0\\n0 1 2\\n\", \"6 7 2\\n1 2 3 4 5 6\\n\", \"5 5 3\\n3 0 4 1 2\\n\", \"7 7 3\\n4 0 5 3 1 2 6\\n\", \"2 2 1\\n1 0\\n\", \"3 3 0\\n0 2 1\\n\", \"2 2 0\\n1 0\\n\", \"3 3 1\\n0 2 1\\n\", \"3 3 2\\n0 1 2\\n\", \"3 3 0\\n0 2 1\\n\", \"2 2 1\\n1 0\\n\", \"3 3 2\\n0 1 2\\n\", \"7 7 3\\...
{ "index": 24019, "source": "taco", "source_row_index": 7168, "source_split": "train" }
deepcoder_while_sandbox
[ { "content": "Solve the following programming problem. Provide a complete solution in Python.\n\nWe have two desks: A and B. Desk A has a vertical stack of N books on it, and Desk B similarly has M books on it.\nIt takes us A_i minutes to read the i-th book from the top on Desk A (1 \\leq i \\leq N), and B_i mi...
code_mechanism
{ "ground_truth": "{\"inputs\": [\"3 4 240\\n60 90 120\\n80 150 80 150\\n\", \"3 4 730\\n60 90 120\\n80 150 80 150\\n\", \"5 4 1\\n1000000000 1000000000 1000000000 1000000000 1000000000\\n1000000000 1000000000 1000000000 1000000000\\n\", \"5 4 1\\n1000000000 1000000000 1000000000 1000000000 1000000000\\n1000000000 10...
{ "index": 24020, "source": "taco", "source_row_index": 7169, "source_split": "train" }
deepcoder_while_sandbox
[ { "content": "Solve the following programming problem. Provide a complete solution in Python.\n\nA soldier wants to buy w bananas in the shop. He has to pay k dollars for the first banana, 2k dollars for the second one and so on (in other words, he has to pay i·k dollars for the i-th banana). \n\nHe has n dolla...
code_mechanism
{ "ground_truth": "{\"inputs\": [\"3 17 4\\n\", \"1 2 1\\n\", \"1 1 1\\n\", \"1 5 6\\n\", \"1 1000000000 1\\n\", \"1000 0 1000\\n\", \"859 453892 543\\n\", \"1000 1000000000 1000\\n\", \"1000 500500000 1000\\n\", \"1000 500500001 1000\\n\", \"1000 500499999 1000\\n\", \"634 87973 214\\n\", \"432 10000 241\\n\", \"111...
{ "index": 24021, "source": "taco", "source_row_index": 7170, "source_split": "train" }
deepcoder_while_sandbox
[ { "content": "Solve the following programming problem. Provide a complete solution in Python.\n\nVasya is a CEO of a big construction company. And as any other big boss he has a spacious, richly furnished office with two crystal chandeliers. To stay motivated Vasya needs the color of light at his office to chan...
code_mechanism
{ "ground_truth": "{\"inputs\": [\"4 2 4\\n4 2 3 1\\n2 1\\n\", \"3 8 41\\n1 3 2\\n1 6 4 3 5 7 2 8\\n\", \"1 2 31\\n1\\n1 2\\n\", \"2 2 2\\n2 1\\n1 2\\n\", \"10 10 10\\n2 7 10 4 1 5 9 8 6 3\\n9 7 6 2 4 10 1 3 5 8\\n\", \"1 2 1\\n1\\n2 1\\n\", \"20 1 100\\n1 9 19 13 7 4 12 14 20 2 8 3 5 17 6 18 15 16 11 10\\n1\\n\", \"...
{ "index": 24022, "source": "taco", "source_row_index": 7171, "source_split": "train" }
deepcoder_while_sandbox
[ { "content": "Solve the following programming problem. Provide a complete solution in Python.\n\nFox Ciel is playing a card game with her friend Jiro.\n\nJiro has n cards, each one has two attributes: position (Attack or Defense) and strength. Fox Ciel has m cards, each one has these two attributes too. It's kn...
code_mechanism
{ "ground_truth": "{\"inputs\": [\"25 28\\nATK 1267\\nDEF 1944\\nATK 1244\\nATK 1164\\nATK 1131\\nDEF 1589\\nDEF 1116\\nDEF 1903\\nATK 1162\\nATK 1058\\nDEF 1291\\nDEF 1199\\nDEF 754\\nDEF 1726\\nDEF 1621\\nATK 1210\\nDEF 939\\nDEF 919\\nDEF 978\\nDEF 1967\\nATK 1179\\nDEF 1981\\nATK 1088\\nDEF 404\\nATK 1250\\n2149\...
{ "index": 24023, "source": "taco", "source_row_index": 7172, "source_split": "train" }
deepcoder_while_sandbox
[ { "content": "Solve the following programming problem. Provide a complete solution in Python.\n\n# Task\nSome children are playing rope skipping game. Children skip the rope at roughly the same speed: `once per second`. If the child fails during the jump, he needs to tidy up the rope and continue. This will tak...
code_mechanism
{ "ground_truth": "{\"fn_name\": \"tiaosheng\", \"inputs\": [[[]], [[12, 23, 45]], [[17]], [[10, 20, 30, 40]], [[10, 20, 30, 40, 58]], [[10, 20, 30, 40, 47, 60]], [[1, 2, 3, 4, 5, 6, 7, 8, 9, 10]]], \"outputs\": [[60], [51], [57], [48], [48], [47], [30]]}", "style": "rule" }
{ "index": 24024, "source": "taco", "source_row_index": 7173, "source_split": "train" }
deepcoder_while_sandbox
[ { "content": "Solve the following programming problem. Provide a complete solution in Python.\n\nIn Russia regular bus tickets usually consist of 6 digits. The ticket is called lucky when the sum of the first three digits equals to the sum of the last three digits. Write a function to find out whether the ticke...
code_mechanism
{ "ground_truth": "{\"fn_name\": \"is_lucky\", \"inputs\": [[\"123321\"], [\"12341234\"], [\"100001\"], [\"100200\"], [\"912435\"], [\"12a12a\"], [\"999999\"], [\"1111\"], [\"000000\"], [\"\"]], \"outputs\": [[true], [false], [true], [false], [true], [false], [true], [false], [true], [false]]}", "style": "rule" }
{ "index": 24025, "source": "taco", "source_row_index": 7174, "source_split": "train" }
deepcoder_while_sandbox
[ { "content": "Solve the following programming problem. Provide a complete solution in Python.\n\nWhile dad was at work, a little girl Tanya decided to play with dad's password to his secret database. Dad's password is a string consisting of n + 2 characters. She has written all the possible n three-letter conti...
code_mechanism
{ "ground_truth": "{\"inputs\": [\"1\\nabc\\n\", \"5\\n123\\n234\\n345\\n456\\n567\\n\", \"8\\nzHW\\ncwx\\nxmo\\nWcw\\nox1\\nwxm\\nmox\\nHWc\\n\", \"2\\nbba\\nabb\\n\", \"99\\naaJ\\nJx9\\naLL\\nrCx\\nllJ\\naja\\nxxr\\nLal\\nv9C\\njrL\\nLvL\\nJLl\\nxlJ\\nLja\\nLLC\\njvL\\n9CJ\\nvrJ\\nlJJ\\nlCC\\nlxC\\njxl\\nLaJ\\nLxJ\...
{ "index": 24026, "source": "taco", "source_row_index": 7175, "source_split": "train" }
deepcoder_while_sandbox
[ { "content": "Solve the following programming problem. Provide a complete solution in Python.\n\nYou are given two strings $s$ and $t$. In a single move, you can choose any of two strings and delete the first (that is, the leftmost) character. After a move, the length of the string decreases by $1$. You can't c...
code_mechanism
{ "ground_truth": "{\"inputs\": [\"test\\nwest\\n\", \"codeforces\\nyes\\n\", \"test\\nyes\\n\", \"b\\nab\\n\", \"z\\nz\\n\", \"abacabadabacaba\\nabacabadacaba\\n\", \"z\\na\\n\", \"ama\\nsama\\n\", \"aaabc\\nbc\\n\", \"lxuyspmieeuyxluv\\ndfwxqvavzxctblaa\\n\", \"ahmedaly\\naly\\n\", \"aa\\na\\n\", \"aa\\nba\\n\", \"...
{ "index": 24027, "source": "taco", "source_row_index": 7176, "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 size of the input.\n\nYou are given a string $s$ consisting of $n$ characters, each character is 'R', 'G' or 'B'.\n\nYou are also given an integer $k$. Your ...
code_mechanism
{ "ground_truth": "{\"inputs\": [\"3\\n5 2\\nBGGGG\\n5 3\\nRBRGR\\n5 5\\nBBBRR\\n\", \"3\\n5 2\\nBGGGG\\n5 3\\nRBRGR\\n5 5\\nBBRBR\\n\", \"3\\n5 3\\nBGGGG\\n5 3\\nRBRGR\\n5 5\\nBBBRR\\n\", \"3\\n5 2\\nBGGGG\\n5 4\\nRBRGR\\n5 5\\nBBRBR\\n\", \"3\\n5 3\\nBGGGG\\n5 3\\nRBRGR\\n5 2\\nBBBRR\\n\", \"3\\n5 2\\nBGGGG\\n5 4\\...
{ "index": 24028, "source": "taco", "source_row_index": 7177, "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$ consisting of $500000$ integers (numbered from $1$ to $500000$). Initially all elements of $a$ are zero.\n\nYou have to process two types of queries to this array: $1$ $x$ $y$ — increase ...
code_mechanism
{ "ground_truth": "{\"inputs\": [\"5\\n1 3 4\\n2 3 0\\n2 4 3\\n1 4 -4\\n2 1 0\\n\", \"5\\n1 3 4\\n2 3 0\\n2 4 3\\n1 500000 1\\n2 800 0\\n\", \"2\\n1 500000 1\\n2 499999 1\\n\", \"2\\n1 1000 2\\n2 1001 1000\\n\", \"2\\n1 500000 1\\n2 500000 0\\n\", \"2\\n1 499999 1\\n2 500000 499999\\n\", \"2\\n1 3213 321\\n2 3213 0\\...
{ "index": 24029, "source": "taco", "source_row_index": 7178, "source_split": "train" }
deepcoder_while_sandbox
[ { "content": "Solve the following programming problem. Provide a complete solution in Python.\n\nA ball will bounce along a number line, making N + 1 bounces. It will make the first bounce at coordinate D_1 = 0, and the i-th bounce (2 \\leq i \\leq N+1) at coordinate D_i = D_{i-1} + L_{i-1}.\nHow many times wil...
code_mechanism
{ "ground_truth": "{\"inputs\": [\"3 6\\n3 4 5\\n\", \"4 9\\n3 3 3 3\\n\", \"90 2575\\n69 34 43 51 96 65 22 57 26 27 85 62 92 99 90 52 43 63 17 97 93 35 1 53 95 34 98 9 62 37 39 97 49 71 100 78 22 45 87 61 44 18 64 10 48 34 87 57 39 32 46 83 29 16 27 54 42 32 6 64 11 5 25 76 69 93 15 32 59 79 94 76 32 32 26 9 37 28 9...
{ "index": 24030, "source": "taco", "source_row_index": 7179, "source_split": "train" }
deepcoder_while_sandbox
[ { "content": "Solve the following programming problem. Provide a complete solution in Python.\n\nThere is a building consisting of $10~000$ apartments numbered from $1$ to $10~000$, inclusive.\n\nCall an apartment boring, if its number consists of the same digit. Examples of boring apartments are $11, 2, 777, 9...
code_mechanism
{ "ground_truth": "{\"inputs\": [\"4\\n22\\n9999\\n1\\n777\\n\", \"36\\n1\\n2\\n3\\n4\\n5\\n6\\n7\\n8\\n9\\n11\\n22\\n33\\n44\\n55\\n66\\n77\\n88\\n99\\n111\\n222\\n333\\n444\\n555\\n666\\n777\\n888\\n999\\n1111\\n2222\\n3333\\n4444\\n5555\\n6666\\n7777\\n8888\\n9999\\n\", \"36\\n9999\\n9999\\n9999\\n9999\\n9999\\n99...
{ "index": 24031, "source": "taco", "source_row_index": 7180, "source_split": "train" }
deepcoder_while_sandbox
[ { "content": "Solve the following programming problem. Provide a complete solution in Python.\n\nMahmoud wrote a message s of length n. He wants to send it as a birthday present to his friend Moaz who likes strings. He wrote it on a magical paper but he was surprised because some characters disappeared while wr...
code_mechanism
{ "ground_truth": "{\"inputs\": [\"3\\naab\\n2 3 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1\\n\", \"10\\nabcdeabcde\\n5 5 5 5 4 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1\\n\", \"10\\naaaaaaaaaa\\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\\n\", \"55\\naaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa...
{ "index": 24032, "source": "taco", "source_row_index": 7181, "source_split": "train" }
deepcoder_while_sandbox
[ { "content": "Solve the following programming problem. Provide a complete solution in Python.\n\nCreate a function that interprets code in the esoteric language **Poohbear**\n\n## The Language\n\nPoohbear is a stack-based language largely inspired by Brainfuck. It has a maximum integer value of 255, and 30,000 ...
code_mechanism
{ "ground_truth": "{\"fn_name\": \"poohbear\", \"inputs\": [[\"LQTcQAP>pQBBTAI-PA-PPL+P<BVPAL+T+P>PL+PBLPBP<DLLLT+P\"], [\"LLQT+P >LLLc+QIT-P AAAP P\"], [\"LLQT>+WN+<P>E\"], [\"cW>LQQT+P<pE\"], [\"+W>LQQT+P<-E\"], [\"+LTQII>+WN<P>+E\"], [\"+LTQIITTIWP-E\"], [\"LILcABNBpYDYYYYLLL+P-+W-EQNW-ELLQUTTTT+P\"], [\"++W-NE\"]...
{ "index": 24033, "source": "taco", "source_row_index": 7182, "source_split": "train" }
deepcoder_while_sandbox
[ { "content": "Solve the following programming problem. Provide a complete solution in Python.\n\nIf this challenge is too easy for you, check out: \nhttps://www.codewars.com/kata/5cc89c182777b00001b3e6a2\n\n___\n\nUpside-Down Pyramid Addition is the process of taking a list of numbers and consecutively adding t...
code_mechanism
{ "ground_truth": "{\"fn_name\": \"reverse\", \"inputs\": [[[5, 2, 1]], [[84, 42, 21, 10, 2]], [[83, 47, 28, 16, 7]], [[101, 57, 29, 13, 6]], [[66, 39, 25, 15, 7]], [[45, 25, 14, 8, 6]], [[60, 32, 16, 7, 4]], [[84, 44, 21, 8, 2]], [[51, 26, 13, 6, 2]], [[78, 42, 22, 11, 6]]], \"outputs\": [[[2, 1, 1]], [[4, 7, 3, 8, ...
{ "index": 24034, "source": "taco", "source_row_index": 7183, "source_split": "train" }
deepcoder_while_sandbox
[ { "content": "Solve the following programming problem. Provide a complete solution in Python.\n\nATM machines allow 4 or 6 digit PIN codes and PIN codes cannot contain anything but **exactly** 4 digits or exactly 6 digits. \n\nIf the function is passed a valid PIN string, return `true`, else return `false`.\n\n...
code_mechanism
{ "ground_truth": "{\"fn_name\": \"validate_pin\", \"inputs\": [[\"1\"], [\"12\"], [\"123\"], [\"12345\"], [\"1234567\"], [\"-1234\"], [\"-12345\"], [\"1.234\"], [\"00000000\"], [\"a234\"], [\".234\"], [\"1234\"], [\"0000\"], [\"1111\"], [\"123456\"], [\"098765\"], [\"000000\"], [\"090909\"]], \"outputs\": [[false], ...
{ "index": 24035, "source": "taco", "source_row_index": 7184, "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 an integer `n` and your task will be to return `the largest integer that is <= n and has the highest digit sum`.\n\nFor example:\n```\nsolve(100) = 99. Digit Sum for 99 = 9 + 9 = 18. ...
code_mechanism
{ "ground_truth": "{\"fn_name\": \"solve\", \"inputs\": [[79320], [99004], [99088], [99737], [29652], [100], [48], [521], [1], [2], [3], [39188], [5], [10], [1000], [10000], [999999999992], [59195], [19930], [110], [1199], [120], [18], [2090], [72694]], \"outputs\": [[78999], [98999], [98999], [98999], [28999], [99],...
{ "index": 24036, "source": "taco", "source_row_index": 7185, "source_split": "train" }
deepcoder_while_sandbox
[ { "content": "Solve the following programming problem. Provide a complete solution in Python.\n\nBertown is a city with $n$ buildings in a straight line.\n\nThe city's security service discovered that some buildings were mined. A map was compiled, which is a string of length $n$, where the $i$-th character is \...
code_mechanism
{ "ground_truth": "{\"inputs\": [\"2\\n1 1\\n01000010\\n5 1\\n01101110\\n\", \"2\\n1 1\\n01000110\\n5 1\\n01101110\\n\", \"2\\n2 1\\n01000110\\n5 1\\n01101110\\n\", \"2\\n2 1\\n01000110\\n5 1\\n01101101\\n\", \"2\\n2 1\\n11000111\\n5 1\\n01101001\\n\", \"2\\n1 1\\n01000010\\n10 1\\n01101110\\n\", \"2\\n1 1\\n01000110...
{ "index": 24037, "source": "taco", "source_row_index": 7186, "source_split": "train" }
deepcoder_while_sandbox
[ { "content": "Solve the following programming problem. Provide a complete solution in Python.\n\nThere are n beacons located at distinct positions on a number line. The i-th beacon has position a_{i} and power level b_{i}. When the i-th beacon is activated, it destroys all beacons to its left (direction of decr...
code_mechanism
{ "ground_truth": "{\"inputs\": [\"4\\n1 9\\n3 1\\n6 1\\n7 4\\n\", \"7\\n1 1\\n2 1\\n3 1\\n4 1\\n5 1\\n6 1\\n7 1\\n\", \"1\\n0 1\\n\", \"1\\n0 1000000\\n\", \"1\\n1000000 1000000\\n\", \"7\\n1 1\\n2 1\\n3 1\\n4 1\\n5 1\\n6 6\\n7 7\\n\", \"5\\n1 1\\n3 1\\n5 1\\n7 10\\n8 10\\n\", \"11\\n110 90\\n100 70\\n90 10\\n80 10\...
{ "index": 24038, "source": "taco", "source_row_index": 7187, "source_split": "train" }
deepcoder_while_sandbox
[ { "content": "Solve the following programming problem. Provide a complete solution in Python.\n\nPolycarp is playing a new computer game. This game has $n$ stones in a row. The stone on the position $i$ has integer power $a_i$. The powers of all stones are distinct.\n\nEach turn Polycarp can destroy either ston...
code_mechanism
{ "ground_truth": "{\"inputs\": [\"5\\n5\\n1 5 4 3 2\\n8\\n2 1 3 4 5 6 8 7\\n8\\n4 2 3 1 8 6 7 5\\n4\\n3 4 2 1\\n4\\n2 3 1 4\\n\", \"1\\n52\\n1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52\\n\", \"1\\n52\\n52 51 50 49 ...
{ "index": 24039, "source": "taco", "source_row_index": 7188, "source_split": "train" }
deepcoder_while_sandbox
[ { "content": "Solve the following programming problem. Provide a complete solution in Python.\n\nAnton likes to listen to fairy tales, especially when Danik, Anton's best friend, tells them. Right now Danik tells Anton a fairy tale:\n\n\"Once upon a time, there lived an emperor. He was very rich and had much gr...
code_mechanism
{ "ground_truth": "{\"inputs\": [\"5 2\\n\", \"8 1\\n\", \"32 5\\n\", \"1024 1024\\n\", \"58044 52909\\n\", \"996478063 658866858\\n\", \"570441179141911871 511467058318039545\\n\", \"1 1\\n\", \"1000000000000000000 1000000000000000000\\n\", \"1000000000000000000 999999999999997145\\n\", \"1 1000000000000000000\\n\",...
{ "index": 24040, "source": "taco", "source_row_index": 7189, "source_split": "train" }
deepcoder_while_sandbox
[ { "content": "Solve the following programming problem. Provide a complete solution in Python.\n\nThere are N people living on a number line.\nThe i-th person lives at coordinate X_i.\nYou are going to hold a meeting that all N people have to attend.\nThe meeting can be held at any integer coordinate. If you cho...
code_mechanism
{ "ground_truth": "{\"inputs\": [\"2\\n1 4\\n\", \"7\\n14 14 2 13 56 2 37\\n\", \"100\\n7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7\\n\", \"100\\n39 77 67 25 81 2...
{ "index": 24041, "source": "taco", "source_row_index": 7190, "source_split": "train" }
deepcoder_while_sandbox
[ { "content": "Solve the following programming problem. Provide a complete solution in Python.\n\nWe have sticks numbered 1, \\cdots, N. The length of Stick i (1 \\leq i \\leq N) is L_i.\nIn how many ways can we choose three of the sticks with different lengths that can form a triangle?\nThat is, find the number...
code_mechanism
{ "ground_truth": "{\"inputs\": [\"5\\n4 4 9 7 5\\n\", \"6\\n4 5 4 3 3 5\\n\", \"10\\n9 4 6 1 9 6 10 6 6 8\\n\", \"2\\n1 1\\n\", \"10\\n7 5 4 9 7 9 5 10 4 4\\n\", \"7\\n6 10 8 3 7 1 9\\n\", \"7\\n5 5 10 4 6 5 3\\n\", \"8\\n3 3 2 2 7 1 3 10\\n\", \"8\\n3 2 10 6 6 8 3 10\\n\", \"99\\n811689453 25332000 281578057 307248...
{ "index": 24042, "source": "taco", "source_row_index": 7191, "source_split": "train" }
deepcoder_while_sandbox
[ { "content": "Solve the following programming problem. Provide a complete solution in Python.\n\nYou are given four integers $n$, $c_0$, $c_1$ and $h$ and a binary string $s$ of length $n$.\n\nA binary string is a string consisting of characters $0$ and $1$.\n\nYou can change any character of the string $s$ (th...
code_mechanism
{ "ground_truth": "{\"inputs\": [\"6\\n3 1 1 1\\n100\\n5 10 100 1\\n01010\\n5 10 1 1\\n11111\\n5 1 10 1\\n11111\\n12 2 1 10\\n101110110101\\n2 100 1 10\\n00\\n\", \"7\\n10 3 1 1\\n1000000110\\n1 10 1 1000\\n0\\n1 1 10 2\\n1\\n4 4 4 1\\n1001\\n1 1 1 1\\n1\\n2 1000 500 1000\\n11\\n3 500 500 1\\n101\\n\", \"7\\n10 3 1 1...
{ "index": 24043, "source": "taco", "source_row_index": 7192, "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.\n\nLet's define the eversion operation. Let x = a_n. Then array a is partitioned into two parts: left and right. The left part contains the elements of a that are not greater th...
code_mechanism
{ "ground_truth": "{\"inputs\": [\"2\\n1\\n998244353\\n4\\n1 1 2 3\\n\", \"2\\n1\\n925217660\\n4\\n1 1 2 3\\n\", \"3\\n5\\n2 4 1 5 3\\n5\\n5 3 2 0 1\\n4\\n1 1 1 1\\n\", \"3\\n5\\n2 4 1 5 3\\n5\\n5 3 2 4 1\\n2\\n1 1 1 1\\n\", \"2\\n1\\n313193651\\n4\\n4 1 2 3\\n\", \"2\\n1\\n313193651\\n4\\n4 2 2 1\\n\", \"3\\n5\\n2 4...
{ "index": 24044, "source": "taco", "source_row_index": 7193, "source_split": "train" }
deepcoder_while_sandbox
[ { "content": "Solve the following programming problem. Provide a complete solution in Python.\n\nYou've got an array, consisting of n integers a_1, a_2, ..., a_{n}. Also, you've got m queries, the i-th query is described by two integers l_{i}, r_{i}. Numbers l_{i}, r_{i} define a subsegment of the original arra...
code_mechanism
{ "ground_truth": "{\"inputs\": [\"8 6\\n1 2 1 3 3 5 2 1\\n1 3\\n2 3\\n2 4\\n8 8\\n1 4\\n5 8\\n\", \"1 1\\n6\\n1 1\\n\", \"2 5\\n1 1\\n1 2\\n2 2\\n2 2\\n1 2\\n1 2\\n\", \"10 10\\n4 7 2 6 4 8 1 2 1 9\\n6 10\\n1 9\\n9 9\\n2 8\\n9 9\\n1 1\\n8 8\\n4 8\\n8 8\\n7 7\\n\", \"7 5\\n13 13 16 12 16 3 19\\n2 7\\n3 4\\n7 7\\n1 2\...
{ "index": 24045, "source": "taco", "source_row_index": 7194, "source_split": "train" }
deepcoder_while_sandbox
[ { "content": "Solve the following programming problem. Provide a complete solution in Python.\n\nProblem\n\nGiven the string S, which consists of lowercase letters and numbers. Follow the steps below to compress the length of string S.\n\n1. Change the order of the characters in the character string to any orde...
code_mechanism
{ "ground_truth": "{\"inputs\": [\"0ig3hd12fz99\", \"0hg3hd12fz99\", \"833453334\", \"2336078995\", \"1437005866\", \"4037065\", \"15423151\", \"8181\", \"111\", \"0hg3hd13fz99\", \"90\", \"2\", \"1496009822\", \"0hf3hd12fz99\", \"1173329527\", \"99zf21dh3fh0\", \"0hfdh312fz99\", \"1810014501\", \"0gfdh312fz99\", \"2...
{ "index": 24046, "source": "taco", "source_row_index": 7195, "source_split": "train" }
deepcoder_while_sandbox
[ { "content": "Solve the following programming problem. Provide a complete solution in Python.\n\nBased on [this kata, Connect Four.](https://www.codewars.com/kata/connect-four-1)\n\nIn this kata we play a modified game of connect four. It's connect X, and there can be multiple players.\n\nWrite the function ```...
code_mechanism
{ "ground_truth": "{\"fn_name\": \"whoIsWinner\", \"inputs\": [[[\"A_R\", \"B_Y\", \"A_R\"], 2, 2], [[\"B_R\", \"A_Y\", \"A_R\", \"D_Y\", \"B_R\", \"D_Y\", \"B_R\", \"D_Y\", \"C_R\", \"D_Y\"], 4, 4], [[\"A_R\", \"C_Y\", \"C_R\", \"B_Y\", \"A_R\", \"C_Y\", \"B_R\", \"B_Y\", \"D_R\", \"A_Y\", \"D_R\", \"A_Y\"], 2, 4], ...
{ "index": 24047, "source": "taco", "source_row_index": 7196, "source_split": "train" }
deepcoder_while_sandbox
[ { "content": "Solve the following programming problem. Provide a complete solution in Python.\n\nVasya owns three big integers — $a, l, r$. Let's define a partition of $x$ such a sequence of strings $s_1, s_2, \\dots, s_k$ that $s_1 + s_2 + \\dots + s_k = x$, where $+$ is a concatanation of strings. $s_i$ is th...
code_mechanism
{ "ground_truth": "{\"inputs\": [\"135\\n1\\n15\\n\", \"10000\\n0\\n9\\n\", \"7460991283\\n4\\n61\\n\", \"8698272232067125804692796793285996652907461532074057999849092982935510140661249431760679611642931478\\n6\\n68270\\n\", \"1254298816872758107814873768638894851215334772406487549640220733524354123084977151799244616...
{ "index": 24048, "source": "taco", "source_row_index": 7197, "source_split": "train" }
deepcoder_while_sandbox
[ { "content": "Solve the following programming problem. Provide a complete solution in Python.\n\nMemory and his friend Lexa are competing to get higher score in one popular computer game. Memory starts with score a and Lexa starts with score b. In a single turn, both Memory and Lexa get some integer in the rang...
code_mechanism
{ "ground_truth": "{\"inputs\": [\"1 2 2 1\\n\", \"1 1 1 2\\n\", \"2 12 3 1\\n\", \"4 6 2 1\\n\", \"4 6 2 2\\n\", \"6 4 2 2\\n\", \"10 1 3 3\\n\", \"5 3 1 1\\n\", \"50 22 5 5\\n\", \"6 20 1 1\\n\", \"42 42 2 3\\n\", \"42 42 3 2\\n\", \"45 54 4 5\\n\", \"6 5 4 3\\n\", \"42 42 42 42\\n\", \"1 100 42 42\\n\", \"1 100 10...
{ "index": 24049, "source": "taco", "source_row_index": 7198, "source_split": "train" }
deepcoder_while_sandbox
[ { "content": "Solve the following programming problem. Provide a complete solution in Python.\n\nChef likes strings a lot but he likes palindromic strings more. Today, Chef has two strings A and B, each consisting of lower case alphabets.\n\nChef is eager to know whether it is possible to choose some non empty ...
code_mechanism
{ "ground_truth": "{\"inputs\": [[\"3\", \"abc\", \"abc\", \"a\", \"b\", \"abba\", \"baab\"], \"3\\nabc\\nabc\\nb\\nb\\nabba\\nbaab\", \"3\\nbaa\\n`cc\\nb\\nb\\n`bab\\nbaac\", \"3\\naab\\n_dc\\na\\nb\\nba`b\\ncbaa\", \"3\\nabc\\nacc\\na\\nb\\nabba\\nbaab\", \"3\\nbaa\\ndc^\\n`\\nb\\n`b`b\\naaac\", \"3\\n_ba\\ndb`\\nb...
{ "index": 24050, "source": "taco", "source_row_index": 7199, "source_split": "train" }
deepcoder_while_sandbox
[ { "content": "Solve the following programming problem. Provide a complete solution in Python.\n\n# Task\nJohn was in math class and got bored, so he decided to fold some origami from a rectangular `a × b` sheet of paper (`a > b`). His first step is to make a square piece of paper from the initial rectangular pi...
code_mechanism
{ "ground_truth": "{\"fn_name\": \"folding\", \"inputs\": [[2, 1], [10, 7], [3, 1], [4, 1], [3, 2], [4, 2], [1000, 700], [1000, 999]], \"outputs\": [[2], [6], [3], [4], [3], [2], [6], [1000]]}", "style": "rule" }
{ "index": 24051, "source": "taco", "source_row_index": 7200, "source_split": "train" }
deepcoder_while_sandbox
[ { "content": "Solve the following programming problem. Provide a complete solution in Python.\n\nYou are given a string S consisting of a,b and c. Find the number of strings that can be possibly obtained by repeatedly performing the following operation zero or more times, modulo 998244353:\n - Choose an integer...
code_mechanism
{ "ground_truth": "{\"inputs\": [\"abc\\n\", \"abbac\\n\", \"babacabac\\n\", \"ababacbcacbacacbcbbcbbacbaccacbacbacba\\n\", \"babacaabc\", \"bbaac\", \"bac\", \"ababacbcacbacacbcbbcbbbcbaccacbacbacba\", \"cac\", \"bdabdaaab\", \"babababac\", \"abcba\", \"cbaacabab\", \"bbbac\", \"cab\", \"abcabcabcaccabcbbbcbbcbcacab...
{ "index": 24052, "source": "taco", "source_row_index": 7201, "source_split": "train" }
deepcoder_while_sandbox
[ { "content": "Solve the following programming problem. Provide a complete solution in Python.\n\nproblem\n\nGiven the sequence $ A $ of length $ N $. The $ i $ item in $ A $ is $ A_i $. You can do the following for this sequence:\n\n* $ 1 \\ leq i \\ leq N --Choose the integer i that is 1 $. Swap the value of $...
code_mechanism
{ "ground_truth": "{\"inputs\": [\"5\\n0 2 3 4 5\", \"5\\n1 2 1 4 5\", \"5\\n0 4 3 13 4\", \"5\\n0 2 3 4 8\", \"5\\n0 2 3 4 14\", \"5\\n0 1 3 4 5\", \"5\\n0 2 3 4 2\", \"5\\n0 2 3 8 2\", \"5\\n0 2 3 13 2\", \"5\\n0 2 3 13 4\", \"5\\n0 4 3 9 4\", \"5\\n0 4 3 12 4\", \"5\\n1 4 3 12 4\", \"5\\n2 4 3 12 4\", \"5\\n2 4 3 ...
{ "index": 24053, "source": "taco", "source_row_index": 7202, "source_split": "train" }
deepcoder_while_sandbox
[ { "content": "Solve the following programming problem. Provide a complete solution in Python.\n\nGiven a string of integers, return the number of odd-numbered substrings that can be formed. \n\nFor example, in the case of `\"1341\"`, they are `1, 1, 3, 13, 41, 341, 1341`, a total of `7` numbers. \n\n`solve(\"13...
code_mechanism
{ "ground_truth": "{\"fn_name\": \"solve\", \"inputs\": [[\"1341\"], [\"1357\"], [\"13471\"], [\"134721\"], [\"1347231\"], [\"13472315\"]], \"outputs\": [[7], [10], [12], [13], [20], [28]]}", "style": "rule" }
{ "index": 24054, "source": "taco", "source_row_index": 7203, "source_split": "train" }
deepcoder_while_sandbox
[ { "content": "Solve the following programming problem. Provide a complete solution in Python.\n\nAmr doesn't like Maths as he finds it really boring, so he usually sleeps in Maths lectures. But one day the teacher suspected that Amr is sleeping and asked him a question to make sure he wasn't.\n\nFirst he gave A...
code_mechanism
{ "ground_truth": "{\"inputs\": [\"1 2 1000\\n\", \"2 2 1000\\n\", \"5 3 1103\\n\", \"2 17 10000\\n\", \"3 9 10000\\n\", \"6 64 941761822\\n\", \"183 3 46847167\\n\", \"472 44 364550669\\n\", \"510 76 811693420\\n\", \"783 30 602209107\\n\", \"863 47 840397713\\n\", \"422 22 411212542\\n\", \"370 9 385481464\\n\", \"...
{ "index": 24055, "source": "taco", "source_row_index": 7204, "source_split": "train" }
deepcoder_while_sandbox
[ { "content": "Solve the following programming problem. Provide a complete solution in Python.\n\nThere is a circle with a circumference of L. Each point on the circumference has a coordinate value, which represents the arc length from a certain reference point clockwise to the point. On this circumference, ther...
code_mechanism
{ "ground_truth": "{\"inputs\": [\"3 8 3\\n0 2\\n3 2\\n6 1\", \"4 20 18\\n7 2\\n9 1\\n12 1\\n18 1\", \"2 8 3\\n0 1\\n3 2\\n6 1\", \"3 8 3\\n1 2\\n3 2\\n6 1\", \"4 20 18\\n3 2\\n9 1\\n12 1\\n18 1\", \"1 8 3\\n1 2\\n3 2\\n6 1\", \"1 8 0\\n1 2\\n3 4\\n6 1\", \"1 8 1\\n1 2\\n3 4\\n6 1\", \"2 8 3\\n1 1\\n3 2\\n6 1\", \"1 ...
{ "index": 24056, "source": "taco", "source_row_index": 7205, "source_split": "train" }
deepcoder_while_sandbox
[ { "content": "Solve the following programming problem. Provide a complete solution in Python.\n\nThere are n people taking dancing lessons. Every person is characterized by his/her dancing skill ai. At the beginning of the lesson they line up from left to right. While there is at least one couple of a boy and a...
code_mechanism
{ "ground_truth": "{\"inputs\": [\"2\\nBB\\n2518190 6313112\\n\", \"10\\nGGGGBGGGBB\\n2853026 3310290 2843753 8559868 1089557 6446421 8976433 3755381 2966918 3322276\\n\", \"1\\nB\\n490297\\n\", \"10\\nBGGBBGBGBG\\n9892816 3514007 5425956 5241945 9171176 3351177 2772494 2891569 1510552 8471969\\n\", \"3\\nBBB\\n31466...
{ "index": 24057, "source": "taco", "source_row_index": 7206, "source_split": "train" }
deepcoder_while_sandbox
[ { "content": "Solve the following programming problem. Provide a complete solution in Python.\n\nYou are given an undirected graph consisting of $n$ vertices. A number is written on each vertex; the number on vertex $i$ is $a_i$. Initially there are no edges in the graph.\n\nYou may add some edges to this graph...
code_mechanism
{ "ground_truth": "{\"inputs\": [\"3 2\\n1 3 3\\n2 3 5\\n2 1 1\\n\", \"4 0\\n1 3 3 7\\n\", \"5 4\\n1 2 3 4 5\\n1 2 8\\n1 3 10\\n1 4 7\\n1 5 15\\n\", \"10 0\\n9 9 5 2 2 5 8 5 1 7\\n\", \"10 1\\n2 2 9 7 2 3 7 7 1 1\\n5 8 4\\n\", \"10 10\\n3 4 5 10 10 9 5 4 7 8\\n1 5 5\\n10 3 18\\n1 7 20\\n7 8 20\\n10 4 8\\n10 2 17\\n9 ...
{ "index": 24058, "source": "taco", "source_row_index": 7207, "source_split": "train" }
deepcoder_while_sandbox
[ { "content": "Solve the following programming problem. Provide a complete solution in Python.\n\nNathan O. Davis has been running an electronic bulletin board system named JAG-channel. He is now having hard time to add a new feature there --- threaded view.\n\nLike many other bulletin board systems, JAG-channel...
code_mechanism
{ "ground_truth": "{\"inputs\": [\"1\\n0\\nccpi\", \"1\\n0\\nipcc\", \"1\\n0\\njpcc\", \"1\\n0\\ncbpi\", \"1\\n0\\niocc\", \"1\\n0\\ncboi\", \"1\\n0\\ncdpi\", \"1\\n0\\njpbc\", \"1\\n0\\niodc\", \"1\\n0\\ncdip\", \"1\\n0\\njpcb\", \"1\\n0\\nccip\", \"1\\n0\\njccp\", \"1\\n0\\nhocc\", \"1\\n0\\ndbpi\", \"1\\n0\\ncbpj\...
{ "index": 24059, "source": "taco", "source_row_index": 7208, "source_split": "train" }
deepcoder_while_sandbox
[ { "content": "Solve the following programming problem. Provide a complete solution in Python.\n\n# Task\n A ciphertext alphabet is obtained from the plaintext alphabet by means of rearranging some characters. For example \"bacdef...xyz\" will be a simple ciphertext alphabet where a and b are rearranged.\n\n A s...
code_mechanism
{ "ground_truth": "{\"fn_name\": \"is_substitution_cipher\", \"inputs\": [[\"aacb\", \"aabc\"], [\"aa\", \"bc\"], [\"aaxxaaz\", \"aazzaay\"], [\"aaxyaa\", \"aazzaa\"], [\"aazzaa\", \"aaxyaa\"], [\"jpeuizmi\", \"mxxcwriq\"]], \"outputs\": [[true], [false], [true], [false], [false], [false]]}", "style": "rule" }
{ "index": 24060, "source": "taco", "source_row_index": 7209, "source_split": "train" }
deepcoder_while_sandbox
[ { "content": "Solve the following programming problem. Provide a complete solution in Python.\n\nLet's call a sequence of integers $x_1, x_2, \\dots, x_k$ MEX-correct if for all $i$ ($1 \\le i \\le k$) $|x_i - \\operatorname{MEX}(x_1, x_2, \\dots, x_i)| \\le 1$ holds. Where $\\operatorname{MEX}(x_1, \\dots, x_k...
code_mechanism
{ "ground_truth": "{\"inputs\": [\"4\\n3\\n0 2 1\\n2\\n1 0\\n5\\n0 0 0 0 0\\n4\\n0 1 2 3\\n\", \"1\\n30\\n0 0 0 2 0 0 0 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2\\n\", \"1\\n30\\n0 0 0 2 0 0 0 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2\\n\", \"1\\n30\\n0 0 0 1 0 0 0 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 ...
{ "index": 24061, "source": "taco", "source_row_index": 7210, "source_split": "train" }
deepcoder_while_sandbox
[ { "content": "Solve the following programming problem. Provide a complete solution in Python.\n\nGiven the string S and m queries. The i-th query is given by the two strings xi and yi.\n\nFor each query, answer the longest substring of the string S, starting with xi and ending with yi.\n\nFor the string S, | S ...
code_mechanism
{ "ground_truth": "{\"inputs\": [\"howistheprogress\\n4\\nist prog\\ns ss\\nhow is\\nteh progress\", \"abracadabsa\\n5\\nab a\\na a\\nb c\\nac ca\\nz z\", \"icpcsummertraining\\n9\\nmm m\\nicpc summer\\ntrain ing\\nsummer mm\\ni c\\ni i\\ng f\\ntrain i\\nsummer er\", \"howistheprogress\\n4\\nist prog\\ns ss\\nohw is\...
{ "index": 24062, "source": "taco", "source_row_index": 7211, "source_split": "train" }
deepcoder_while_sandbox
[ { "content": "Solve the following programming problem. Provide a complete solution in Python.\n\nYou are given a chess board with $n$ rows and $n$ columns. Initially all cells of the board are empty, and you have to put a white or a black knight into each cell of the board.\n\nA knight is a chess piece that can...
code_mechanism
{ "ground_truth": "{\"inputs\": [\"3\\n\", \"4\\n\", \"13\\n\", \"6\\n\", \"5\\n\", \"10\\n\", \"7\\n\", \"6\\n\", \"99\\n\", \"37\\n\", \"96\\n\", \"5\\n\", \"69\\n\", \"55\\n\", \"4\\n\", \"76\\n\", \"47\\n\", \"3\\n\", \"42\\n\", \"97\\n\", \"13\\n\", \"7\\n\", \"100\\n\", \"10\\n\", \"98\\n\", \"56\\n\", \"12\\n\...
{ "index": 24063, "source": "taco", "source_row_index": 7212, "source_split": "train" }
deepcoder_while_sandbox
[ { "content": "Solve the following programming problem. Provide a complete solution in Python.\n\nProblem\n\nThere are N villages. Each village is numbered from 1 to N. Due to the recent merger boom, several villages have been merged. Two or more merged villages will become one new city, and villages that are no...
code_mechanism
{ "ground_truth": "{\"inputs\": [\"4 0\", \"10 5\\n3 4\\n1 2\\n9 6\\n3 6\\n2 9\", \"3 1\\n1 3\", \"5 3\\n1 2\\n2 3\\n3 1\", \"8 4\\n1 2\\n2 3\\n3 4\\n4 5\", \"7 0\", \"13 0\", \"26 0\", \"8 0\", \"16 0\", \"9 1\\n1 3\", \"9 0\\n1 3\", \"20 5\\n3 4\\n1 2\\n9 6\\n2 6\\n2 9\", \"14 0\", \"24 0\", \"10 0\", \"23 0\", \"1...
{ "index": 24064, "source": "taco", "source_row_index": 7213, "source_split": "train" }
deepcoder_while_sandbox
[ { "content": "Solve the following programming problem. Provide a complete solution in Python.\n\nRound any given number to the closest 0.5 step\n\nI.E.\n```\nsolution(4.2) = 4\nsolution(4.3) = 4.5\nsolution(4.6) = 4.5\nsolution(4.8) = 5\n```\n\nRound **up** if number is as close to previous and next 0.5 steps.\...
code_mechanism
{ "ground_truth": "{\"fn_name\": \"solution\", \"inputs\": [[4.2], [4.25], [4.4], [4.6], [4.75], [4.8], [4.5], [4.55], [4.74], [4.74999999999], [4.74999999991]], \"outputs\": [[4], [4.5], [4.5], [4.5], [5], [5], [4.5], [4.5], [4.5], [4.5], [4.5]]}", "style": "rule" }
{ "index": 24065, "source": "taco", "source_row_index": 7214, "source_split": "train" }
deepcoder_while_sandbox
[ { "content": "Solve the following programming problem. Provide a complete solution in Python.\n\nYou are given an integer m.\n\nLet M = 2^{m} - 1.\n\nYou are also given a set of n integers denoted as the set T. The integers will be provided in base 2 as n binary strings of length m.\n\nA set of integers S is ca...
code_mechanism
{ "ground_truth": "{\"inputs\": [\"5 3\\n11010\\n00101\\n11000\\n\", \"30 2\\n010101010101010010101010101010\\n110110110110110011011011011011\\n\", \"30 10\\n001000000011000111000010010000\\n000001100001010000000000000100\\n000110100010100000000000101000\\n110000010000000001000000000000\\n1000010000000000100101010001...
{ "index": 24066, "source": "taco", "source_row_index": 7215, "source_split": "train" }
deepcoder_while_sandbox
[ { "content": "Solve the following programming problem. Provide a complete solution in Python.\n\nThis is a simplified version of the problem B2. Perhaps you should read the problem B2 before you start solving B1.\n\nPaul and Mary have a favorite string $s$ which consists of lowercase letters of the Latin alphab...
code_mechanism
{ "ground_truth": "{\"inputs\": [\"5\\nkzaaa\\ncodeforces\\narchive\\ny\\nxxxxxx\\n\", \"1\\naa\\n\", \"61\\nkzaaa\\ncodeforces\\narchive\\ny\\nxxxxxx\\nkzaaa\\ncodeforces\\narchive\\ny\\nxxxxxx\\nkzaaa\\ncodeforces\\narchive\\ny\\nxxxxxx\\nkzaaa\\ncodeforces\\narchive\\ny\\nxxxxxx\\nkzaaa\\ncodeforces\\narchive\\ny\...
{ "index": 24067, "source": "taco", "source_row_index": 7216, "source_split": "train" }
deepcoder_while_sandbox
[ { "content": "Solve the following programming problem. Provide a complete solution in Python.\n\nYou are playing the following game with Joisino.\n - Initially, you have a blank sheet of paper.\n - Joisino announces a number. If that number is written on the sheet, erase the number from the sheet; if not, write...
code_mechanism
{ "ground_truth": "{\"inputs\": [\"3\\n6\\n2\\n6\\n\", \"4\\n2\\n5\\n5\\n2\\n\", \"6\\n12\\n22\\n16\\n22\\n18\\n12\\n\", \"3\\n6\\n2\\n7\", \"4\\n3\\n5\\n5\\n2\", \"6\\n12\\n22\\n18\\n22\\n18\\n12\", \"4\\n3\\n5\\n9\\n1\", \"6\\n4\\n47\\n28\\n35\\n18\\n12\", \"3\\n0\\n0\\n10\", \"3\\n6\\n2\\n8\", \"4\\n3\\n5\\n5\\n1\...
{ "index": 24068, "source": "taco", "source_row_index": 7217, "source_split": "train" }
deepcoder_while_sandbox
[ { "content": "Solve the following programming problem. Provide a complete solution in Python.\n\nYou will be given a string. \n\nYou need to return an array of three strings by gradually pulling apart the string.\n\nYou should repeat the following steps until the string length is 1:\n\na) remove the final chara...
code_mechanism
{ "ground_truth": "{\"fn_name\": \"pop_shift\", \"inputs\": [[\"reusetestcasesbitcointakeovertheworldmaybewhoknowsperhaps\"], [\"turnsoutrandomtestcasesareeasierthanwritingoutbasicones\"], [\"exampletesthere\"], [\"letstalkaboutjavascriptthebestlanguage\"], [\"iwanttotraveltheworldwritingcodeoneday\"], [\"letsallgoon...
{ "index": 24069, "source": "taco", "source_row_index": 7218, "source_split": "train" }
deepcoder_while_sandbox
[ { "content": "Solve the following programming problem. Provide a complete solution in Python.\n\nLet us consider sets of positive integers less than or equal to n. Note that all elements of a set are different. Also note that the order of elements doesn't matter, that is, both {3, 5, 9} and {5, 9, 3} mean the s...
code_mechanism
{ "ground_truth": "{\"inputs\": [\"9 3 23\\n9 3 22\\n10 3 28\\n16 10 107\\n20 8 102\\n20 10 105\\n20 10 155\\n3 5 3\\n4 2 11\\n0 0 0\", \"9 3 23\\n9 3 22\\n10 3 28\\n16 10 107\\n20 8 102\\n20 10 105\\n20 20 155\\n3 5 3\\n4 2 11\\n0 0 0\", \"9 3 23\\n9 3 22\\n10 3 28\\n16 10 107\\n20 8 102\\n20 8 105\\n20 20 155\\n3 5...
{ "index": 24070, "source": "taco", "source_row_index": 7219, "source_split": "train" }
deepcoder_while_sandbox
[ { "content": "Solve the following programming problem. Provide a complete solution in Python.\n\nVasya will fancy any number as long as it is an integer power of two. Petya, on the other hand, is very conservative and only likes a single integer $p$ (which may be positive, negative, or zero). To combine their t...
code_mechanism
{ "ground_truth": "{\"inputs\": [\"24 0\\n\", \"24 1\\n\", \"24 -1\\n\", \"4 -7\\n\", \"1 1\\n\", \"10 7\\n\", \"3 -179\\n\", \"12345678 -123\\n\", \"1000000000 1000\\n\", \"1 0\\n\", \"1 -1\\n\", \"536870912 0\\n\", \"536870911 0\\n\", \"1 -1000\\n\", \"100500 -179\\n\", \"1000000000 -1000\\n\", \"536870812 1\\n\", ...
{ "index": 24071, "source": "taco", "source_row_index": 7220, "source_split": "train" }
deepcoder_while_sandbox
[ { "content": "Solve the following programming problem. Provide a complete solution in Python.\n\nIvan is playing a strange game.\n\nHe has a matrix a with n rows and m columns. Each element of the matrix is equal to either 0 or 1. Rows and columns are 1-indexed. Ivan can replace any number of ones in this matri...
code_mechanism
{ "ground_truth": "{\"inputs\": [\"4 3 2\\n0 1 0\\n1 0 1\\n0 1 0\\n1 1 1\\n\", \"3 2 1\\n1 0\\n0 1\\n0 0\\n\", \"3 4 2\\n0 1 1 1\\n1 0 1 1\\n1 0 0 1\\n\", \"3 57 3\\n1 0 0 1 1 0 1 1 0 0 0 0 1 0 1 0 0 0 0 0 0 1 0 0 0 0 1 0 0 1 1 0 1 1 1 1 0 1 1 1 0 0 0 1 1 0 0 1 0 0 0 1 1 0 0 1 0\\n1 1 0 0 0 1 1 1 0 1 1 0 0 0 0 1 1 0 ...
{ "index": 24072, "source": "taco", "source_row_index": 7221, "source_split": "train" }
deepcoder_while_sandbox
[ { "content": "Solve the following programming problem. Provide a complete solution in Python.\n\nThere are N towns located in a line, conveniently numbered 1 through N. Takahashi the merchant is going on a travel from town 1 to town N, buying and selling apples.\nTakahashi will begin the travel at town 1, with ...
code_mechanism
{ "ground_truth": "{\"inputs\": [\"3 2\\n100 50 200\\n\", \"5 8\\n50 30 40 10 20\\n\", \"10 100\\n7 10 4 5 9 3 6 8 2 1\\n\", \"5 8\\n21 30 40 10 20\", \"10 100\\n7 10 4 5 9 3 6 8 1 1\", \"3 2\\n100 78 200\", \"5 8\\n21 30 40 0 20\", \"3 3\\n100 78 200\", \"5 8\\n21 30 24 0 20\", \"3 3\\n100 38 200\", \"3 5\\n100 38 2...
{ "index": 24073, "source": "taco", "source_row_index": 7222, "source_split": "train" }
deepcoder_while_sandbox
[ { "content": "Solve the following programming problem. Provide a complete solution in Python.\n\nHaruna is a high school student. She must remember the seating arrangements in her class because she is a class president. It is too difficult task to remember if there are so many students.\n\nThat is the reason wh...
code_mechanism
{ "ground_truth": "{\"inputs\": [\"2 1\\n2 2\\n0 0\", \"1 1\\n2 0\\n0 0\", \"3 1\\n3 1\\n0 0\", \"4 1\\n1 1\\n0 0\", \"3 0\\n0 0\\n0 0\", \"3 1\\n0 0\\n0 0\", \"4 1\\n2 2\\n0 0\", \"2 1\\n2 3\\n0 0\", \"1 1\\n3 0\\n0 0\", \"1 1\\n4 0\\n0 0\", \"1 2\\n4 0\\n0 0\", \"1 1\\n1 2\\n0 0\", \"2 1\\n3 2\\n0 0\", \"4 2\\n2 2\...
{ "index": 24074, "source": "taco", "source_row_index": 7223, "source_split": "train" }
deepcoder_while_sandbox
[ { "content": "Solve the following programming problem. Provide a complete solution in Python.\n\nNot long ago Billy came across such a problem, where there were given three natural numbers A, B and C from the range [1, N], and it was asked to check whether the equation AB = C is correct. Recently Billy studied ...
code_mechanism
{ "ground_truth": "{\"inputs\": [\"127\\n\", \"987572\\n\", \"600000\\n\", \"16\\n\", \"8\\n\", \"6\\n\", \"983242\\n\", \"783472\\n\", \"99999\\n\", \"729761\\n\", \"10\\n\", \"498138\\n\", \"50\\n\", \"15\\n\", \"571\\n\", \"20\\n\", \"312433\\n\", \"600\\n\", \"653451\\n\", \"202\\n\", \"828282\\n\", \"1000000\\n\...
{ "index": 24075, "source": "taco", "source_row_index": 7224, "source_split": "train" }
deepcoder_while_sandbox
[ { "content": "Solve the following programming problem. Provide a complete solution in Python.\n\nFox Ciel starts to learn programming. The first task is drawing a fox! However, that turns out to be too hard for a beginner, so she decides to draw a snake instead.\n\nA snake is a pattern on a n by m table. Denote...
code_mechanism
{ "ground_truth": "{\"inputs\": [\"3 3\\n\", \"3 4\\n\", \"5 3\\n\", \"9 9\\n\", \"3 5\\n\", \"3 6\\n\", \"7 3\\n\", \"7 4\\n\", \"11 15\\n\", \"11 3\\n\", \"19 3\\n\", \"45 3\\n\", \"45 4\\n\", \"5 4\\n\", \"5 5\\n\", \"5 6\\n\", \"7 5\\n\", \"7 6\\n\", \"7 7\\n\", \"45 45\\n\", \"11 3\\n\", \"11 15\\n\", \"7 7\\n\"...
{ "index": 24076, "source": "taco", "source_row_index": 7225, "source_split": "train" }
deepcoder_while_sandbox
[ { "content": "Solve the following programming problem. Provide a complete solution in Python.\n\nYou can perfectly predict the price of a certain stock for the next N days. You would like to profit on this knowledge, but only want to transact one share of stock per day. That is, each day you will either buy one...
code_mechanism
{ "ground_truth": "{\"inputs\": [\"9\\n10 5 4 7 9 12 6 2 10\\n\", \"20\\n3 1 4 1 5 9 2 6 5 3 5 8 9 7 9 3 2 3 8 4\\n\", \"20\\n9 29 8 9 13 4 14 27 16 11 27 14 4 29 23 17 3 9 30 19\\n\", \"100\\n411 642 560 340 276 440 515 519 182 314 35 227 390 136 97 5 502 584 567 79 543 444 413 463 455 316 545 329 437 443 9 435 291 ...
{ "index": 24077, "source": "taco", "source_row_index": 7226, "source_split": "train" }
deepcoder_while_sandbox
[ { "content": "Solve the following programming problem. Provide a complete solution in Python.\n\nA monster is attacking the Cyberland!\n\nMaster Yang, a braver, is going to beat the monster. Yang and the monster each have 3 attributes: hitpoints (HP), offensive power (ATK) and defensive power (DEF).\n\nDuring t...
code_mechanism
{ "ground_truth": "{\"inputs\": [\"1 2 1\\n1 100 1\\n1 100 100\\n\", \"100 100 100\\n1 1 1\\n1 1 1\\n\", \"50 80 92\\n41 51 56\\n75 93 12\\n\", \"76 63 14\\n89 87 35\\n20 15 56\\n\", \"12 59 66\\n43 15 16\\n12 18 66\\n\", \"51 89 97\\n18 25 63\\n22 91 74\\n\", \"72 16 49\\n5 21 84\\n48 51 88\\n\", \"74 89 5\\n32 76 9...
{ "index": 24078, "source": "taco", "source_row_index": 7227, "source_split": "train" }
deepcoder_while_sandbox
[ { "content": "Solve the following programming problem. Provide a complete solution in Python.\n\nPetya's friends made him a birthday present — a bracket sequence. Petya was quite disappointed with his gift, because he dreamed of correct bracket sequence, yet he told his friends nothing about his dreams and deci...
code_mechanism
{ "ground_truth": "{\"inputs\": [\"2\\n)(\\n\", \"3\\n(()\\n\", \"2\\n()\\n\", \"10\\n)))))(((((\\n\", \"1\\n)\\n\", \"1\\n(\\n\", \"98\\n()()(((((((())))(((()))))(())(())()()(())())))))((()()()))()(((()))()()())((())(((()(((())))()))))\\n\", \"100\\n(()()((((())()()(()()())())))((((())(((()))()()()((()))(())))((()()...
{ "index": 24079, "source": "taco", "source_row_index": 7228, "source_split": "train" }
deepcoder_while_sandbox
[ { "content": "Solve the following programming problem. Provide a complete solution in Python.\n\nWe will define the median of a sequence b of length M, as follows:\n - Let b' be the sequence obtained by sorting b in non-decreasing order. Then, the value of the (M / 2 + 1)-th element of b' is the median of b. He...
code_mechanism
{ "ground_truth": "{\"inputs\": [\"3\\n10 30 20\\n\", \"1\\n10\\n\", \"10\\n5 9 5 9 8 9 3 5 4 3\\n\", \"1\\n1\\n\", \"1\\n1000000000\\n\", \"100000\\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 ...
{ "index": 24080, "source": "taco", "source_row_index": 7229, "source_split": "train" }
deepcoder_while_sandbox
[ { "content": "Solve the following programming problem. Provide a complete solution in Python.\n\nDawid has four bags of candies. The $i$-th of them contains $a_i$ candies. Also, Dawid has two friends. He wants to give each bag to one of his two friends. Is it possible to distribute the bags in such a way that e...
code_mechanism
{ "ground_truth": "{\"inputs\": [\"1 7 11 5\\n\", \"7 3 2 5\\n\", \"3 14 36 53\\n\", \"30 74 41 63\\n\", \"92 69 83 97\\n\", \"26 52 7 19\\n\", \"72 52 62 62\\n\", \"1 1 1 1\\n\", \"70 100 10 86\\n\", \"14 10 18 24\\n\", \"20 14 37 71\\n\", \"1 1 2 1\\n\", \"2 4 1 1\\n\", \"34 11 84 39\\n\", \"76 97 99 74\\n\", \"44 ...
{ "index": 24081, "source": "taco", "source_row_index": 7230, "source_split": "train" }
deepcoder_while_sandbox
[ { "content": "Solve the following programming problem. Provide a complete solution in Python.\n\nAn array of integers $p_1, p_2, \\dots, p_n$ is called a permutation if it contains each number from $1$ to $n$ exactly once. For example, the following arrays are permutations: $[3, 1, 2]$, $[1]$, $[1, 2, 3, 4, 5]$...
code_mechanism
{ "ground_truth": "{\"inputs\": [\"3\\n-2 1\\n\", \"5\\n1 1 1 1\\n\", \"4\\n-1 2 2\\n\", \"3\\n-1 1\\n\", \"3\\n2 1\\n\", \"3\\n1 0\\n\", \"3\\n1 -1\\n\", \"3\\n-1 -2\\n\", \"3\\n-2 2\\n\", \"4\\n2 -3 -3\\n\", \"4\\n1 3 -3\\n\", \"4\\n-3 1 -2\\n\", \"4\\n0 3 0\\n\", \"4\\n-1 -1 1\\n\", \"4\\n2 1 1\\n\", \"5\\n-2 1 4 ...
{ "index": 24082, "source": "taco", "source_row_index": 7231, "source_split": "train" }
deepcoder_while_sandbox
[ { "content": "Solve the following programming problem. Provide a complete solution in Python.\n\nYou are playing some computer game. One of its levels puts you in a maze consisting of n lines, each of which contains m cells. Each cell either is free or is occupied by an obstacle. The starting cell is in the row...
code_mechanism
{ "ground_truth": "{\"inputs\": [\"4 5\\n3 2\\n1 2\\n.....\\n.***.\\n...**\\n*....\\n\", \"4 4\\n2 2\\n0 1\\n....\\n..*.\\n....\\n....\\n\", \"1 1\\n1 1\\n0 0\\n.\\n\", \"1 1\\n1 1\\n31 42\\n.\\n\", \"10 10\\n10 4\\n10 9\\n...*******\\n.*.*******\\n.*.*******\\n.*.*******\\n.*.*******\\n.*.*......\\n.*.*.*****\\n.*.....
{ "index": 24083, "source": "taco", "source_row_index": 7232, "source_split": "train" }
deepcoder_while_sandbox
[ { "content": "Solve the following programming problem. Provide a complete solution in Python.\n\nUser ainta has a permutation p_1, p_2, ..., p_{n}. As the New Year is coming, he wants to make his permutation as pretty as possible.\n\nPermutation a_1, a_2, ..., a_{n} is prettier than permutation b_1, b_2, ..., b...
code_mechanism
{ "ground_truth": "{\"inputs\": [\"7\\n5 2 4 3 6 7 1\\n0001001\\n0000000\\n0000010\\n1000001\\n0000000\\n0010000\\n1001000\\n\", \"5\\n4 2 1 5 3\\n00100\\n00011\\n10010\\n01101\\n01010\\n\", \"7\\n1 7 6 4 2 3 5\\n0000100\\n0000010\\n0000001\\n0000000\\n1000000\\n0100000\\n0010000\\n\", \"15\\n6 1 2 7 9 13 14 8 4 5 3 ...
{ "index": 24084, "source": "taco", "source_row_index": 7233, "source_split": "train" }
deepcoder_while_sandbox
[ { "content": "Solve the following programming problem. Provide a complete solution in Python.\n\nYou are given a string $s$ consisting of $n$ lowercase Latin letters. $n$ is even.\n\nFor each position $i$ ($1 \\le i \\le n$) in string $s$ you are required to change the letter on this position either to the prev...
code_mechanism
{ "ground_truth": "{\"inputs\": [\"5\\n6\\nabccba\\n2\\ncf\\n4\\nadfa\\n8\\nabaazaba\\n2\\nml\\n\", \"1\\n2\\nay\\n\", \"1\\n2\\nae\\n\", \"1\\n2\\nya\\n\", \"1\\n2\\nzb\\n\", \"1\\n4\\nzddb\\n\", \"1\\n2\\nbz\\n\", \"1\\n2\\nab\\n\", \"3\\n2\\nbz\\n2\\nyz\\n2\\nab\\n\", \"1\\n4\\nauuy\\n\", \"2\\n2\\nax\\n2\\nxa\\n\...
{ "index": 24085, "source": "taco", "source_row_index": 7234, "source_split": "train" }
deepcoder_while_sandbox
[ { "content": "Solve the following programming problem. Provide a complete solution in Python.\n\nFor the multiset of positive integers s=\\\\{s_1,s_2,...,s_k\\}, define the Greatest Common Divisor (GCD) and Least Common Multiple (LCM) of s as follow:\n\n * \\gcd(s) is the maximum positive integer x, such that ...
code_mechanism
{ "ground_truth": "{\"inputs\": [\"2\\n199999 200000\\n\", \"2\\n10007 20014\\n\", \"2\\n4 6\\n\", \"2\\n256 256\\n\", \"2\\n198761 199999\\n\", \"5\\n25 25 5 5 5\\n\", \"10\\n972 972 324 972 324 648 1944 243 324 474\\n\", \"2\\n3 3\\n\", \"3\\n166299 110866 86856\\n\", \"2\\n4773 20014\\n\", \"2\\n4 5\\n\", \"2\\n38...
{ "index": 24086, "source": "taco", "source_row_index": 7235, "source_split": "train" }
deepcoder_while_sandbox
[ { "content": "Solve the following programming problem. Provide a complete solution in Python.\n\nNatasha is going to fly to Mars. She needs to build a rocket, which consists of several stages in some order. Each of the stages is defined by a lowercase Latin letter. This way, the rocket can be described by the s...
code_mechanism
{ "ground_truth": "{\"inputs\": [\"5 3\\nxyabd\\n\", \"7 4\\nproblem\\n\", \"2 2\\nab\\n\", \"12 1\\nabaabbaaabbb\\n\", \"50 13\\nqwertyuiopasdfghjklzxcvbnmaaaaaaaaaaaaaaaaaaaaaaaa\\n\", \"50 14\\nqwertyuiopasdfghjklzxcvbnmaaaaaaaaaaaaaaaaaaaaaaaa\\n\", \"1 1\\na\\n\", \"50 1\\naaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa...
{ "index": 24087, "source": "taco", "source_row_index": 7236, "source_split": "train" }
deepcoder_while_sandbox
[ { "content": "Solve the following programming problem. Provide a complete solution in Python.\n\nWe have a tree with N vertices and N-1 edges, respectively numbered 1, 2,\\cdots, N and 1, 2, \\cdots, N-1. Edge i connects Vertex u_i and v_i.\nFor integers L, R (1 \\leq L \\leq R \\leq N), let us define a functio...
code_mechanism
{ "ground_truth": "{\"inputs\": [\"3\\n1 3\\n2 3\\n\", \"2\\n1 2\\n\", \"10\\n5 3\\n5 7\\n8 9\\n1 9\\n9 10\\n8 4\\n7 4\\n6 10\\n7 2\\n\", \"2\\n0 2\", \"10\\n5 3\\n5 7\\n8 9\\n0 9\\n9 10\\n8 4\\n7 4\\n6 10\\n7 2\", \"3\\n1 3\\n0 3\", \"10\\n5 3\\n5 7\\n8 9\\n0 9\\n12 10\\n8 4\\n7 4\\n6 10\\n7 2\", \"2\\n-1 1\", \"10\...
{ "index": 24088, "source": "taco", "source_row_index": 7237, "source_split": "train" }
deepcoder_while_sandbox
[ { "content": "Solve the following programming problem. Provide a complete solution in Python.\n\nYou've probably heard about the twelve labors of Heracles, but do you have any idea about the thirteenth? It is commonly assumed it took him a dozen years to complete the twelve feats, so on average, a year to accom...
code_mechanism
{ "ground_truth": "{\"inputs\": [\"4\\n4\\n3 5 4 6\\n2 1\\n3 1\\n4 3\\n2\\n21 32\\n2 1\\n6\\n20 13 17 13 13 11\\n2 1\\n3 1\\n4 1\\n5 1\\n6 1\\n4\\n10 6 6 6\\n1 2\\n2 3\\n4 1\\n\", \"4\\n4\\n3 5 4 6\\n2 1\\n3 1\\n4 3\\n2\\n21 32\\n2 1\\n6\\n13 13 17 13 13 11\\n2 1\\n3 1\\n4 1\\n5 1\\n6 1\\n4\\n10 6 6 6\\n1 2\\n2 3\\n4...
{ "index": 24089, "source": "taco", "source_row_index": 7238, "source_split": "train" }
deepcoder_while_sandbox
[ { "content": "Solve the following programming problem. Provide a complete solution in Python.\n\nTakahashi has N sticks that are distinguishable from each other. The length of the i-th stick is L_i.\nHe is going to form a triangle using three of these sticks. Let a, b, and c be the lengths of the three sticks u...
code_mechanism
{ "ground_truth": "{\"inputs\": [\"4\\n3 4 2 1\\n\", \"3\\n1 1000 1\\n\", \"7\\n218 786 704 233 645 728 389\\n\", \"16\\n1 13 987 144 34 21 610 233 55 2 89 3 377 1 8 5\\n\", \"2000\\n1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 ...
{ "index": 24090, "source": "taco", "source_row_index": 7239, "source_split": "train" }
deepcoder_while_sandbox
[ { "content": "Solve the following programming problem. Provide a complete solution in Python.\n\nA country decides to build a palace.\nIn this country, the average temperature of a point at an elevation of x meters is T-x \\times 0.006 degrees Celsius.\nThere are N places proposed for the place. The elevation o...
code_mechanism
{ "ground_truth": "{\"inputs\": [\"2\\n12 5\\n1000 2000\\n\", \"3\\n21 -11\\n81234 94124 52141\\n\", \"1000\\n50 12\\n354 76430 27904 50268 73833 44032 2233 54986 38658 75014 43668 35059 40714 88040 8556 52029 40199 9127 9433 16246 11706 88894 29318 55597 10624 87407 59163 67750 74895 37791 16260 82696 57569 51320 42...
{ "index": 24091, "source": "taco", "source_row_index": 7240, "source_split": "train" }
deepcoder_while_sandbox
[ { "content": "Solve the following programming problem. Provide a complete solution in Python.\n\nOne day n friends met at a party, they hadn't seen each other for a long time and so they decided to make a group photo together. \n\nSimply speaking, the process of taking photos can be described as follows. On the...
code_mechanism
{ "ground_truth": "{\"inputs\": [\"3\\n1 10\\n5 5\\n10 1\\n\", \"3\\n2 1\\n1 2\\n2 1\\n\", \"2\\n1 5\\n2 3\\n\", \"2\\n2 3\\n1 1\\n\", \"3\\n1 10\\n2 10\\n3 10\\n\", \"3\\n2 10\\n1 9\\n3 7\\n\", \"3\\n1 1\\n3 2\\n2 3\\n\", \"3\\n3 123\\n1 456\\n2 789\\n\", \"3\\n2 987\\n3 654\\n1 321\\n\", \"3\\n3 143\\n2 543\\n1 893...
{ "index": 24092, "source": "taco", "source_row_index": 7241, "source_split": "train" }
deepcoder_while_sandbox
[ { "content": "Solve the following programming problem. Provide a complete solution in Python.\n\nKattapa, as you all know was one of the greatest warriors of his time. The kingdom of Maahishmati had never lost a battle under him (as army-chief), and the reason for that was their really powerful army, also calle...
code_mechanism
{ "ground_truth": "{\"inputs\": [\"1\\n1\\n\", \"1\\n2\", \"4\\n11 12 13 14\", \"3\\n2 3 4\", \"5\\n1 2 3 4 5\\n\", \"5\\n1 2 3 0 5\", \"5\\n1 2 3 0 2\", \"5\\n1 2 4 0 2\", \"5\\n1 4 4 0 2\", \"5\\n1 4 4 1 2\", \"5\\n1 4 4 2 2\", \"5\\n1 6 4 2 2\", \"5\\n1 8 4 2 2\", \"5\\n1 8 3 2 2\", \"5\\n1 8 3 2 1\", \"5\\n2 8 3 ...
{ "index": 24093, "source": "taco", "source_row_index": 7242, "source_split": "train" }
deepcoder_while_sandbox
[ { "content": "Solve the following programming problem. Provide a complete solution in Python.\n\nYou have r red, g green and b blue balloons. To decorate a single table for the banquet you need exactly three balloons. Three balloons attached to some table shouldn't have the same color. What maximum number t of ...
code_mechanism
{ "ground_truth": "{\"inputs\": [\"5 4 3\\n\", \"1 1 1\\n\", \"2 3 3\\n\", \"0 1 0\\n\", \"0 3 3\\n\", \"4 0 4\\n\", \"1000000000 1000000000 1000000000\\n\", \"100 99 56\\n\", \"1000 1000 1002\\n\", \"0 1 1000000000\\n\", \"500000000 1000000000 500000000\\n\", \"1000000000 2000000000 1000000000\\n\", \"2000000000 200...
{ "index": 24094, "source": "taco", "source_row_index": 7243, "source_split": "train" }
deepcoder_while_sandbox
[ { "content": "Solve the following programming problem. Provide a complete solution in Python.\n\nThere is a board with a grid consisting of n rows and m columns, the rows are numbered from 1 from top to bottom and the columns are numbered from 1 from left to right. In this grid we will denote the cell that lies...
code_mechanism
{ "ground_truth": "{\"inputs\": [\"2 2 3\\n\", \"2 20 37\\n\", \"500 500 250000\\n\", \"500 500 249995\\n\", \"1 1 1\\n\", \"2 1 1\\n\", \"32 71 297\\n\", \"20 20 8\\n\", \"6 14 23\\n\", \"2 78 117\\n\", \"500 500 9997\\n\", \"500 500 6913\\n\", \"2 1 2\\n\", \"3 3 5\\n\", \"5 1 3\\n\", \"5 10 25\\n\", \"74 99 5057\\...
{ "index": 24095, "source": "taco", "source_row_index": 7244, "source_split": "train" }
deepcoder_while_sandbox
[ { "content": "Solve the following programming problem. Provide a complete solution in Python.\n\nYou are given two strings A and B representing essays of two students who are suspected cheaters. For any two strings C, D we define their similarity score S(C,D) as 4⋅ LCS(C,D) - |C| - |D|, where LCS(C,D) denotes t...
code_mechanism
{ "ground_truth": "{\"inputs\": [\"11 18\\naaaagaaxaxa\\naiaiiaaaaiaaiaaaaa\\n\", \"12 17\\nqqqqqqgqqgqq\\nqqqgqqqggqqqlqqqq\\n\", \"6 9\\nvvvkvv\\nvgkkvvvgg\\n\", \"153 205\\nssasssszzessssseazzssssassaskasassesssseszzazzaassassslsasasszszeaeeaaszassaszseaaasasezaezeaskzkakzksasssssgsszszzsasazssssasezzseesssssszzez...
{ "index": 24096, "source": "taco", "source_row_index": 7245, "source_split": "train" }
deepcoder_while_sandbox
[ { "content": "Solve the following programming problem. Provide a complete solution in Python.\n\nIn a long narrow forest stretching east-west, there are N beasts. Below, we will call the point that is p meters from the west end Point p. The i-th beast from the west (1 ≤ i ≤ N) is at Point x_i, and can be sold f...
code_mechanism
{ "ground_truth": "{\"inputs\": [\"4\\n1 100\\n3 200\\n999999999999999 44\\n1000000000000000 150\", \"5\\n10 20\\n40 50\\n60 35\\n70 40\\n90 10\", \"4\\n1 101\\n3 200\\n999999999999999 61\\n1000000000000000 150\", \"5\\n19 28\\n40 50\\n60 35\\n70 40\\n90 10\", \"4\\n1 101\\n5 200\\n789952814361385 49\\n10000000000000...
{ "index": 24097, "source": "taco", "source_row_index": 7246, "source_split": "train" }
deepcoder_while_sandbox
[ { "content": "Solve the following programming problem. Provide a complete solution in Python.\n\nNeko is playing with his toys on the backyard of Aki's house. Aki decided to play a prank on him, by secretly putting catnip into Neko's toys. Unfortunately, he went overboard and put an entire bag of catnip into th...
code_mechanism
{ "ground_truth": "{\"inputs\": [\"1\\n\", \"2\\n\", \"3\\n\", \"4\\n\", \"5\\n\", \"6\\n\", \"7\\n\", \"8\\n\", \"9\\n\", \"10\\n\", \"11\\n\", \"12\\n\", \"13\\n\", \"14\\n\", \"15\\n\", \"450\\n\", \"999\\n\", \"1000\\n\", \"16\\n\", \"17\\n\", \"18\\n\", \"19\\n\", \"20\\n\", \"21\\n\", \"22\\n\", \"23\\n\", \"24...
{ "index": 24098, "source": "taco", "source_row_index": 7247, "source_split": "train" }
deepcoder_while_sandbox
[ { "content": "Solve the following programming problem. Provide a complete solution in Python.\n\nYou need count how many valleys you will pass.\n\nStart is always from zero level.\n\nEvery time you go down below 0 level counts as an entry of a valley, and as you go up to 0 level from valley counts as an exit of...
code_mechanism
{ "ground_truth": "{\"fn_name\": \"counting_valleys\", \"inputs\": [[\"UFFFD\"], [\"DFFFD\"], [\"UFFFU\"], [\"DFFFU\"], [\"UFFDDFDUDFUFU\"], [\"UFFDDFDUDFUFUUFFDDFDUDFUFU\"], [\"UFFDDFDUDFUFUUFFDDUFFDDUFFDDUDUDUDUDUDUUUUUUUUU\"], [\"UFFDDFDUDFUFUUFFDDFDUDFUFUUFFDDFDUDFUFUUFFDDFDUDFUFU\"], [\"UFFDDFDUDFUFUUFFDDFDUDFUF...
{ "index": 24099, "source": "taco", "source_row_index": 7248, "source_split": "train" }