messages
listlengths
1
1
ground_truth
stringlengths
88
726k
dataset
stringclasses
2 values
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nThis is the harder version of th...
[{"type": "stdin_stdout", "input": "5\n3 1 4 1 2\n15\n5 5\n5 4\n5 3\n5 2\n5 1\n4 4\n4 3\n4 2\n4 1\n3 3\n3 2\n3 1\n2 2\n2 1\n1 1\n", "output": "2\n1\n4\n1\n3\n2\n4\n1\n3\n2\n4\n3\n4\n3\n4\n"}, {"type": "stdin_stdout", "input": "5\n3 1 4 1 2\n15\n5 5\n5 4\n5 3\n5 2\n5 1\n4 4\n4 3\n4 2\n4 1\n3 3\n3 2\n3 1\n2 2\n2 1\n1 1\n...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nIn this Kata, you will sort elem...
[{"input": "[1, 2, 3, 0, 5, 0, 1, 6, 8, 8, 6, 9, 1]", "output": "[[1, 1, 1, 0, 0, 6, 6, 8, 8, 2, 3, 5, 9]]", "fn_name": "solve"}, {"input": "[5, 9, 6, 9, 6, 5, 9, 9, 4, 4]", "output": "[[9, 9, 9, 9, 4, 4, 5, 5, 6, 6]]", "fn_name": "solve"}, {"input": "[4, 4, 2, 5, 1, 1, 3, 3, 2, 8]", "output": "[[1, 1, 2, 2, 3, 3, 4, 4...
code_functional
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nThe Bitlandians are quite weird ...
[{"type": "stdin_stdout", "input": "1000000000000000000000000000000000000011111111000000000000\n0111111111100000000000111111111000000000000000111111110001\n", "output": "YES\n"}, {"type": "stdin_stdout", "input": "1000000000000000000000000000000000000011111111000000000000\n0111111111100000000000111111111000000000000000...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nThere is a sequence of length N:...
[{"type": "stdin_stdout", "input": "7635 1737\n1 4336 5028 2246 3376 4632 3484 5018 6851 5712 6421 1045 4582 6443 5762 2211 5622 2385 1213 6493 6742 4499 7581 6655 2974 2212 2861 4283 5757 1316 4008 2602 5971 4098 5433 1398 4622 7224 93 4338 1998 1188 853 2588 2210 7123 3903 1360 1308 3213 3437 2333 6285 2126 3228 2323...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nThe customer telephone support c...
[{"type": "stdin_stdout", "input": "3 300\n100 46 150\n100 50 150\n101 50 148\n3 300\n110 50 150\n100 50 150\n200 50 150\n9 18\n5 1 1\n3 1 1\n3 1 1\n4 100 1\n5 100 1\n5 100 1\n10 5 5\n10 5 5\n2 7 1000\n10 18\n1 2 6\n2 3 1\n3 4 5\n4 5 6\n5 6 7\n6 7 8\n7 8 9\n12 9 10\n9 10 11\n18 11 12\n0 0", "output": "2\n3\n5\n10\n"}, ...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nGiven a sorted array of numbers,...
[{"input": "[-2, 0, 1, 2, 3, 4, 5, 6, 7, 9, 10, 12]", "output": "[[\"-2\", \"0->7\", \"9->10\", \"12\"]]", "fn_name": "summary_ranges"}, {"input": "[0, 1, 2, 3, 4, 5, 6, 7, 9, 10]", "output": "[[\"0->7\", \"9->10\"]]", "fn_name": "summary_ranges"}, {"input": "[0, 1, 2, 5, 6, 9]", "output": "[[\"0->2\", \"5->6\", \"9\"]...
code_functional
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nA new dog show on TV is starting...
[{"type": "stdin_stdout", "input": "100 154\n132 88 72 98 184 47 176 56 68 168 137 88 188 140 198 18 162 139 94 133 90 91 37 156 196 28 186 1 51 47 4 92 18 51 37 121 86 195 153 195 183 191 15 24 104 174 94 83 102 61 131 40 149 46 22 112 13 136 133 177 3 175 160 152 172 48 44 174 77 100 155 157 167 174 64 109 118 194 12...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nYou are given two integers $n$ a...
[{"type": "stdin_stdout", "input": "5\n1 100\n2 -1\n5 5\n2 1000000000\n1000100000 1000000000\n", "output": "0\n-1\n10\n1000000000\n2000000000\n"}, {"type": "stdin_stdout", "input": "5\n1 100\n2 2\n5 5\n2 1000000000\n1000000000 1000000000\n", "output": "0\n2\n10\n1000000000\n2000000000\n"}, {"type": "stdin_stdout", "inp...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nThe preferred way to generate us...
[{"type": "stdin_stdout", "input": "asdfghjkli ware\n", "output": "asdfghjkliw\n"}, {"type": "stdin_stdout", "input": "asdfghjkli ware\n", "output": "asdfghjkliw\n"}, {"type": "stdin_stdout", "input": "asdfghkkli ware\n", "output": "asdfghkkliw\n"}, {"type": "stdin_stdout", "input": "ilkkhgfdsa ware\n", "output": "ilkk...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\n# Feynman's squares\nRichard Phi...
[{"input": "15", "output": "[1240]", "fn_name": "count_squares"}, {"input": "8", "output": "[204]", "fn_name": "count_squares"}, {"input": "3", "output": "[14]", "fn_name": "count_squares"}, {"input": "5", "output": "[55]", "fn_name": "count_squares"}, {"input": "1", "output": "[1]", "fn_name": "count_squares"}, {"inpu...
code_functional
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nThere are N cells arranged in a ...
[{"type": "stdin_stdout", "input": "200000 10\n195313 197047\n198503 199144\n199910 200000\n193793 195312\n186922 193792\n199860 199909\n199145 199570\n197048 198502\n1 186921\n199571 199859\n", "output": "946746535\n"}, {"type": "stdin_stdout", "input": "199993 10\n23896 23905\n92651 92660\n184931 184940\n101332 10134...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nYou are given two integer sequen...
[{"type": "stdin_stdout", "input": "1989 1986\n84234 80908 59749 63761 63761 49034 63761 64697 84234 84234 64697 64697 49034 80908 80908 63761 66200 59749 59749 80908 84234 63761 80908 80908 66200 92283 84234 63761 80908 63761 92283 59749 49034 78052 53613 49034 92283 80908 53613 59749 49034 49034 59749 80908 66200 809...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nAn integer N is a multiple of 9 ...
[{"type": "stdin_stdout", "input": "33813819154164361588118768953262516554574111032083043031384286303065210509562262038973079975476396016546146039303789823110933080134565927492314604458575884820133400398416950126075966048913496870281342656762187821939147033106717650124502612019109078419691362651717290499399798948652832...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nGenos recently installed the gam...
[{"type": "stdin_stdout", "input": "50\n22 19 14 22 20 11 16 28 23 15 3 23 6 16 30 15 15 10 24 28 19 19 22 30 28 1 27 12 12 14 17 30 17 26 21 26 27 1 11 23 9 30 18 19 17 29 11 20 29 24\n", "output": "25\n"}, {"type": "stdin_stdout", "input": "50\n22 19 14 22 20 11 16 28 23 15 3 23 6 16 30 15 15 10 24 28 19 19 22 30 28 ...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nThe spring is coming and it mean...
[{"type": "stdin_stdout", "input": "24 24\n25 69 103 18 40 8 78 14 14 10 27 61 75 140 10 69 80 71 102 8 91 14 15 10\nswtcofrcpeys{ydwkrg\nszyd\ndyzsyep\nrcpeyszydwkrgfj\nfgrkwdyzsyfp\ndwyz\nsmzginydyrtua\nj\nk\ntzwsw\ngfj\nmsplnqossy\ninydyrtuatzw\ninxdy\nlpsmzginydyrtuatzwswtcofrcpeyszy\nyssoqnlpsm\npeyszyd\nysosqnlps...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nBessie the cow and her best frie...
[{"type": "stdin_stdout", "input": "AB\nXC\nXB\nAC\n", "output": "YES\n"}, {"type": "stdin_stdout", "input": "AB\nXC\nAX\nCB\n", "output": "YES\n"}, {"type": "stdin_stdout", "input": "CB\nAX\nXA\nBC\n", "output": "YES\n"}, {"type": "stdin_stdout", "input": "CB\nAX\nCX\nAB\n", "output": "YES\n"}, {"type": "stdin_stdout"...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nThink of New York as a rectangul...
[{"type": "stdin_stdout", "input": "100 100\n10\n53 20\n97 6\n12 74\n48 92\n97 13\n47 96\n123 32\n69 21\n95 75\n1 54\n10\n36 97\n41 1\n1 87\n39 23\n27 44\n73 97\n1 1\n6 26\n48 3\n5 69\n", "output": "108\n4\n"}, {"type": "stdin_stdout", "input": "100 100\n10\n53 20\n97 6\n12 74\n48 92\n97 13\n47 96\n123 32\n69 21\n95 75...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nIn this Kata, you will be given ...
[{"input": "10000000000", "output": "[10000000019]", "fn_name": "solve"}, {"input": "3500000", "output": "[3499999]", "fn_name": "solve"}, {"input": "350000", "output": "[350003]", "fn_name": "solve"}, {"input": "35000", "output": "[34981]", "fn_name": "solve"}, {"input": "1110", "output": "[1109]", "fn_name": "solve"}...
code_functional
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nOn some square in the lowest row...
[{"type": "stdin_stdout", "input": "100 3 4\n644\n861\n478\n250\n560\n998\n141\n162\n386\n778\n123\n811\n602\n533\n391\n515\n898\n215\n965\n556\n446\n883\n256\n195\n573\n889\n515\n240\n179\n339\n258\n593\n930\n730\n735\n949\n522\n067\n549\n366\n452\n405\n473\n188\n488\n994\n000\n046\n930\n217\n897\n580\n509\n032\n343\n...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nThere are N rabbits, numbered 1 ...
[{"type": "stdin_stdout", "input": "5\n5 5 5 -1 2", "output": "1\n"}, {"type": "stdin_stdout", "input": "5\n5 5 5 -2 2", "output": "1\n"}, {"type": "stdin_stdout", "input": "5\n3 5 5 -1 1", "output": "0\n"}, {"type": "stdin_stdout", "input": "5\n5 5 5 -1 1", "output": "1\n"}, {"type": "stdin_stdout", "input": "5\n3 3 5...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nVova's family is building the Gr...
[{"type": "stdin_stdout", "input": "20\n10 5 2 3 5 7 7 9 4 9 9 4 9 7 7 5 3 2 5 10\n", "output": "NO\n"}, {"type": "stdin_stdout", "input": "20\n10 5 2 3 5 7 7 9 4 9 9 4 9 7 7 5 3 2 5 10\n", "output": "NO\n"}, {"type": "stdin_stdout", "input": "20\n10 1 2 3 5 7 7 9 4 9 9 4 9 7 7 5 3 2 5 10\n", "output": "NO\n"}, {"type"...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nA string is called diverse if it...
[{"type": "stdin_stdout", "input": "69\nabc\nabc\nabc\nabc\nabc\nabc\nabc\nabc\nabc\nabc\nabc\nabc\nabc\nabc\nabc\nabc\nabc\nabc\nabc\nabc\nabc\nabc\nabc\nabc\nabc\nabc\nabc\nabc\nabc\nabc\nabc\nabc\nabc\nabc\nabc\nabc\nabc\nabc\nabc\nabc\nabc\nabc\nabc\nabc\nabc\nabc\nabc\nabc\nabc\nabc\nabc\nabc\nabc\nabc\nabc\nabc\n...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nThere are n railway stations in ...
[{"type": "stdin_stdout", "input": "10\n9 4\n5 7\n2 1\n3 4\n2 10\n6 3\n2 5\n1 3\n4 8\n8\n6 8 3\n10 5 3\n2 10 3\n3 5 2\n8 4 3\n1 9 3\n9 5 2\n3 10 2\n", "output": "3 1 2 3 3 3 3 3 3 \n"}, {"type": "stdin_stdout", "input": "10\n3 6\n3 2\n4 1\n1 10\n3 8\n5 2\n6 7\n2 1\n6 9\n7\n9 10 3\n5 7 1\n9 10 3\n7 4 1\n3 10 4\n3 6 4\n5...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nTranform of input array of zeros...
[{"input": "[1, 0, 1, 1, 0, 0, 0, 1, 1, 1, 1, 0, 1]", "output": "[[1, 2, 4, 1]]", "fn_name": "ones_counter"}, {"input": "[1, 1, 1, 0, 0, 1, 0, 1, 1, 0]", "output": "[[3, 1, 2]]", "fn_name": "ones_counter"}, {"input": "[0, 0, 0, 1, 0, 0, 1, 1]", "output": "[[1, 2]]", "fn_name": "ones_counter"}, {"input": "[0, 0, 0, 0, 0...
code_functional
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nFind the edit distance between g...
[{"type": "stdin_stdout", "input": "icpc\nipcc", "output": "2\n"}, {"type": "stdin_stdout", "input": "icpb\ncbio", "output": "4\n"}, {"type": "stdin_stdout", "input": "cpci\nipcc", "output": "2\n"}, {"type": "stdin_stdout", "input": "cpci\nccpi", "output": "2\n"}, {"type": "stdin_stdout", "input": "icpc\nccpi", "output...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\n# Task\n Given a rectangular `ma...
[{"input": "[[1, 1, 1, 1], [2, 2, 2, 2], [3, 3, 3, 3]]\n1\n3", "output": "[12]", "fn_name": "crossing_sum"}, {"input": "[[1, 1], [3, 3], [1, 1], [2, 2]]\n3\n0", "output": "[9]", "fn_name": "crossing_sum"}, {"input": "[[1], [2], [3], [4], [5]]\n0\n0", "output": "[15]", "fn_name": "crossing_sum"}, {"input": "[[1, 2, 3, 4...
code_functional
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nProblem\n\nThere are $ 2 $ teams...
[{"type": "stdin_stdout", "input": "1000000000000000000 1000000000010000000", "output": "4\n"}, {"type": "stdin_stdout", "input": "1000000001000000000 1000000000010000000", "output": "2\n"}, {"type": "stdin_stdout", "input": "1000001001000000000 1000000000010000000", "output": "2\n"}, {"type": "stdin_stdout", "input": ...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nSimply find the closest value to...
[{"input": "[28, -36, 49, 39, -33, 22, -5, 23, -24, 47, -47, -30, -20, -18, 40, -21, -45, 10, -48, -26, -12, -21, 48, 16, 26, 21, -9, 33, 8, -49]", "output": "[-5]", "fn_name": "closest"}, {"input": "[20, 26, 13, -47, -35, 39, 24, 46, -16, 5, 46, -30, -33, -38, -47, 23, 10, -39, -36, 41, 5, -24, 28, -30, 40, -24, -28, ...
code_functional
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nIt is the hard version of the pr...
[{"type": "stdin_stdout", "input": "7\n1 2\n1 1\n3 2\n1 1 2 2 4 6\n3 3\n3 4 4 1 1 1 1 1 5\n2 2\n2 1 2 1\n4 2\n50 50 50 50 3 50 56 50\n4 2\n6 6 6 10 2 2 9 6\n2 9\n1 3 2 3 3 6 1 1 3 2 3 1 1 6 3 1 1 3\n", "output": "0\n1\n2\n0\n0\n0\n12\n"}, {"type": "stdin_stdout", "input": "7\n1 2\n1 1\n3 2\n1 1 2 4 4 6\n3 3\n3 4 4 1 1 ...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nAn IPv6-address is a 128-bit num...
[{"type": "stdin_stdout", "input": "20\n0:0:9e39:9:b21:c9b:c:0\n0:0:0:0:0:a27:6b:cb0a\n2:7:4d:b:0:3:2:f401\n17:2dc6::0:89e3:0:dc:0\nca:4:0:0:d6:b999:e:0\n4af:553:b29:dd7:2:5b:0:7\n0:c981:8f:a4d:0:d4:0:f61\n0:0:1:0:dc33:0:1964:0\n84:da:0:6d6:0ecc:1:f:0\n4:fb:4d37:0:8c:4:4a52:24\nc:e:a:0:0:0:e:0\n0:3761:72ed:b7:3b0:ff7:f...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nVasya often uses public transpor...
[{"type": "stdin_stdout", "input": "680 871 347 800\n10 100\n872 156 571 136 703 201 832 213 15 333\n465 435 870 173 660 237 694 594 423 405 27 866 325 490 255 989 128 345 278 125 708 210 771 848 961 448 871 190 745 343 532 174 103 999 874 221 252 500 886 129 185 208 137 425 758 34 696 15 198 981 91 50 545 885 194 583 ...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nWrite a function that takes a nu...
[{"input": "76853", "output": "[120]", "fn_name": "perms"}, {"input": "1397", "output": "[24]", "fn_name": "perms"}, {"input": "\"abc\"", "output": "[6]", "fn_name": "perms"}, {"input": "66666", "output": "[1]", "fn_name": "perms"}, {"input": "\"ab\"", "output": "[2]", "fn_name": "perms"}, {"input": "342", "output": "[...
code_functional
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nTwo players, Red and Blue, are a...
[{"type": "stdin_stdout", "input": "21 2\n1 2\n2 3\n2 4\n4 5\n10 6\n6 7\n13 8\n8 9\n1 10\n3 11\n11 12\n12 13\n3 15\n14 15\n20 16\n14 17\n14 18\n14 19\n14 20\n17 21\n", "output": "-70\n"}, {"type": "stdin_stdout", "input": "21 1\n1 2\n2 3\n2 4\n4 5\n10 6\n6 7\n14 8\n8 9\n9 10\n3 11\n11 12\n12 13\n5 14\n14 15\n14 16\n14 ...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nA card pyramid of height $1$ is ...
[{"type": "stdin_stdout", "input": "50\n11833308\n5211498\n64660\n9077929\n2699416\n2432035\n234901\n1337830\n8457191\n10523566\n5722429\n5452712\n5511654\n8587879\n348160\n3141182\n2661936\n395300\n6950223\n2119926\n4407089\n3559060\n10228325\n5752720\n1607500\n647047\n8904557\n1954681\n698061\n9852830\n1972893\n13760...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nWilliam arrived at a conference ...
[{"type": "stdin_stdout", "input": "10 8\n1 2\n2 3\n3 4\n1 4\n6 7\n8 9\n8 10\n1 4\n", "output": "1\n2\n3\n4\n5\n5\n6\n8\n"}, {"type": "stdin_stdout", "input": "7 6\n1 2\n3 4\n2 4\n7 6\n6 5\n1 7\n", "output": "1\n1\n3\n3\n3\n6\n"}, {"type": "stdin_stdout", "input": "4 3\n2 1\n4 1\n1 2\n", "output": "1\n2\n3\n"}, {"type"...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nWe have N integers A_1, A_2, ......
[{"type": "stdin_stdout", "input": "30 413\n-170202098 -268409015 537203564 983211703 11883920 -443999067 -286607651 -159124657 -358352725 526800997 -1907718835 648738515 -1273635706 -1268616353 37909651 -1 1196187672 -20098238 0 -948955241 1 -214720580 287839163 -18897162 694477644 0 -425610555 158912296 842295515 0",...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nAfter a long journey, the super-...
[{"type": "stdin_stdout", "input": "4 7\n4\nJIOJOIJ\nIJIOJOO\nJOIJOOI\nOOJJIJO\n5 7 0 7\n2 2 3 0\n2 3 2 2\n1 1 0 7", "output": "-1 -2 -1\n-1 0 -1\n0 0 0\n0 0 0\n"}, {"type": "stdin_stdout", "input": "4 7\n4\nJIOJOIJ\nIJIOJOO\nJOIJOOI\nOOJJIJO\n5 2 0 7\n2 2 2 0\n2 3 2 2\n1 1 0 7", "output": "-8 -10 -6\n0 0 -1\n0 0 0\n0 ...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nJoisino is working as a receptio...
[{"type": "stdin_stdout", "input": "2\n151 -2\n0 4", "output": "-147\n"}, {"type": "stdin_stdout", "input": "2\n276 -2\n0 4", "output": "-272\n"}, {"type": "stdin_stdout", "input": "2\n276 -1\n0 4", "output": "-271\n"}, {"type": "stdin_stdout", "input": "2\n276 -1\n0 7", "output": "-268\n"}, {"type": "stdin_stdout", "i...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\n`late_clock` function receive an...
[{"input": "[9, 1, 2, 5]", "output": "[\"21:59\"]", "fn_name": "late_clock"}, {"input": "[1, 9, 8, 3]", "output": "[\"19:38\"]", "fn_name": "late_clock"}, {"input": "[0, 2, 2, 2]", "output": "[\"22:20\"]", "fn_name": "late_clock"}, {"input": "[3, 5, 0, 2]", "output": "[\"23:50\"]", "fn_name": "late_clock"}, {"input": "...
code_functional
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nThere is a beautiful garden of s...
[{"type": "stdin_stdout", "input": "50\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 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000\n1000 1000 1000 1000 1000 1000...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nThere are N stones arranged in a...
[{"type": "stdin_stdout", "input": "7\n1\n2\n10\n2\n1\n6\n2", "output": "5\n"}, {"type": "stdin_stdout", "input": "7\n1\n2\n1\n2\n3\n3\n2", "output": "6\n"}, {"type": "stdin_stdout", "input": "7\n1\n3\n1\n2\n1\n3\n2", "output": "7\n"}, {"type": "stdin_stdout", "input": "7\n1\n3\n1\n2\n4\n3\n2", "output": "5\n"}, {"type...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nEugeny has array a = a_1, a_2, ....
[{"type": "stdin_stdout", "input": "10 10\n-1 1 -1 1 -1 -1 -1 -1 -1 -1\n6 10\n4 5\n3 6\n2 3\n3 5\n4 5\n3 4\n1 7\n1 1\n1 1\n", "output": "0\n1\n1\n1\n0\n1\n1\n0\n0\n0\n"}, {"type": "stdin_stdout", "input": "10 10\n-1 1 -1 1 -1 -1 -1 -1 -1 -1\n6 13\n4 5\n3 6\n2 3\n0 5\n4 5\n3 4\n1 4\n1 1\n1 1\n", "output": "0\n1\n1\n1\n0...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nRead problems statements in Russ...
[{"type": "stdin_stdout", "input": "4\n20 -1 -2 -4", "output": "4\n"}, {"type": "stdin_stdout", "input": "4\n0 -2 6 10", "output": "2\n"}, {"type": "stdin_stdout", "input": "4\n1 -2 6 10", "output": "2\n"}, {"type": "stdin_stdout", "input": "4\n2 -2 6 10", "output": "2\n"}, {"type": "stdin_stdout", "input": "4\n4 -2 6 ...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\n>When no more interesting kata c...
[{"input": "\"())()))))()()(\"", "output": "[4]", "fn_name": "find_longest"}, {"input": "\"())(((\"", "output": "[2]", "fn_name": "find_longest"}, {"input": "\")()(\"", "output": "[2]", "fn_name": "find_longest"}, {"input": "\"((()\"", "output": "[2]", "fn_name": "find_longest"}, {"input": "\"(((\"", "output": "[0]", "...
code_functional
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nYour friend recently gave you so...
[{"type": "stdin_stdout", "input": "128982\n", "output": "17 16 15 14 13 11 10 9 8 7 5 3 2\n"}, {"type": "stdin_stdout", "input": "97205\n", "output": "17 15 14 13 12 10 9 8 6 5 3 1 \n"}, {"type": "stdin_stdout", "input": "97205\n", "output": "17 15 14 13 12 10 9 8 6 5 3 1\n"}, {"type": "stdin_stdout", "input": "32698\...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nThe average miner Vaganych took ...
[{"type": "stdin_stdout", "input": "50\n515844718 503470143 928669067 209884122 322869098 241621928 844696197 105586164 552680307 968792756 135928721 842094825 298782438 829020472 791637138 285482545 811025527 428952878 887796419 11883658 546401594 6272027 100292274 308219869 372132044 955814846 644008184 521195760 919...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nYou are given $n$ strings $s_1, ...
[{"type": "stdin_stdout", "input": "4\n2\ncaa\ncbb\n3\ncba\ncba\ncbb\n4\nccab\ncbac\nbca\nacbcc\n4\nacb\ncaf\nc\ncbafc\n", "output": "YES\nNO\nYES\nNO\n"}, {"type": "stdin_stdout", "input": "4\n2\ncaa\ncbb\n3\ncba\ncba\ncbb\n4\nccab\ncbac\nbca\nacbcc\n4\nacb\ncaf\nc\ncbafc\n", "output": "YES\nNO\nYES\nNO\n"}, {"type": ...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nNaman has two binary strings $s$...
[{"type": "stdin_stdout", "input": "12\n011001010101\n111001010101\n", "output": "-1\n"}, {"type": "stdin_stdout", "input": "12\n011101010101\n101001010101\n", "output": "-1\n"}, {"type": "stdin_stdout", "input": "12\n011001010101\n111001010101\n", "output": "-1"}, {"type": "stdin_stdout", "input": "12\n011101010101\n1...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nLeha is planning his journey fro...
[{"type": "stdin_stdout", "input": "100\n3 3 3 4 7 8 8 8 9 9 10 12 12 13 14 14 15 15 16 17 17 20 21 21 22 22 23 25 29 31 36 37 37 38 39 40 41 41 41 42 43 44 45 46 46 47 47 49 49 49 51 52 52 53 54 55 59 59 59 60 62 63 63 64 66 69 70 71 71 72 74 76 76 77 77 78 78 79 80 81 81 82 82 84 85 86 87 87 87 89 91 92 92 92 92 97 9...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nTwo friends are on the coordinat...
[{"type": "stdin_stdout", "input": "864\n179\n", "output": "117649\n"}, {"type": "stdin_stdout", "input": "967\n102\n", "output": "187489\n"}, {"type": "stdin_stdout", "input": "967\n142\n", "output": "170569\n"}, {"type": "stdin_stdout", "input": "967\n282\n", "output": "117649\n"}, {"type": "stdin_stdout", "input": "...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nGiven are integer sequence of le...
[{"type": "stdin_stdout", "input": "192 275\n426 445 272 81 447 129 497 202 275 325 482 284 417 156 432 402 228 37 357 239 418 211 179 6 340 68 368 16 440 263 93 449 491 310 355 68 431 80 257 218 434 328 176 355 221 80 422 45 11 67 467 174 191 4 335 34 465 480 221 395 1 152 325 231 302 153 396 22 489 399 107 466 432 2 ...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nThe problem statement looms belo...
[{"type": "stdin_stdout", "input": "3 3\nXX.\n...\n.XX\n10\n1 3\n1 3\n1 2\n1 2\n3 3\n1 3\n2 3\n3 3\n2 3\n2 2\n", "output": "YES\nYES\nYES\nYES\nYES\nYES\nYES\nYES\nYES\nYES\n"}, {"type": "stdin_stdout", "input": "3 3\n..X\nX.X\n..X\n10\n2 3\n2 2\n3 3\n1 3\n1 1\n3 3\n3 3\n1 1\n1 2\n1 1\n", "output": "YES\nYES\nYES\nYES\...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nThere are $n$ beautiful skyscrap...
[{"type": "stdin_stdout", "input": "8\n7 2 5 5 1 2 5 2\n", "output": "4\n"}, {"type": "stdin_stdout", "input": "8\n7 2 5 5 1 2 2 2\n", "output": "5\n"}, {"type": "stdin_stdout", "input": "8\n7 2 5 5 2 2 5 2\n", "output": "4\n"}, {"type": "stdin_stdout", "input": "8\n4 3 5 5 1 2 5 2\n", "output": "4\n"}, {"type": "stdin...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nOnce a Mathematician was trapped...
[{"type": "stdin_stdout", "input": "934\n48171068\n63138680\n25597136\n5610719\n22559303\n19374620\n52609147\n76485130\n4119341\n84687324\n74124384\n29214349\n76525070\n27296334\n62086857\n7062292\n70121510\n32711240\n40766945\n75911566\n64205975\n68575226\n83591193\n54443307\n63540837\n4289505\n8767969\n70478582\n7243...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nMishka is a little polar bear. A...
[{"type": "stdin_stdout", "input": "100\n4 3\n3 4\n5 1\n2 5\n5 3\n1 5\n6 3\n2 4\n5 2\n2 6\n5 2\n1 5\n6 3\n1 5\n6 3\n3 4\n5 2\n1 5\n6 1\n1 5\n4 2\n3 5\n6 3\n2 6\n6 3\n1 4\n6 2\n3 4\n4 1\n3 6\n5 1\n2 4\n5 1\n3 4\n6 2\n3 5\n4 1\n2 6\n4 3\n2 6\n5 2\n3 6\n6 2\n3 5\n4 3\n1 5\n5 3\n3 6\n4 2\n3 4\n6 1\n3 4\n5 2\n2 6\n5 2\n2 4\...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nKuro has just learned about perm...
[{"type": "stdin_stdout", "input": "69\n1034 414 632 614 62 855 915 385 1098 8 462 1750 1227 960 450 25 1307 578 37 262 482 1143 844 696 1004 1008 70 1137 509 1217 561 557 192 513 792 794 1335 1201 1290 543 698 55 119 536 1088 162 1074 676 246 457 662 595 1054 1252 778 165 703 1222 326 158 145 272 729 381 1087 1261 717...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nThe Kingdom of Kremland is a tre...
[{"type": "stdin_stdout", "input": "44\n42 44 4 24 29 17 32 30 30 9 28 9 22 16 20 41 17 19 41 23 28 19 38 44 1 34 41 34 19 36 32 37 22 31 4 3 27 23 21 21 26 39 20 8\n", "output": "6926\n"}, {"type": "stdin_stdout", "input": "44\n42 44 4 24 29 17 32 30 30 9 28 9 22 16 20 41 17 19 41 23 28 19 38 44 1 34 41 34 19 36 32 37...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nIn 40XX, the Earth was invaded b...
[{"type": "stdin_stdout", "input": "110 5\n111 101 5 5\n110 110 2 3\n-112 -100 5 11\n-208 160 109 90\n-110 159 10 3\n26 11\n15 -1 5 2\n25 0 5 1\n35 0 5 1\n118 0 5 1\n55 0 5 1\n65 0 5 1\n149 -1 5 1\n169 0 1 1\n90 0 5 1\n-19 -1 5 20\n-30 0 500 5\n0 0", "output": "1\n4\n"}, {"type": "stdin_stdout", "input": "100 5\n111 10...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nWrite a function to split a stri...
[{"input": "\"I love arrays they are my favorite\"", "output": "[[\"I\", \"love\", \"arrays\", \"they\", \"are\", \"my\", \"favorite\"]]", "fn_name": "string_to_array"}, {"input": "\"Robin Singh\"", "output": "[[\"Robin\", \"Singh\"]]", "fn_name": "string_to_array"}, {"input": "\"CodeWars\"", "output": "[[\"CodeWars\"]...
code_functional
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nPolycarp is sad — New Year is co...
[{"type": "stdin_stdout", "input": "11\n1000000000 500000000 500000000\n1000000000 500000000 499999999\n1000000000 499999999 499999999\n500000000 1000000000 500000000\n500000000 1000000000 499999999\n499999999 1000000000 499999999\n500000000 500000000 1000000000\n500000000 499999999 1000000000\n499999999 499999999 1000...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nThere are n points on a straight...
[{"type": "stdin_stdout", "input": "10\n711183437 845779129 -106125616 -481773790 66231250 -183390793 -711197523 -196001897 -440633306 -873649505\n", "output": "156311685\n"}, {"type": "stdin_stdout", "input": "10\n711183437 845779129 -106125616 -481773790 66231250 -183390793 -711197523 -196001897 -440633306 -873649505...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nYour task is to return the numbe...
[{"input": "19\n20", "output": "[208]", "fn_name": "totalAmountVisible"}, {"input": "15\n20", "output": "[204]", "fn_name": "totalAmountVisible"}, {"input": "6\n20", "output": "[195]", "fn_name": "totalAmountVisible"}, {"input": "8\n20", "output": "[197]", "fn_name": "totalAmountVisible"}, {"input": "12\n12", "output":...
code_functional
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nThere are n Imperial stormtroope...
[{"type": "stdin_stdout", "input": "10 -4 -4\n2 -4\n2 0\n-4 2\n5 -4\n-3 -5\n1 4\n-4 2\n-3 5\n0 -3\n2 4\n", "output": "8\n"}, {"type": "stdin_stdout", "input": "10 -4 -4\n2 -4\n2 0\n-4 2\n5 -4\n-3 -5\n1 4\n-4 2\n-3 5\n0 -3\n2 4\n", "output": "8\n"}, {"type": "stdin_stdout", "input": "10 -4 -4\n1 -4\n2 0\n-4 2\n5 -4\n-3 ...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nHanh lives in a shared apartment...
[{"type": "stdin_stdout", "input": "10\n10 10\n8 9 2 10 3 8 10 9 1 10\n10 10\n3 10 3 13 12 14 3 3 4 4\n10 5\n7 13 10 14 5 12 5 5 7 11\n10 10\n12 13 3 6 12 9 6 6 5 7\n10 10\n4 10 15 13 13 15 9 8 8 14\n10 10\n2 3 8 5 9 7 11 12 7 9\n10 10\n12 15 11 10 1 8 10 3 4 2\n10 5\n8 11 7 14 7 9 5 2 8 9\n10 10\n4 9 9 9 10 4 1 12 13 ...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nFor a dictionary $M$ that stores...
[{"type": "stdin_stdout", "input": "7\n0 blue 4\n0 red -1\n0 white 9\n1 red\n1 blue\n0 black 11\n1 black", "output": "-1\n4\n11\n"}, {"type": "stdin_stdout", "input": "7\n0 blue 15\n0 red 1\n0 whiue 5\n1 red\n1 blue\n0 black 11\n1 black", "output": "1\n15\n11\n"}, {"type": "stdin_stdout", "input": "7\n0 blue 4\n0 red -...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nIt's a beautiful April day and W...
[{"type": "stdin_stdout", "input": "285642 492030 560100 388288 354938 20867\n", "output": "216690.214383517276\n"}, {"type": "stdin_stdout", "input": "111724 287004 931554 512877 139642 23002\n", "output": "257255.653204436792"}, {"type": "stdin_stdout", "input": "246310 320553 585881 278070 443362 23788\n", "output":...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nWhile Farmer John rebuilds his f...
[{"type": "stdin_stdout", "input": "13 78\n10 2\n6 5\n5 7\n10 3\n6 13\n4 7\n4 13\n1 12\n13 2\n1 7\n10 5\n10 13\n12 2\n10 6\n5 3\n10 8\n9 11\n6 1\n4 5\n12 3\n6 7\n8 2\n1 9\n4 11\n5 8\n6 3\n9 5\n5 2\n13 11\n10 4\n12 7\n5 13\n12 8\n10 12\n6 12\n5 11\n1 8\n7 8\n12 4\n10 7\n1 5\n1 2\n10 11\n2 11\n12 13\n9 7\n8 3\n12 9\n9 2\...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nIt is September 9 in Japan now.\...
[{"type": "stdin_stdout", "input": "29\n", "output": "Yes\n"}, {"type": "stdin_stdout", "input": "91\n", "output": "Yes\n"}, {"type": "stdin_stdout", "input": "929", "output": "Yes\n"}, {"type": "stdin_stdout", "input": "109", "output": "Yes\n"}, {"type": "stdin_stdout", "input": "189", "output": "Yes\n"}, {"type": "st...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nHarry Potter has a difficult hom...
[{"type": "stdin_stdout", "input": "10 20\n0 -7 2 -3 3 5 10 4 -8 7 1 -2 8 9 8 9 -4 -5 8 4\n-4 -1 0 0 8 6 4 8 10 0 5 5 9 5 10 1 8 1 1 9\n-8 9 7 2 9 7 5 -1 8 9 -7 9 4 2 2 -4 8 8 0 9\n7 9 10 6 -1 10 -4 6 3 1 9 4 7 -1 10 4 10 -6 -7 7\n-9 7 -2 10 2 1 1 4 5 6 6 10 7 11 9 1 8 9 5 -6\n5 5 10 6 9 3 0 5 1 2 8 3 3 9 5 7 8 -4 4 10...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nYou are given two binary strings...
[{"type": "stdin_stdout", "input": "91\n0010010000110001001011011011111001000110001000100111110010010001100110010111100111011111100\n1101110110000100110000100011010110111101100000011011100111111000110000001101101111100100101\n", "output": "43\n"}, {"type": "stdin_stdout", "input": "91\n001001000011000100101101101111100...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nYou are given two positive integ...
[{"type": "stdin_stdout", "input": "6\n2 7\n4 12\n2 1000000000\n7 97\n1000000000 1000000000\n2 1\n", "output": "\n13\n\n15\n\n1999999999\n\n113\n\n1000000001\n\n1\n"}, {"type": "stdin_stdout", "input": "6\n2 7\n4 12\n4 1000000000\n7 97\n1000000000 1000000000\n2 1\n", "output": "\n13\n\n15\n\n1333333333\n\n113\n\n100000...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nSantosh has a farm at Byteland. ...
[{"type": "stdin_stdout", "input": "2\n15 28\n13 1", "output": "420\n13\n"}, {"type": "stdin_stdout", "input": "2\n11 28\n13 1", "output": "308\n13\n"}, {"type": "stdin_stdout", "input": "2\n11 28\n12 1", "output": "308\n12\n"}, {"type": "stdin_stdout", "input": "2\n11 51\n12 1", "output": "561\n12\n"}, {"type": "stdin...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nAlperen has two strings, $s$ and...
[{"type": "stdin_stdout", "input": "3\n5\n2 1 aa\n1 2 a\n2 3 a\n1 2 b\n2 3 abca\n2\n1 5 mihai\n2 2 buiucani\n3\n1 5 b\n2 3 a\n2 4 paiu\n", "output": "YES\nNO\nYES\nNO\nYES\nNO\nYES\nNO\nNO\nYES\n"}, {"type": "stdin_stdout", "input": "1\n8\n2 7 z\n1 2 xpt\n2 5 aosu\n2 3 veel\n1 3 dnx\n1 8 tgly\n2 5 rqlmvchcir\n1 10 qklu...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nYou are given two arrays A and B...
[{"type": "stdin_stdout", "input": "20 30\n19 29\n2 1 2 2 3 3 4 4 7 7 7 9 8 8 8 8 1 0 9 10\n6 9 9 7 9 9 9 9 5 9 9 9 9 18 9 9 10 10 10 10 10 10 10 10 10 10 10 10 10 10\n", "output": "NO\n"}, {"type": "stdin_stdout", "input": "20 30\n19 29\n2 1 2 2 2 3 4 4 7 10 7 8 8 8 8 8 9 9 9 9\n6 9 9 9 9 9 9 9 9 9 9 9 9 18 9 9 10 10 ...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nThe determinant of a matrix 2 × ...
[{"type": "stdin_stdout", "input": "1000000000 -1000000000\n1000000000 1000000000\n", "output": "1000000000.0000000000\n"}, {"type": "stdin_stdout", "input": "1000000000 1000000000\n1000000000 -1000000000\n", "output": "1000000000.0000000000\n"}, {"type": "stdin_stdout", "input": "1000000000 -1000000000\n1000000000 100...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nOne common way of digitalizing s...
[{"type": "stdin_stdout", "input": "50 20\n592183311 362557946 154127088 616872926 395353745 675069471 509655682 79915471 356656666 937992998 304422065 724106263 472338455 792258113 796069631 1325917135 201799298 566151622 722278085 827802227 703159587 690854023 925377265 11010958 69791159 990158269 535460930 167415727...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nThere are N squares aligned in a...
[{"type": "stdin_stdout", "input": "10 5\n5 -4 -5 -16 -4 0 2 -4 -1 3", "output": "10\n"}, {"type": "stdin_stdout", "input": "10 5\n6 -4 -5 -16 -4 0 2 -4 -1 3", "output": "11\n"}, {"type": "stdin_stdout", "input": "10 5\n6 -4 -5 -16 -4 0 2 -4 -2 3", "output": "11\n"}, {"type": "stdin_stdout", "input": "10 5\n5 -4 -5 -8 ...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nLong ago, when Petya was a schoo...
[{"type": "stdin_stdout", "input": "bgphoaomnjcjhgkgbflfclbjmkbfonpbmkdomjmkahaoclcbijdjlllnpfkbilgiiidbabgojbbfmliemhicaanadbaahagmfdldbbklelkihlcbkhchlikhefeeafbhkabfdlhnnjnlimbhneafcfeapcbeifgcnaijdnkjpikedmdbhahhgcijddfmamdiaapaeimdhfblpkedamifbbdndmmljmdcffcpmanndeeclnpnkdoieiahchdnkdmfnbocnimclgckdcbp\npcbeifgcna...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nExample\n\nInput\n\n4\n5\n8\n58\...
[{"type": "stdin_stdout", "input": "4\n5\n10\n108\n152", "output": "9263.000000000000000\n"}, {"type": "stdin_stdout", "input": "4\n5\n20\n55\n152", "output": "5887.500000000000000\n"}, {"type": "stdin_stdout", "input": "4\n2\n11\n55\n152", "output": "5082.000000000000000\n"}, {"type": "stdin_stdout", "input": "4\n5\n1...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nI decided to move and decided to...
[{"type": "stdin_stdout", "input": "6 3\n2 1\n0 2\n5 8\n1 3\n1 5\n-2 2\n1 1 1 59 30 16\n3 -4\n-3 0\n2 -2\n45 11\n90 6\n135 1\n2 1\n1 3\n5 2\n0 1 1 124 30 22\n-3 0\n1 -2\n37 2\n0 0", "output": "1 2 3 4 5\nNA\n"}, {"type": "stdin_stdout", "input": "6 3\n2 1\n1 2\n5 3\n1 2\n1 5\n-2 3\n1 1 1 90 30 45\n3 -4\n-3 0\n2 -2\n45 ...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nOne common way of digitalizing s...
[{"type": "stdin_stdout", "input": "50 20\n592183311 362557946 154127088 616872926 395353745 675069471 509655682 79915471 356656666 937992998 304422065 724106263 472338455 792258113 796069631 663370025 201799298 566151622 722278085 508905399 703159587 690854023 925377265 11010958 69791159 990158269 535460930 167415727 ...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nLimak is an old brown bear. He o...
[{"type": "stdin_stdout", "input": "50\n840868705 387420489 387420489 795385082 634350497 206851546 536870912 536870912 414927754 306894916 387420489 536870912 387420489 149011306 373106005 536870912 700746206 387420489 777952883 847215247 176645254 576664386 387420489 230876513 536870912 536870912 536870912 387420489 ...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nLet's call a string adorable if ...
[{"type": "stdin_stdout", "input": "aaaaaaabbbbbbcder\n", "output": "No\n"}, {"type": "stdin_stdout", "input": "aaaaaaaabbbbbcder\n", "output": "No\n"}, {"type": "stdin_stdout", "input": "abaaaaaabbbbbcder\n", "output": "No\n"}, {"type": "stdin_stdout", "input": "abaaaaaabbbbbcdes\n", "output": "No\n"}, {"type": "stdin...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nSome large corporation where Pol...
[{"type": "stdin_stdout", "input": "40\n313 97063\n372 23668\n377 56079\n428 88458\n435 57330\n454 88869\n456 75553\n466 87607\n468 4542\n469 30243\n471 8958\n472 59745\n473 90985\n474 32247\n475 71576\n476 14016\n477 91574\n478 38345\n479 93280\n480 89902\n481 41828\n482 3233\n483 66725\n484 23523\n485 46772\n486 9568...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nIn the game of Mastermind, there...
[{"type": "stdin_stdout", "input": "7\n5 2 4\n3 1 1 2 5\n5 3 4\n1 1 2 1 2\n4 0 4\n5 5 3 3\n4 1 1\n2 3 2 3\n6 1 2\n3 2 1 1 1 1\n6 2 4\n3 3 2 1 1 1\n6 3 6\n1 1 3 2 1 1\n", "output": "YES\n5 1 1 4 2 \nYES\n3 1 1 1 2 \nYES\n3 3 5 5 \nYES\n1 1 1 3 \nYES\n4 4 4 4 3 1 \nYES\n2 1 4 4 1 1 \nYES\n2 1 1 3 1 1 \n"}, {"type": "stdi...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\n*Shamelessly stolen from Here :)...
[{"input": "[53, 21, 10, 0, 1, 7, 13, 14, 3, 12, 8, 10, 7, 12, 0, 60]", "output": "[316]", "fn_name": "mem_alloc"}, {"input": "[14, 21, 10, 0, 1, 7, 0, 14, 3, 12, 8, 10, 17, 12, 0, 19]", "output": "[826]", "fn_name": "mem_alloc"}, {"input": "[17, 17, 3, 5, 1, 10, 6, 2, 0, 12, 8, 11, 16, 2, 1, 6]", "output": "[158378]",...
code_functional
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nThe Berland University is prepar...
[{"type": "stdin_stdout", "input": "97\n0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 -1 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 -1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0\n", "output": "-1\n"}, {"type": "stdin_stdout", "input": "97\n0 0 0 0 0 0 0 0 0 0 0 ...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nTakahashi is drawing a segment o...
[{"type": "stdin_stdout", "input": "124 -2 -1 -1", "output": "125\n"}, {"type": "stdin_stdout", "input": "241 -2 -1 -1", "output": "242\n"}, {"type": "stdin_stdout", "input": "121 -1 -1 0", "output": "122\n"}, {"type": "stdin_stdout", "input": "116 1 -2 -1", "output": "118\n"}, {"type": "stdin_stdout", "input": "209 -1...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nIn genetics a reading frame is a...
[{"input": "\"AGGTGACACCGCAAGCCTTATATTAGC\"", "output": "[[\"R*HRKPYIS\", \"GDTASLIL\", \"VTPQALY*\", \"ANIRLAVSP\", \"LI*GLRCH\", \"*YKACGVT\"]]", "fn_name": "translate_with_frame"}, {"input": "\"AGGTGACACCGCAAGCCTTATATTAGC\"\n[1, 2]", "output": "[[\"R*HRKPYIS\", \"GDTASLIL\"]]", "fn_name": "translate_with_frame"}, {"...
code_functional
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nPetya loves lucky numbers. Every...
[{"type": "stdin_stdout", "input": "00000000000000000000000000000000000000000000000000\n", "output": "-1\n"}, {"type": "stdin_stdout", "input": "110996812575168252737244204200508745829735318381381\n", "output": "7\n"}, {"type": "stdin_stdout", "input": "122094830270541438292052920866473330280784608392695\n", "output": ...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nYou are given two positive integ...
[{"type": "stdin_stdout", "input": "500 5000\n", "output": "99999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nInaka has a disc, the circumfere...
[{"type": "stdin_stdout", "input": "30000 28\n10601 1119\n11119 20601\n9493 25771\n14351 4869\n13101 3619\n23101 13619\n29869 9351\n6119 15601\n3101 23619\n1851 22369\n11851 2369\n8619 18101\n19579 20882\n18619 28101\n16851 7369\n8101 28619\n24869 4351\n24351 14869\n27369 6851\n9869 19351\n5601 26119\n3976 21301\n21851...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nA histogram is made of a number ...
[{"type": "stdin_stdout", "input": "8\n1 20 9 13 4 10 1 26", "output": "27\n"}, {"type": "stdin_stdout", "input": "8\n1 36 9 13 4 10 1 26", "output": "36\n"}, {"type": "stdin_stdout", "input": "8\n1 36 9 13 4 10 1 38", "output": "38\n"}, {"type": "stdin_stdout", "input": "8\n1 20 3 13 4 7 1 26", "output": "26\n"}, {"ty...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\n# Introduction \n\nDigital Cyphe...
[{"input": "\"notencrypted\"\n[14, 15, 20, 5, 14, 3, 18, 25, 16, 20, 5, 4]", "output": "[0]", "fn_name": "find_the_key"}, {"input": "\"masterpiece\"\n[14, 10, 22, 29, 6, 27, 19, 18, 6, 12, 8]", "output": "[1939]", "fn_name": "find_the_key"}, {"input": "\"tenthousand\"\n[21, 5, 14, 20, 8, 16, 21, 19, 1, 14, 5]", "output...
code_functional
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nGiven an array $A_1, A_2, ..., A...
[{"type": "stdin_stdout", "input": "2\n4\n-1 1 2 2\n1\n4", "output": "10\n1\n"}, {"type": "stdin_stdout", "input": "2\n4\n1 4 2 3\n1\n5\n", "output": "6\n1\n"}, {"type": "stdin_stdout", "input": "2\n4\n1 2 2 3\n1\n5", "output": "10\n1\n"}, {"type": "stdin_stdout", "input": "2\n4\n1 2 2 3\n1\n2", "output": "10\n1\n"}, {...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nMonocarp is playing a game \"Ass...
[{"type": "stdin_stdout", "input": "3 5\n1 4 4 3 4\n1 4 1 4 2\n1 4 4 4 3\n", "output": "\n166374062\n"}, {"type": "stdin_stdout", "input": "3 5\n1 4 4 3 4\n1 4 1 4 2\n1 4 4 4 3\n", "output": "166374062\n"}, {"type": "stdin_stdout", "input": "3 5\n1 4 4 3 4\n1 4 2 4 2\n1 4 4 4 3\n", "output": "831870297\n"}, {"type": "s...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nYou are given a tree with n node...
[{"type": "stdin_stdout", "input": "40\n11 8\n18 34\n21 23\n6 7\n23 28\n27 14\n8 18\n12 1\n27 4\n11 30\n40 22\n29 19\n17 32\n13 12\n15 9\n34 5\n27 37\n20 2\n18 33\n39 13\n27 17\n35 1\n40 3\n11 21\n1 35\n20 10\n27 20\n1 16\n27 6\n11 26\n38 36\n40 11\n17 25\n2 38\n40 39\n1 15\n12 27\n30 29\n14 14\n", "output": "12 1 1\n1...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nYou are given two set of points....
[{"type": "stdin_stdout", "input": "100 100 100\n-100 100 -100\n", "output": "1"}, {"type": "stdin_stdout", "input": "12 -32 89\n0 67 -23\n", "output": "1"}, {"type": "stdin_stdout", "input": "-1 1 -1\n-1 1 -1\n", "output": "-1\n"}, {"type": "stdin_stdout", "input": "0 -1 -1\n-1 -1 -1\n", "output": "1\n"}, {"type": "st...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nThe legendary Farmer John is thr...
[{"type": "stdin_stdout", "input": "100000 12\n8 11\n1 9\n5 4\n11 12\n7 11\n3 4\n6 5\n12 15\n15 13\n13 14\n7 11\n11 14\n", "output": "2\n"}, {"type": "stdin_stdout", "input": "100000 12\n8 10\n1 9\n5 4\n11 12\n7 11\n3 4\n3 5\n12 15\n15 13\n13 14\n7 8\n11 14\n", "output": "2\n"}, {"type": "stdin_stdout", "input": "10000...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nConsider some positive integer $...
[{"type": "stdin_stdout", "input": "4\n4\n2\n72\n10\n", "output": " 2\n 1\n 61\n ...
code_stdio