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\nWrite a function that returns a ...
[{"input": "\"aiqbuwbjqwbckjdwbwkqbefhglqhfjbwqejbcadn.bcaw.jbhwefjbwqkvbweevkj.bwvwbhvjk.dsvbajdv.hwuvghwuvfhgw.vjhwncv.wecnaw.ecnvw.kejvhnw.evjkhweqv.kjhwqeev.kjbhdjk.vbaewkjva\"", "output": "[\"invalid string\"]", "fn_name": "even_chars"}, {"input": "\"abcdefghijklm\"", "output": "[[\"b\", \"d\", \"f\", \"h\", \"j\"...
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\nB: Parentheses Number\n\nproblem...
[{"type": "stdin_stdout", "input": "2\n2 -107", "output": ":(\n"}, {"type": "stdin_stdout", "input": "2\n2 -187", "output": ":(\n"}, {"type": "stdin_stdout", "input": "2\n2 -155", "output": ":(\n"}, {"type": "stdin_stdout", "input": "2\n2 -142", "output": ":(\n"}, {"type": "stdin_stdout", "input": "2\n2 -100", "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 an array $a_1, a_2...
[{"type": "stdin_stdout", "input": "100\n1065 362 1002 1071 502 252 1401 1824 887 1803 1572 1571 502 1408 1699 1750 1785 1507 1616 1458 372 323 939 1208 1639 1517 1145 319 935 1507 1094 156 1062 39 1884 1470 646 917 1699 631 39 789 1030 1589 1700 17 495 32 506 574 1458 206 1091 211 279 1617 1624 1183 572 1496 1014 2007...
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\nSnuke and Ciel went to a strange...
[{"type": "stdin_stdout", "input": "7 13\n.............\n.###.###.###.\n.#.#.#...#...\n.###.#...#...\n...#.#.#.#.#.\n.#.#.###.###.\n.............", "output": "############.\n####.###.###.\n############.\n####.#...#...\n############.\n##.#.###.###.\n############.\n............#\n.############\n.#.#.#...#..#\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 an integer $n$, find the m...
[{"type": "stdin_stdout", "input": "1\n168457447\n", "output": "134217727\n"}, {"type": "stdin_stdout", "input": "1\n276490162\n", "output": "268435455\n"}, {"type": "stdin_stdout", "input": "1\n109011159\n", "output": "67108863\n"}, {"type": "stdin_stdout", "input": "1\n99888383\n", "output": "67108863\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\nAlice got an array of length $n$...
[{"type": "stdin_stdout", "input": "5 12\n634 895\n143 730\n901 245\n386 486\n395 -111\n-469 -104\n-681 -623\n-900 843\n889 -883\n476 -304\n777 986\n206 -491\n", "output": "8107.800000000000182\n"}, {"type": "stdin_stdout", "input": "5 12\n634 895\n143 730\n901 245\n386 486\n395 -111\n-469 -104\n-681 -623\n-900 843\n88...
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\nImagine that you are given two s...
[{"input": "5\n17", "output": "[5.666666666666667]", "fn_name": "maxlen"}, {"input": "17\n5", "output": "[5.666666666666667]", "fn_name": "maxlen"}, {"input": "7\n12", "output": "[6.0]", "fn_name": "maxlen"}, {"input": "12\n7", "output": "[6.0]", "fn_name": "maxlen"}, {"input": "5\n12", "output": "[5]", "fn_name": "max...
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 containing only z...
[{"input": "[1, 0, 1, 1, 1, 0, 1, 1, 1, 1, 0, 1, 1, 1, 1, 0, 0, 1, 1]", "output": "[10]", "fn_name": "replace_zero"}, {"input": "[1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 0, 1]", "output": "[10]", "fn_name": "replace_zero"}, {"input": "[1, 1, 1, 0, 1, 1, 0, 1, 1, 1]", "output": "[6]", "fn_name": "replace_zero"}, {"input": "[1, 1,...
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\nTonight, in your favourite cinem...
[{"type": "stdin_stdout", "input": "6\n11 21 35 22 7 36 27 34 8 20 15 13 16 1 24 3 2 17 26 9 18 32 31 23 19 14 4 25 10 29 28 33 12 6 5 30", "output": "11"}, {"type": "stdin_stdout", "input": "4\n6 7 1 4 13 16 10 9 5 11 12 14 15 2 3 8", "output": "3"}, {"type": "stdin_stdout", "input": "3\n2 3 7 9 5 4 8 6 1", "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\nIvar the Boneless is a great lea...
[{"type": "stdin_stdout", "input": "100 55\n1 2 4 4 3 5 5 2 3 1 2 2 1 2 4 5 0 5 4 2 5 4 5 3 3 5 4 4 4 5 5 2 3 3 4 4 3 4 5 5 5 5 3 5 1 2 4 3 4 5 3 3 2 0 4 5 3 4 4 1 9 1 5 2 0 1 4 0 3 3 1 4 2 5 4 5 3 2 5 5 2 3 2 3 2 2 3 4 4 4 1 4 2 4 5 3 1 3 3 1\n5 2 1 4 3 4 3 1 4 4 1 2 0 2 1 5 5 4 5 4 2 5 2 1 5 1 4 0 1 5 4 5 1 4 4 2 5 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\nCheaterius is a famous in all th...
[{"type": "stdin_stdout", "input": "7\n21\n33\n**\n33\n12\n**\n32\n31\n**\n21\n33\n**\n33\n12\n**\n32\n31\n**\n13\n23\n", "output": "1\n"}, {"type": "stdin_stdout", "input": "7\n21\n33\n**\n33\n12\n**\n32\n31\n**\n21\n38\n**\n33\n12\n**\n32\n31\n**\n13\n23\n", "output": "2\n"}, {"type": "stdin_stdout", "input": "7\n21\...
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 seems like the year of 2013 c...
[{"type": "stdin_stdout", "input": "1987\n", "output": "2013\n"}, {"type": "stdin_stdout", "input": "2013\n", "output": "2014\n"}, {"type": "stdin_stdout", "input": "1000\n", "output": "1023\n"}, {"type": "stdin_stdout", "input": "1001\n", "output": "1023\n"}, {"type": "stdin_stdout", "input": "1234\n", "output": "1235...
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\nDeadpool wants to decorate his g...
[{"type": "stdin_stdout", "input": "100 100\n100 1 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 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 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\nWe have an analog clock whose th...
[{"type": "stdin_stdout", "input": "12 0 0 0\n12 11 59 59\n12 1 56 0\n12 1 56 3\n12 1 56 34\n12 3 9 43\n12 3 10 14\n12 2 17 58\n12 7 18 0\n10 7 23 0\n12 7 23 31\n2 0 38 19\n2 0 39 0\n2 0 39 30\n2 1 6 14\n2 1 20 1\n2 1 20 31\n3 2 19 0\n3 2 59 30\n4 0 28 48\n5 1 5 37\n5 1 10 10\n5 1 7 41\n11 0 36 0\n0 0 0 0", "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\nRecently you've discovered a new...
[{"type": "stdin_stdout", "input": "10 79\n2 2 70\n2 10 35\n10 10 76\n11 11 66\n12 12 75\n12 14 88\n15 16 76\n17 18 97\n19 20 105\n20 20 46\n", "output": "862\n"}, {"type": "stdin_stdout", "input": "10 79\n2 2 70\n2 10 35\n10 10 76\n11 11 66\n12 12 75\n12 14 88\n15 16 76\n17 18 97\n19 20 105\n20 20 46\n", "output": "86...
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\nB: 階層的計算機 (Hierarchical Calculat...
[{"type": "stdin_stdout", "input": "4\n-1 2 -2 2", "output": "4\n1\n2\n3\n4\n"}, {"type": "stdin_stdout", "input": "4\n2 -1 -2 -1", "output": "3\n1\n2\n3\n"}, {"type": "stdin_stdout", "input": "4\n2 -1 -2 1", "output": "3\n1\n2\n3\n"}, {"type": "stdin_stdout", "input": "4\n-1 -2 0 2", "output": "3\n1\n2\n4\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\nIf there is an integer not less ...
[{"type": "stdin_stdout", "input": "3 3\n1 7\n3 2\n1 7\n", "output": "702\n"}, {"type": "stdin_stdout", "input": "3 3\n3 1\n2 1\n1 4\n", "output": "411\n"}, {"type": "stdin_stdout", "input": "3 1\n1 7\n3 2\n0 28", "output": "700\n"}, {"type": "stdin_stdout", "input": "2 3\n2 0\n2 0\n2 0\n", "output": "10\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\nShaass has n books. He wants to ...
[{"type": "stdin_stdout", "input": "100\n2 2\n1 2\n1 1\n2 1\n1 2\n2 1\n2 2\n2 1\n2 1\n1 2\n1 2\n2 1\n1 2\n2 1\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 1\n2 2\n2 1\n1 1\n1 2\n2 2\n1 1\n2 2\n1 2\n2 1\n2 2\n1 2\n2 2\n1 2\n1 1\n2 2\n2 2\n1 1\n1 2\n2 2\n1 2\n1 1\n1 1\n1 1\n2 1\n2 1\n1 2\n1 2\n2 2\n1 2\n1 2\n1 1\n2 1\n2 1\n2 2\n1 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\nAnadi has a set of dominoes. Eve...
[{"type": "stdin_stdout", "input": "7 21\n3 5\n7 2\n2 3\n6 5\n5 2\n4 7\n2 6\n2 4\n6 7\n5 1\n1 4\n4 5\n5 7\n4 6\n3 1\n1 2\n3 4\n7 1\n3 7\n6 1\n3 6\n", "output": "16\n"}, {"type": "stdin_stdout", "input": "7 21\n1 2\n1 3\n1 4\n1 5\n1 6\n1 7\n2 3\n2 4\n2 5\n2 6\n2 7\n3 4\n3 5\n3 6\n3 7\n4 5\n4 6\n4 7\n5 6\n5 7\n6 7\n", "o...
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\nPolycarpus loves lucky numbers. ...
[{"type": "stdin_stdout", "input": "1000000000\n", "output": "40744\n"}, {"type": "stdin_stdout", "input": "1000000000\n", "output": "40744\n"}, {"type": "stdin_stdout", "input": "999999999\n", "output": "40743\n"}, {"type": "stdin_stdout", "input": "999999998\n", "output": "40742\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\nSuppose we have a sequence of no...
[{"type": "stdin_stdout", "input": "10000\n965025415 999971470 701127278 722558453 860773508 998208321 882682007 717808232 965289578 999849240 647655738 734796389 445919839 565884615 682769357 418326924 405511267 647687211 973600883 765117686 842450085 998782971 915038182 747264263 910653625 948741426 999497858 9896202...
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 aim of the kata is to decomp...
[{"input": "3989", "output": "[\"2^3981 * 3^1990 * 5^994 * 7^662 * 11^396 * 13^330 * 17^247 * 19^220 * 23^180 * 29^141 * 31^132 * 37^109 * 41^99 * 43^94 * 47^85 * 53^76 * 59^68 * 61^66 * 67^59 * 71^56 * 73^54 * 79^50 * 83^48 * 89^44 * 97^41 * 101^39 * 103^38 * 107^37 * 109^36 * 113^35 * 127^31 * 131^30 * 137^29 * 139^2...
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\nAfter learning a lot about space...
[{"type": "stdin_stdout", "input": "20\niw\nix\nudb\nbg\noi\nuo\njsm\num\ns\nquy\nqo\nbxct\nng\nrmr\nnu\nps\nio\nkh\nw\nk\n", "output": "5\n"}, {"type": "stdin_stdout", "input": "20\niw\nix\nudb\nbg\noi\nuo\njsm\num\ns\nquy\nqo\nbxct\nng\nrmr\nnu\nps\nio\nkh\nw\nk\n", "output": "5\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\nIn this task Anna and Maria play...
[{"type": "stdin_stdout", "input": "S..SSS.A\nS.S.SSSS\nSSSSSSSS\n...SS...\nS.SSSSSS\nSS..SS.S\nSS..S.S.\nMSS..SSS\n", "output": "LOSE\n"}, {"type": "stdin_stdout", "input": ".SSSSSSA\n.SSSSSSS\n.SSSSSSS\n.SSSSSSS\n.SSSSSSS\n.SSSSSSS\nSSSSSSS.\nMSSSSSSS\n", "output": "LOSE\n"}, {"type": "stdin_stdout", "input": ".SSSS....
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++++++++[>+>++>+++>++++>+++++>++...
[{"type": "stdin_stdout", "input": "1000000\n", "output": "2\n"}, {"type": "stdin_stdout", "input": "1000000\n", "output": "2\n"}, {"type": "stdin_stdout", "input": "1000010\n", "output": "3\n"}, {"type": "stdin_stdout", "input": "1229030\n", "output": "0\n"}, {"type": "stdin_stdout", "input": "1000011\n", "output": "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\nInna likes sweets and a game cal...
[{"type": "stdin_stdout", "input": "10 10\nG********S\n*G*******S\n**G******S\n***G*****S\n****G****S\nS***G*****\n******G**S\n*******G*S\n********GS\nG********S\n", "output": "-1\n"}, {"type": "stdin_stdout", "input": "10 10\nG********S\n*G*******S\n**G******S\n***G*****S\n****S****G\nS***G*****\n******G**S\n*******G*...
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 have a positive integer m an...
[{"type": "stdin_stdout", "input": "101 298\n", "output": "10000000000000000000000000000000000000000000000000000000000000000000999999999999999999999999999999999 99999999999999999999999999999999910000000000000000000000000000000000000000000000000000000000000000000\n"}, {"type": "stdin_stdout", "input": "101 299\n", "outp...
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\nVanya loves playing. He even has...
[{"type": "stdin_stdout", "input": "123 222\n44 -190 -188 -185 -55 17 190 176 157 176 -24 -113 -54 -61 -53 53 -77 68 -12 -114 -217 163 -122 37 -37 20 -108 17 -140 -210 218 19 -89 54 18 197 111 -150 -36 -131 -172 36 67 16 -202 72 169 -137 -34 -122 137 -72 196 -17 -104 180 -102 96 -69 -184 21 -15 217 -61 175 -221 62 173 ...
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 the infinite sequence $...
[{"type": "stdin_stdout", "input": "9\n2\n3\n3\n12\n13\n6\n7\n11\n9\n", "output": "2\n3\n3\n13\n7\n12\n5\n11\n15\n"}, {"type": "stdin_stdout", "input": "9\n2\n3\n3\n12\n10\n6\n3\n22\n6\n", "output": "2\n3\n3\n13\n6\n12\n3\n18\n12\n"}, {"type": "stdin_stdout", "input": "9\n1\n5\n3\n4\n18\n6\n12\n8\n9\n", "output": "1\n8...
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 an array of N elements, ch...
[{"type": "stdin_stdout", "input": "50\n15\n-403058 315136 370586 156605 -458323 -377956 576329 623628 -772464 -967801 -1004 904618 -645084 -944193 -213379\n-433844\n14\n763376 324068 -260116 644761 -509791 -5611 -102387 131396 484627 750553 -323621 434549 -24093 465676\n2773387\n14\n948700 631252 -404264 73426 63860 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\nGiven is a permutation P of \\{1...
[{"type": "stdin_stdout", "input": "95\n41 7 46 26 89 2 78 92 8 16 45 57 17 6 35 62 91 95 63 48 19 79 74 52 1 77 28 93 56 31 25 54 40 64 9 34 53 11 10 55 94 24 67 58 27 60 90 87 18 73 50 80 20 21 61 42 88 14 44 76 39 70 51 66 83 32 30 81 23 82 72 65 15 68 75 71 69 13 4 3 85 84 49 59 22 33 5 47 12 37 29 36 38 86 43\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\nYou are provided with array of p...
[{"input": "[1, 2, 3, 4, 5]\n3", "output": "[210]", "fn_name": "modified_sum"}, {"input": "[2, 4, 6, 8]\n6", "output": "[312940]", "fn_name": "modified_sum"}, {"input": "[2, 7, 13, 17]\n2", "output": "[472]", "fn_name": "modified_sum"}, {"input": "[3, 6, 9, 12]\n3", "output": "[2670]", "fn_name": "modified_sum"}, {"inp...
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\nBob is decorating his kitchen, m...
[{"type": "stdin_stdout", "input": "1000 1000\n", "output": "708964705\n"}, {"type": "stdin_stdout", "input": "1000 1000\n", "output": "708964705\n"}, {"type": "stdin_stdout", "input": "1000 1001\n", "output": "419685057\n"}, {"type": "stdin_stdout", "input": "1000 122\n", "output": "712990290\n"}, {"type": "stdin_stdo...
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 an angle $\\text{a...
[{"type": "stdin_stdout", "input": "69\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n", "output": "180\n180\n180\n180\n180\n180\n180\n180\n180\n180\n180\n180\...
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 string $s$ of ev...
[{"type": "stdin_stdout", "input": "3\n2\n10\n4\n0110\n8\n11101000\n", "output": "0\n1\n2\n"}, {"type": "stdin_stdout", "input": "3\n2\n10\n4\n0110\n8\n11100001\n", "output": "0\n1\n3\n"}, {"type": "stdin_stdout", "input": "3\n2\n10\n4\n1010\n8\n11101000\n", "output": "0\n0\n2\n"}, {"type": "stdin_stdout", "input": "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\nYou are given two positive integ...
[{"type": "stdin_stdout", "input": "123456789012345678901234567890\n54295952540662239241952312402", "output": "GREATER\n"}, {"type": "stdin_stdout", "input": "123456789012345678901234567890\n67478580391614097833417622355", "output": "GREATER\n"}, {"type": "stdin_stdout", "input": "123456789012345678901234567890\n127408...
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\nCreate a function that finds the...
[{"input": "20\n1", "output": "[\"10x^2\"]", "fn_name": "integrate"}, {"input": "40\n3", "output": "[\"10x^4\"]", "fn_name": "integrate"}, {"input": "90\n2", "output": "[\"30x^3\"]", "fn_name": "integrate"}, {"input": "12\n5", "output": "[\"2x^6\"]", "fn_name": "integrate"}, {"input": "3\n2", "output": "[\"1x^3\"]", "f...
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\nCreate a function that takes a n...
[{"input": "1.01", "output": "[\"F\"]", "fn_name": "grader"}, {"input": "0.2", "output": "[\"F\"]", "fn_name": "grader"}, {"input": "0.7", "output": "[\"C\"]", "fn_name": "grader"}, {"input": "0.8", "output": "[\"B\"]", "fn_name": "grader"}, {"input": "0.9", "output": "[\"A\"]", "fn_name": "grader"}, {"input": "0.6", "...
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's a very unfortunate day for ...
[{"type": "stdin_stdout", "input": "20 3696\n87 22 21 83 95 31 28 96 71 25 56 40 70 79 46 87 19 19 34 25\n70 44 34 11 2 1 59 22 46 28 3 53 52 71 34 18 65 71 76 30\n", "output": "21.768421052631577\n"}, {"type": "stdin_stdout", "input": "20 1479\n69 30 15 62 81 24 5 16 25 65 47 23 62 51 87 50 6 44 88 61\n57 47 76 68 7 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\nJeff got 2n real numbers a_1, a_...
[{"type": "stdin_stdout", "input": "10\n8003.867 4368.000 2243.000 3340.287 5384.000 1036.456 3506.000 4463.000 1477.000 2420.314 9391.000 1696.000 5857.833 244.000 8220.000 5879.000 5424.482 2631.197 7111.000 9157.536\n", "output": "0.028\n"}, {"type": "stdin_stdout", "input": "10\n8003.867 4368.000 2243.298 3340.000 ...
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\"The zombies are lurking outsid...
[{"type": "stdin_stdout", "input": "10 7\n.......\n.......\n.......\n.......\n.......\n.......\n.......\n.......\n...B...\nB.BB.B.\n", "output": "3\n"}, {"type": "stdin_stdout", "input": "10 7\n.......\n.......\n.......\n.......\n.......\n.......\n.......\n...-...\n...B...\nB.BB.B.\n", "output": "3\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\nComplete the function that retur...
[{"input": "10\n4", "output": "[[10, 100, 10000, 100000000]]", "fn_name": "squares"}, {"input": "2\n5", "output": "[[2, 4, 16, 256, 65536]]", "fn_name": "squares"}, {"input": "5\n3", "output": "[[5, 25, 625]]", "fn_name": "squares"}, {"input": "3\n3", "output": "[[3, 9, 81]]", "fn_name": "squares"}, {"input": "2\n-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\nCarousel Boutique is busy again!...
[{"type": "stdin_stdout", "input": "5 5\nzbacg\nbaaac\naaaaa\neaaad\nweadd\n", "output": "31\n"}, {"type": "stdin_stdout", "input": "5 5\nzbacg\nbaaac\naaaaa\ndaaae\nweadd\n", "output": "31\n"}, {"type": "stdin_stdout", "input": "5 5\nzbacf\nbcaaa\naaaaa\neaaad\nveadd\n", "output": "28\n"}, {"type": "stdin_stdout", "in...
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\nSuppose that you are in a campus...
[{"type": "stdin_stdout", "input": "5 5 3\n.....\n.....\n*...*\n*....\n.*...\n", "output": "18\n"}, {"type": "stdin_stdout", "input": "5 5 3\n.....\n.....\n*...*\n*....\n.*...\n", "output": "18\n"}, {"type": "stdin_stdout", "input": "5 5 3\n.....\n.....\n*...*\n*....\n...*.\n", "output": "18\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\nThe Central Company has an offic...
[{"type": "stdin_stdout", "input": "20\n384933 946658 407136 242739 -242739 -407136 -946658 -384933 384933 -384933 319281 407136 804861 -407136 415987 946658 -946658 -415987 -804861 -319281\n", "output": "3\n8 2 10 \n"}, {"type": "stdin_stdout", "input": "20\n384933 946658 407136 242739 -242739 -407136 -946658 -384933 ...
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\nBooks are indexed. Write a progr...
[{"type": "stdin_stdout", "input": "ntzsd 22\neevn 1\nnutrodnctioi -1\nse_z 1\nstyle 32\ntndmucod 2\nstyld 10\nmuee -2", "output": "eevn\n1\nmuee\n-2\nntzsd\n22\nnutrodnctioi\n-1\nse_z\n1\nstyld\n10\nstyle\n32\ntndmucod\n2\n"}, {"type": "stdin_stdout", "input": "ntzsd 10\neevn 1\nnutrodnctioi -1\nse_z 1\nstyle 32\ntndm...
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\nBarney is standing in a bar and ...
[{"type": "stdin_stdout", "input": "2.0629094807595491132306264747042243928486303384791951220362096240931158821630792563855724946791054152e85\n", "output": "20629094807595491132306264747042243928486303384791951220362096240931158821630792563855.724946791054152\n"}, {"type": "stdin_stdout", "input": "1.739019376653594888...
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 square of size $10^6 ...
[{"type": "stdin_stdout", "input": "3 3\n2 3 1000000\n4 0 4\n3 0 1000000\n4 0 1\n2 0 5\n3 2 1000000\n", "output": "7\n"}, {"type": "stdin_stdout", "input": "3 3\n2 3 1000000\n7 0 4\n3 0 1000000\n4 0 1\n2 0 5\n3 2 1000000\n", "output": "6\n"}, {"type": "stdin_stdout", "input": "3 3\n2 3 1000000\n4 0 4\n3 0 1000000\n4 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\nKurohashi has never participated...
[{"type": "stdin_stdout", "input": "111\n", "output": "111\n"}, {"type": "stdin_stdout", "input": "112\n", "output": "222\n"}, {"type": "stdin_stdout", "input": "750\n", "output": "777\n"}, {"type": "stdin_stdout", "input": "234\n", "output": "333\n"}, {"type": "stdin_stdout", "input": "999\n", "output": "999\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\nYou are given array consisting o...
[{"type": "stdin_stdout", "input": "10\n32372808 517917901 640274071 1836610331 71867556 96204862 120140751 446173607 796619138 1156360703\n", "output": "6\n"}, {"type": "stdin_stdout", "input": "10\n32372808 517917901 156515250 1836610331 71867556 96204862 120140751 446173607 796619138 1156360703\n", "output": "6\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\nReforms continue entering Berlan...
[{"type": "stdin_stdout", "input": "98 24\n52 20 12 75 44 22 22 25 28 100 8 41 31 47 95 87 5 54 7 49 32 46 42 37 45 22 29 11 54 98 46 94 10 47 114 2 15 108 17 82 46 22 32 62 89 37 30 26 92 77 69 11 59 78 24 66 88 10 32 93 46 14 57 20 5 69 53 99 81 94 67 22 54 31 49 52 46 51 49 4 53 31 4 66 28 38 103 5 40 75 15 52 87 16...
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 tradition of welcoming the N...
[{"type": "stdin_stdout", "input": "30\n1 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5\n", "output": "43348\n"}, {"type": "stdin_stdout", "input": "30\n5 5 1 1 4 4 3 1 5 3 5 5 1 2 2 3 4 5 2 1 4 3 1 1 4 5 4 4 2 2\n", "output": "24339\n"}, {"type": "stdin_stdout", "input": "30\n2 2 2 2 2 2 2 2 2 2 2 2 2 2 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\n### Task:\n\nYou have to write a...
[{"input": "7", "output": "[\"1234567\\n2345671\\n3456712\\n4567123\\n5671234\\n6712345\\n7123456\"]", "fn_name": "pattern"}, {"input": "4", "output": "[\"1234\\n2341\\n3412\\n4123\"]", "fn_name": "pattern"}, {"input": "-25", "output": "[\"\"]", "fn_name": "pattern"}, {"input": "1", "output": "[\"1\"]", "fn_name": "pat...
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 new \"Avengers\" movie has j...
[{"input": "[25, 50, 25, 100, 25, 25, 50, 100, 25, 25, 25, 100, 25, 25, 50, 100, 25, 50, 25, 100, 25, 50, 50, 50]", "output": "[\"NO\"]", "fn_name": "tickets"}, {"input": "[25, 25, 25, 100, 25, 25, 25, 100, 25, 25, 50, 100, 25, 25, 50, 100, 50, 50]", "output": "[\"NO\"]", "fn_name": "tickets"}, {"input": "[25, 25, 25, ...
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\nFlash has invited his nemesis Th...
[{"input": "[\"3\", \"K\", \"5\", \"A\", \"5\", \"6\", \"7\", \"J\", \"7\", \"9\", \"10\", \"Q\", \"Q\", \"6\", \"8\", \"7\", \"4\", \"J\", \"8\", \"9\", \"K\", \"J\", \"10\", \"4\", \"K\", \"4\"]\n[\"2\", \"8\", \"9\", \"Q\", \"A\", \"K\", \"6\", \"3\", \"J\", \"2\", \"4\", \"3\", \"3\", \"8\", \"A\", \"2\", \"6\", \"...
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\n$n$ players are playing a game.\...
[{"type": "stdin_stdout", "input": "1\n10\n1109412863 911871372 379798020 844017253 852316352 439889133 601615010 999121621 343144247 662484047\n148682006 868690703 149843110 1652026160 587798634 40092006 292693207 256527822 128794711 765771574\n", "output": "1111111111\n"}, {"type": "stdin_stdout", "input": "1\n10\n61...
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\nSnuke loves working out. He is n...
[{"type": "stdin_stdout", "input": "100000\n", "output": "457992974\n"}, {"type": "stdin_stdout", "input": "100001", "output": "755072381\n"}, {"type": "stdin_stdout", "input": "110001", "output": "817497558\n"}, {"type": "stdin_stdout", "input": "110011", "output": "422312314\n"}, {"type": "stdin_stdout", "input": "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\nMasha lives in a multi-storey bu...
[{"type": "stdin_stdout", "input": "1000 999 1000 1000 1000 1000\n", "output": "NO\n"}, {"type": "stdin_stdout", "input": "1000 999 1100 1000 1000 1000\n", "output": "NO\n"}, {"type": "stdin_stdout", "input": "1000 999 1000 1000 1000 1000\n", "output": "NO"}, {"type": "stdin_stdout", "input": "188 288 112 595 331 414\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\nLunar New Year is approaching, a...
[{"type": "stdin_stdout", "input": "100\n28 27 23 6 23 11 25 20 28 15 29 23 20 2 8 24 8 9 30 8 8 1 11 7 6 17 17 27 26 30 12 22 17 22 9 25 4 26 9 26 10 30 13 4 16 12 23 19 10 22 12 20 3 16 10 4 29 11 15 4 5 7 29 16 3 1 7 16 26 14 28 1 15 19 30 28 5 22 14 28 13 12 11 30 3 4 7 10 22 8 4 10 22 12 17 27 23 11 18 7\n", "outp...
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\nMr. Scrooge, a very busy man, de...
[{"type": "stdin_stdout", "input": "61 764\n-9 15\n11 -8\n-6 -7\n-13 -19\n16 -16\n-5 -1\n20 -19\n-14 -1\n-11 4\n7 -2\n-3 2\n-14 -17\n15 18\n20 15\n-13 -2\n15 8\n3 13\n19 -10\n2 -6\n15 -3\n-12 11\n4 -16\n-14 20\n0 2\n11 -7\n-6 -11\n16 7\n8 -3\n16 -10\n-3 9\n9 5\n4 -1\n-17 9\n14 -4\n8 6\n-19 12\n10 -17\n-5 7\n7 -3\n5 3\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\nImagine you have an infinite 2D ...
[{"type": "stdin_stdout", "input": "30426905\n", "output": "172120564\n"}, {"type": "stdin_stdout", "input": "38450759\n", "output": "217510336\n"}, {"type": "stdin_stdout", "input": "19863843\n", "output": "112366864\n"}, {"type": "stdin_stdout", "input": "24562258\n", "output": "138945112\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\nTwo bears are playing tic-tac-to...
[{"type": "stdin_stdout", "input": "... ... ...\n... ... ...\n... ... ...\n\n... ... ...\n... ... ...\n... x.. ...\n\n... ... ...\n... ... ...\n... ... ...\n6 4\n", "output": "... ... ... \n... ... ... \n... ... ... \n\n... ... ... \n... ... ... \n... x.. ... \n\n!!! ... ... \n!!! ... ... \n!!! ... ... \n\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\nGiven a string `S` and a charact...
[{"input": "\"lovecodewars\"\n\"e\"", "output": "[[3, 2, 1, 0, 1, 2, 1, 0, 1, 2, 3, 4]]", "fn_name": "shortest_to_char"}, {"input": "\"aabbaabb\"\n\"a\"", "output": "[[0, 0, 1, 1, 0, 0, 1, 2]]", "fn_name": "shortest_to_char"}, {"input": "\"aaaabbbb\"\n\"b\"", "output": "[[4, 3, 2, 1, 0, 0, 0, 0]]", "fn_name": "shortest...
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\nIn mathematics, a subsequence is...
[{"type": "stdin_stdout", "input": "KOROXDDWEUVYWJIXSFPEJFYZJDDUXISOFJTIFJSBTWIJQHMTQWLAGGMXTFALRXYCMGZNKYQRCDVTPRQDBAALTWAXTNLDPYWNSFKE\nNHZGRZFMFQGSAYOJTFKMMUPOOQXWCPPAIVRJHINJPHXTTBWRIYNOHMJKBBGXVXYZDBVBBTQRXTOFLBBCXGNICBKAAGOKAYCCJYCW\nXCXLBESCRBNKWYGFDZFKWYNLFAKEWWGRUIAQGNCFDQXCHDBEQDSWSNGVKUFOGGSPFFZWTXGZQMMFJXDW...
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 a bingo card with a 3\\t...
[{"type": "stdin_stdout", "input": "60 88 34\n92 41 43\n65 73 48\n10\n60\n43\n88\n11\n48\n73\n65\n41\n92\n34\n", "output": "Yes\n"}, {"type": "stdin_stdout", "input": "60 106 34\n92 41 43\n39 73 48\n10\n60\n43\n88\n11\n48\n73\n65\n41\n92\n34", "output": "Yes\n"}, {"type": "stdin_stdout", "input": "60 88 34\n92 41 43\n3...
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\nIroha is very particular about n...
[{"type": "stdin_stdout", "input": "1001 8\n1 0 4 5 6 7 15 11", "output": "2222\n"}, {"type": "stdin_stdout", "input": "1001 8\n1 3 2 5 6 7 15 9", "output": "4000\n"}, {"type": "stdin_stdout", "input": "1001 8\n1 3 4 5 6 7 8 9", "output": "2000\n"}, {"type": "stdin_stdout", "input": "1000 8\n2 3 4 5 6 7 8 9", "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\nEveryone knows that long ago on ...
[{"type": "stdin_stdout", "input": "10\n8097 8097 8097 14160 8097 8097 8097 8097 8097 8097\n", "output": "45\n"}, {"type": "stdin_stdout", "input": "10\n8097 8097 8097 14160 8097 8097 8097 8097 8097 4894\n", "output": "38\n"}, {"type": "stdin_stdout", "input": "10\n8097 8097 8097 14160 8097 8097 8097 8097 9062 4894\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\nTanya wants to go on a journey a...
[{"type": "stdin_stdout", "input": "10\n10 60 12 13 14 15 16 66 18 130\n", "output": "130\n"}, {"type": "stdin_stdout", "input": "10\n10 60 12 13 14 15 16 77 18 130\n", "output": "130\n"}, {"type": "stdin_stdout", "input": "9\n18 11 24 7 18 10 1 20 17\n", "output": "24\n"}, {"type": "stdin_stdout", "input": "9\n4 10 21...
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\nproblem\n\nJOI Pizza sells pizza...
[{"type": "stdin_stdout", "input": "8\n3\n2\n3\n2\n4\n6\n20\n4\n4\n33\n16\n15\n15\n12\n5\n8\n0", "output": "3\n15\n"}, {"type": "stdin_stdout", "input": "8\n3\n2\n3\n0\n4\n6\n20\n4\n4\n14\n14\n23\n7\n7\n11\n8\n0", "output": "3\n23\n"}, {"type": "stdin_stdout", "input": "8\n3\n2\n3\n0\n4\n6\n20\n4\n4\n17\n17\n23\n7\n7\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\nThis task will exclusively conce...
[{"type": "stdin_stdout", "input": "100 20\n2 2 2 1 1 2 1 2 1 2 1 1 2 2 2 2 2 1 2 1 2 2 2 2 1 2 1 2 1 1 1 1 2 2 2 2 1 2 1 1 2 2 2 2 1 2 1 2 1 2 1 1 2 1 2 2 2 1 2 2 2 2 2 2 2 2 1 2 1 1 1 1 2 2 2 2 2 1 1 2 2 1 2 2 1 2 1 2 1 2 1 1 2 2 1 2 2 1 1 1\n", "output": "13\n"}, {"type": "stdin_stdout", "input": "100 25\n2 2 1 2 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\nN hotels are located on a straig...
[{"type": "stdin_stdout", "input": "9\n1 3 6 13 15 18 19 29 31\n10\n4\n1 8\n7 3\n6 7\n8 5\n", "output": "4\n2\n1\n2\n"}, {"type": "stdin_stdout", "input": "9\n1 3 6 13 15 18 19 29 31\n10\n4\n1 8\n7 3\n6 7\n8 3", "output": "4\n2\n1\n3\n"}, {"type": "stdin_stdout", "input": "9\n1 3 6 13 23 18 19 29 31\n12\n4\n1 8\n1 5\n9...
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\nPizzaForces is Petya's favorite ...
[{"type": "stdin_stdout", "input": "6\n40\n15\n300\n1\n9999999999999999\n2\n", "output": "100\n40\n750\n15\n25000000000000000\n15\n"}, {"type": "stdin_stdout", "input": "6\n12\n15\n300\n1\n9999999999999999\n3\n", "output": "30\n40\n750\n15\n25000000000000000\n15\n"}, {"type": "stdin_stdout", "input": "6\n20\n15\n300\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\nChef and his girlfriend are goin...
[{"type": "stdin_stdout", "input": "2\n5\n11 11 1 4 -1\n5\n6 4 15 0 1", "output": "12\n17\n"}, {"type": "stdin_stdout", "input": "2\n5\n6 15 1 4 -3\n5\n12 4 15 0 1", "output": "16\n17\n"}, {"type": "stdin_stdout", "input": "2\n5\n6 15 1 4 -4\n5\n12 4 28 0 1", "output": "16\n30\n"}, {"type": "stdin_stdout", "input": "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\nHaving watched the last Harry Po...
[{"type": "stdin_stdout", "input": "156161456146164104103460452045416165146141414651641564105461465156445621465146514562146145465165145145614561465145614561\n", "output": "3\n"}, {"type": "stdin_stdout", "input": "1035582652791945409199994791047369985911446143541282263853565235001365759340472951643698773718261928078951...
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-----Input-----\n\nThe input con...
[{"type": "stdin_stdout", "input": "927\n", "output": "1\n"}, {"type": "stdin_stdout", "input": "999\n", "output": "1\n"}, {"type": "stdin_stdout", "input": "142\n", "output": "0\n"}, {"type": "stdin_stdout", "input": "309\n", "output": "1\n"}, {"type": "stdin_stdout", "input": "572\n", "output": "0\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\nIn the board game Talisman, when...
[{"input": "[7, 2]\n[6, 8]", "output": "[\"Pray for a tie!\"]", "fn_name": "get_required"}, {"input": "[2, 0]\n[8, 1]", "output": "[\"Auto-lose\"]", "fn_name": "get_required"}, {"input": "[1, 10]\n[1, 4]", "output": "[\"Auto-win\"]", "fn_name": "get_required"}, {"input": "[8, 1]\n[3, 0]", "output": "[\"Auto-win\"]", "f...
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\nNo Story\n\nNo Description\n\nOn...
[{"input": "9", "output": "[[1, 3, 9]]", "fn_name": "mystery"}, {"input": "10", "output": "[[1, 5]]", "fn_name": "mystery"}, {"input": "3", "output": "[[1, 3]]", "fn_name": "mystery"}, {"input": "5", "output": "[[1, 5]]", "fn_name": "mystery"}, {"input": "6", "output": "[[1, 3]]", "fn_name": "mystery"}, {"input": "7", ...
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\nNatasha travels around Mars in t...
[{"type": "stdin_stdout", "input": "60\nAND 20 4\nNOT 42\nAND 48 59\nOR 17 7\nIN 0\nAND 36 37\nIN 1\nIN 0\nIN 1\nNOT 47\nAND 52 49\nOR 44 35\nIN 0\nIN 1\nAND 33 56\nIN 0\nIN 0\nIN 0\nAND 31 41\nOR 15 3\nOR 43 46\nIN 1\nXOR 22 28\nIN 1\nIN 1\nIN 1\nAND 34 21\nIN 0\nIN 1\nIN 0\nXOR 51 23\nXOR 10 54\nOR 57 40\nIN 0\nNOT 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\nGiven an array of integers, find...
[{"input": "[20, 1, -1, 2, -2, 3, 3, 5, 5, 1, 2, 4, 20, 4, -1, -2, 5]", "output": "[5]", "fn_name": "find_it"}, {"input": "[20, 1, 1, 2, 2, 3, 3, 5, 5, 4, 20, 4, 5]", "output": "[5]", "fn_name": "find_it"}, {"input": "[1, 1, 2, -2, 5, 2, 4, 4, -1, -2, 5]", "output": "[-1]", "fn_name": "find_it"}, {"input": "[1, 1, 1, 1...
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 known that passages in Sin...
[{"type": "stdin_stdout", "input": "181\n", "output": "421742777\n"}, {"type": "stdin_stdout", "input": "261\n", "output": "952127278\n"}, {"type": "stdin_stdout", "input": "121\n", "output": "631667314\n"}, {"type": "stdin_stdout", "input": "351\n", "output": "625447969\n"}, {"type": "stdin_stdout", "input": "141\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\nThis morning, Roman woke up and ...
[{"type": "stdin_stdout", "input": "100 47\n-1 1 -1 -1 -1 -1 -1 1 -1 -1 -1 1 -1 1 1 1 1 -1 -1 1 1 -1 -1 -1 -1 -1 -1 1 -1 -1 1 1 -1 -1 -1 1 1 -1 1 -1 1 1 -1 -1 -1 -1 1 1 1 -1 -1 1 -1 -1 -1 1 1 -1 -1 1 1 -1 1 -1 -1 -1 -1 1 -1 -1 1 -1 -1 -1 -1 1 -1 1 1 1 1 1 1 -1 1 1 -1 1 -1 -1 -1 1 -1 -1 1 1 -1 -1 1 -1\n", "output": "19\...
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 particularly well-known fact...
[{"type": "stdin_stdout", "input": "10 9\n2 3\n6 8\n10 1\n1 8\n6 7\n8 7\n10 5\n7 10\n2 5\n", "output": "no\n"}, {"type": "stdin_stdout", "input": "10 9\n2 3\n6 8\n10 1\n1 8\n6 7\n8 7\n10 5\n7 10\n2 5\n", "output": "no\n"}, {"type": "stdin_stdout", "input": "10 9\n2 3\n6 8\n10 1\n1 8\n6 7\n8 7\n10 5\n7 10\n2 2\n", "outp...
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\nHooray! Berl II, the king of Ber...
[{"type": "stdin_stdout", "input": "11 8\n3 5 5\n8 9 9\n4 6 6\n8 10 10\n5 7 7\n2 7 2\n10 11 11\n1 11 1\n", "output": "0 1 5 5 6 7 2 9 10 11 1 \n"}, {"type": "stdin_stdout", "input": "11 7\n7 8 8\n5 6 5\n1 3 3\n7 9 9\n5 10 10\n10 11 11\n1 11 4\n", "output": "3 3 4 0 10 5 8 9 10 11 4 \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\nTraining is indispensable for ac...
[{"type": "stdin_stdout", "input": "10 22 1 0 4\n1 -1\n59 3", "output": "0.834647\n"}, {"type": "stdin_stdout", "input": "15 17 5 0 1\n1 1\n-1 3", "output": "0.875000\n"}, {"type": "stdin_stdout", "input": "15 22 3 0 1\n0 0\n-1 1", "output": "0.904762\n"}, {"type": "stdin_stdout", "input": "14 22 1 0 1\n0 1\n41 3", "ou...
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\nNew Year is coming in Line World...
[{"type": "stdin_stdout", "input": "120 104\n41 15 95 85 34 11 25 42 65 39 77 80 74 17 66 73 21 14 36 63 63 79 45 24 65 7 63 80 51 21 2 19 78 28 71 2 15 23 17 68 62 18 54 39 43 70 3 46 34 23 41 65 32 10 13 18 10 3 16 48 54 18 57 28 3 24 44 50 15 2 20 22 45 44 3 29 2 27 11 2 12 25 25 31 1 2 32 4 11 30 13 16 26 21 1 13 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\nStudents love to celebrate their...
[{"type": "stdin_stdout", "input": "50 1000 49\n", "output": "YES\n1 1000.000000 2 20.408163 \n2 979.591837 3 40.816327 \n3 959.183673 4 61.224490 \n4 938.775510 5 81.632653 \n5 918.367347 6 102.040816 \n6 897.959184 7 122.448980 \n7 877.551020 8 142.857143 \n8 857.142857 9 163.265306 \n9 836.734694 10 183.673469 \n10 ...
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\nAmericans are odd people: in the...
[{"input": "200", "output": "[198]", "fn_name": "get_real_floor"}, {"input": "12", "output": "[11]", "fn_name": "get_real_floor"}, {"input": "14", "output": "[12]", "fn_name": "get_real_floor"}, {"input": "15", "output": "[13]", "fn_name": "get_real_floor"}, {"input": "37", "output": "[35]", "fn_name": "get_real_floor"...
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\nExample\n\nInput\n\n5\n\n\nOutpu...
[{"type": "stdin_stdout", "input": "304", "output": "10816520\n"}, {"type": "stdin_stdout", "input": "309", "output": "17426472\n"}, {"type": "stdin_stdout", "input": "352", "output": "45765225\n"}, {"type": "stdin_stdout", "input": "227", "output": "1542687\n"}, {"type": "stdin_stdout", "input": "280", "output": "6677...
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\nTavas is a strange creature. Usu...
[{"type": "stdin_stdout", "input": "173700 6\nbcabcbcbcbaaacaccaacaccaabacabaacbcacbbccaccbcacbabcaccccccaacacabbbbbacabbaaacbcbbaccaccabbbbaabbacacbabccaabcabbbcacaaccbabbcaaaaaabccbbcabcacbcbcabcbcbbaabacaaccccabacaaaccacaaabbacacabbcccacbaabcacacbbaaaccaccbaccccccbccaabcacaacabaccababacabcccbcbbacbabacbcbabacbbaccaa...
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 an integer sequenc...
[{"type": "stdin_stdout", "input": "7 26\n10\n20\n30\n43\n30\n20\n10", "output": "13\n"}, {"type": "stdin_stdout", "input": "1 26\n10\n20\n30\n43\n30\n20\n10", "output": "0\n"}, {"type": "stdin_stdout", "input": "1 26\n10\n20\n30\n12\n30\n20\n12", "output": "0\n"}, {"type": "stdin_stdout", "input": "1 26\n10\n20\n27\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\nPolycarp loves ciphers. He has i...
[{"type": "stdin_stdout", "input": "qwertyuioasdfghjklrtyuiodfghjklqwertyuioasdfssddxb\n", "output": "dfogihujyktlrqlwkejrhtgyfudisoaaosidufystsrdedwxqb\n"}, {"type": "stdin_stdout", "input": "qwertyuioasdfghjklrtyuiodfghjklqwertyuioasdfssddxb\n", "output": "dfogihujyktlrqlwkejrhtgyfudisoaaosidufystsrdedwxqb\n"}, {"typ...
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 need to write t...
[{"input": "16\n8", "output": "[false]", "fn_name": "shared_bits"}, {"input": "7\n10", "output": "[false]", "fn_name": "shared_bits"}, {"input": "43\n77", "output": "[true]", "fn_name": "shared_bits"}, {"input": "1\n2", "output": "[false]", "fn_name": "shared_bits"}, {"input": "1\n1", "output": "[false]", "fn_name": "s...
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 is an integer N. Snuke wil...
[{"type": "stdin_stdout", "input": "4\n33\n1\n28\n0111010001", "output": "996765147\n0\n399637805\n501963061\n"}, {"type": "stdin_stdout", "input": "4\n33\n1\n28\n0111110001", "output": "996765147\n0\n399637805\n744953502\n"}, {"type": "stdin_stdout", "input": "4\n24\n2\n30\n0110110001", "output": "192839398\n0\n434820...
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\nMr Leicester's cheese factory is...
[{"input": "[750, 750, 750, 750, 600]", "output": "[\"L1260\"]", "fn_name": "pay_cheese"}, {"input": "[700, 750, 700, 750, 600]", "output": "[\"L1225\"]", "fn_name": "pay_cheese"}, {"input": "[574, 574, 574, 574, 574]", "output": "[\"L1015\"]", "fn_name": "pay_cheese"}, {"input": "[1, 1, 1, 1, 1]", "output": "[\"L35\"]...
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\nImagine that you are in a buildi...
[{"type": "stdin_stdout", "input": "5000 2314 1234 5000\n", "output": "546628648\n"}, {"type": "stdin_stdout", "input": "4988 3629 4106 4488\n", "output": "349016655\n"}, {"type": "stdin_stdout", "input": "5000 1031 4782 5000\n", "output": "981271392\n"}, {"type": "stdin_stdout", "input": "5000 4998 5000 5000\n", "outp...
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 rgb function is incomplete. ...
[{"input": "255\n255\n255", "output": "[\"FFFFFF\"]", "fn_name": "rgb"}, {"input": "254\n253\n252", "output": "[\"FEFDFC\"]", "fn_name": "rgb"}, {"input": "-20\n275\n125", "output": "[\"00FF7D\"]", "fn_name": "rgb"}, {"input": "0\n0\n0", "output": "[\"000000\"]", "fn_name": "rgb"}, {"input": "1\n2\n3", "output": "[\"01...
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 has built his own web s...
[{"type": "stdin_stdout", "input": "5\nabacaba\nzyxaabcaabkjh\nonetwothree\nthreetwoone\none\nzzonneyy\none\nnone\ntwenty\nten\n", "output": "YES\nYES\nNO\nYES\nNO\n"}, {"type": "stdin_stdout", "input": "5\nabacaba\nzyxaabcaabkjh\nonetwothree\nthreetwoone\none\nzzonneyy\neno\nnone\ntwenty\nten\n", "output": "YES\nYES\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\nRoma is playing a new expansion ...
[{"type": "stdin_stdout", "input": "10 10 10\n51 87\n68 600\n82 1284\n33 936\n55 242\n89 1990\n58 357\n66 666\n62 512\n51 87\n92 1670\n56 280\n56 280\n91 1631\n77 1091\n89 1554\n61 473\n98 1901\n77 1091\n77 1091\n86 15 759\n43 58 386\n68 33 386\n39 62 386\n95 6 386\n74 27 386\n94 7 386\n17 36 386\n105 4 386\n45 56 386\...
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\nTanya wants to go on a journey a...
[{"type": "stdin_stdout", "input": "10\n10 60 12 13 14 15 16 66 18 130\n", "output": "130\n"}, {"type": "stdin_stdout", "input": "10\n10 60 12 13 14 15 16 66 18 130\n", "output": "130\n"}, {"type": "stdin_stdout", "input": "10\n8 60 12 13 14 15 16 66 18 130\n", "output": "130\n"}, {"type": "stdin_stdout", "input": "9\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\nYou are given an integer sequenc...
[{"type": "stdin_stdout", "input": "100\n3142445 16266949 17493698 35569790 80507149 98771888 109205766 111818374 116565925 119183522 141425056 157086378 180302992 187469083 216070266 233105051 257048184 265553444 273526101 281450237 289171706 301768399 311455945 319497119 326729809 338683702 339701654 346802542 353453...
code_stdio