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\nValery is very interested in mag...
[{"type": "stdin_stdout", "input": "150\n0 -2 1 -2 0 0 0 0 -2 0 -2 -1 0 0 2 0 1 -2 1 -1 0 0 0 2 -2 2 -1 0 0 -1 -2 0 2 0 1 0 -2 0 -2 -1 0 -2 -2 2 0 0 1 -2 -2 -1 -2 0 2 1 1 -1 1 0 -2 2 0 0 0 1 -1 0 -2 -1 0 -2 1 1 1 0 0 2 0 0 2 -1 0 0 2 0 2 0 -2 -1 1 -2 1 0 0 -2 -1 -1 0 0 2 -1 -1 -1 -1 -2 0 0 2 -1 -1 1 0 0 1 -1 0 0 -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\nJabber ID on the national Berlan...
[{"type": "stdin_stdout", "input": "IGsma3L6YTJRrXS@1g.yR3mC.c.xoCns7Wo1.9C.Oe.5ebkR/_97Ltj3\n", "output": "YES\n"}, {"type": "stdin_stdout", "input": "IGsma3K6YTJRrXS@1g.yR3mC.c.xoCns7Wo1.9C.Oe.5ebkR/_97Ltj3\n", "output": "YES\n"}, {"type": "stdin_stdout", "input": "POTjlYcxAZsbyZPDh@sPm.z6aVaO.H1wEUhD9YvROQFUk/M_jTHS...
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 has a fair N-sided die tha...
[{"type": "stdin_stdout", "input": "10000 100000\n", "output": "0.036463721466\n"}, {"type": "stdin_stdout", "input": "3904 16384\n", "output": "0.081316166237\n"}, {"type": "stdin_stdout", "input": "100000 5\n", "output": "0.999973749998\n"}, {"type": "stdin_stdout", "input": "97392 33\n", "output": "0.999781007423\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\nOh, New Year. The time to gather...
[{"type": "stdin_stdout", "input": "10\n10 7 10 10 7 10 7 7 10 10\n", "output": "2 6\n"}, {"type": "stdin_stdout", "input": "10\n10 7 10 10 7 10 7 7 10 10\n", "output": "2 6\n"}, {"type": "stdin_stdout", "input": "10\n10 7 10 10 7 10 7 5 10 10\n", "output": "2 7\n"}, {"type": "stdin_stdout", "input": "10\n1 2 3 4 5 6 7...
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# Rock Paper Scissors\n\nLet's p...
[{"input": "\"scissors\"\n\"paper\"", "output": "[\"Player 1 won!\"]", "fn_name": "rps"}, {"input": "\"paper\"\n\"scissors\"", "output": "[\"Player 2 won!\"]", "fn_name": "rps"}, {"input": "\"rock\"\n\"scissors\"", "output": "[\"Player 1 won!\"]", "fn_name": "rps"}, {"input": "\"scissors\"\n\"rock\"", "output": "[\"Pla...
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 a string (`str`) containin...
[{"input": "\"8192\"", "output": "[\"Thirteen\"]", "fn_name": "max_consec_zeros"}, {"input": "\"2048\"", "output": "[\"Eleven\"]", "fn_name": "max_consec_zeros"}, {"input": "\"4096\"", "output": "[\"Twelve\"]", "fn_name": "max_consec_zeros"}, {"input": "\"6144\"", "output": "[\"Eleven\"]", "fn_name": "max_consec_zeros"...
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\nYou are given a text that consis...
[{"type": "stdin_stdout", "input": "ajdwlf ibvlfqadt sqdn aoj nsjtivfrsp !mquqfgzrbp w ow aydap ry s . jwlvg ? ocf segwvfauqt kicxdzjsxhi xorefcdtqc v zhvjjwhl bczcvve ayhkkl ujtdzbxg nggh fnuk xsspgvyz aze zjubgkwff?hgj spteldqbdo vkxtgnl uxckibqs vpzeaq roj ...
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": "3 1 1 2 3 110\n49\n50\n51", "output": "53.6666666667\n"}, {"type": "stdin_stdout", "input": "3 0 1 2 3 100\n49\n50\n74", "output": "48.8333333333\n"}, {"type": "stdin_stdout", "input": "3 1 2 2 3 100\n49\n50\n51", "output": "47.6666666667\n"}, {"type": "stdin_stdout", "input": "3 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\nYou are planning to buy an apart...
[{"type": "stdin_stdout", "input": "10 2\n7 6 15 6 16 18 2 17 17\n12 11 3 10 9 1 10 1 5\n", "output": "0 7 13 18 24 35 36 38 41 46\n"}, {"type": "stdin_stdout", "input": "10 2\n7 6 18 6 16 18 1 17 17\n6 9 3 10 9 1 10 1 5\n", "output": "0 7 13 18 24 35 36 37 40 45 \n"}, {"type": "stdin_stdout", "input": "10 2\n7 6 18 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\nHow many ways are there to choos...
[{"type": "stdin_stdout", "input": "3256265", "output": "1628132\n"}, {"type": "stdin_stdout", "input": "1527191", "output": "763595\n"}, {"type": "stdin_stdout", "input": "1743342", "output": "871670\n"}, {"type": "stdin_stdout", "input": "1412384", "output": "706191\n"}, {"type": "stdin_stdout", "input": "1339977", "...
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\nBerland is going through tough t...
[{"type": "stdin_stdout", "input": "100\n-683 303 245 -975 345 -159 529 -752 -349 -318 -275 -62 -449 -601 -687 691 491 -261 -576 425 -468 -235 446 536 143 152 -402 -491 363 -842 676 360 -461 -170 727 53 10 823 665 716 110 450 -154 -265 -926 636 -577 99 -719 -786 373 -286 994 -756 644 -800 220 -771 860 610 -613 -51 -398...
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 players are playing a game. ...
[{"type": "stdin_stdout", "input": "2 5\n", "output": "3 0 3\n"}, {"type": "stdin_stdout", "input": "2 4\n", "output": "2 1 3\n"}, {"type": "stdin_stdout", "input": "5 3\n", "output": "2 1 3\n"}, {"type": "stdin_stdout", "input": "1 6\n", "output": "3 0 3\n"}, {"type": "stdin_stdout", "input": "5 1\n", "output": "3 1 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\nIn number world, two different n...
[{"type": "stdin_stdout", "input": "100\n42 486 341 527 189 740 490 388 989 489 711 174 305 844 971 492 998 954 832 442 424 619 906 154 293 395 439 735 738 915 453 748 786 550 871 932 693 326 53 904 732 835 354 364 691 669 203 719 282 875 573 672 695 640 58 872 732 751 557 779 102 39 213 844 289 137 50 951 284 671 474 ...
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 best night ever in the world...
[{"type": "stdin_stdout", "input": "3 2 1\n0 1 1\n1 2 3\n1\n4 5 2\n0 1 1\n0 2 1\n1 2 1\n1 3 1\n2 3 2\n1\n2\n0 -1 0", "output": "1.000000000\n\n1.000000000\n0.000000000\n\n"}, {"type": "stdin_stdout", "input": "3 2 1\n0 1 2\n1 2 3\n1\n4 5 2\n0 1 1\n0 2 1\n1 2 1\n1 3 1\n2 3 1\n1\n2\n0 0 1", "output": "1.000000000\n\n0.50...
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 Mand...
[{"type": "stdin_stdout", "input": "4\n1 -1 12 11", "output": "12\n"}, {"type": "stdin_stdout", "input": "4\n1 -2 12 11", "output": "11\n"}, {"type": "stdin_stdout", "input": "4\n-1 -1 0 36", "output": "17\n"}, {"type": "stdin_stdout", "input": "4\n-2 -2 0 36", "output": "16\n"}, {"type": "stdin_stdout", "input": "4\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 array $a$ consi...
[{"type": "stdin_stdout", "input": "6\n10000100623 10000100623 10000100623 10000100623 10000100623 10000100623\n", "output": "2\n"}, {"type": "stdin_stdout", "input": "6\n10000100623 10000100623 10000100623 10000100623 10000100623 10000100623\n", "output": "2\n"}, {"type": "stdin_stdout", "input": "5\n153965681607 9999...
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\nCount the number of distinct seq...
[{"type": "stdin_stdout", "input": "495219 444706662\n", "output": "115165527\n"}, {"type": "stdin_stdout", "input": "495219 444706662\n", "output": "115165527\n"}, {"type": "stdin_stdout", "input": "1000000000 1000000000\n", "output": "1\n"}, {"type": "stdin_stdout", "input": "9357 18255507\n", "output": "745979764\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 is a grid with N rows and ...
[{"type": "stdin_stdout", "input": "176527 15\n1 81279\n2 22308\n2 133061\n1 80744\n2 44603\n1 170938\n2 139754\n2 15220\n1 172794\n1 159290\n2 156968\n1 56426\n2 77429\n1 97459\n2 71282\n", "output": "31159505795\n"}, {"type": "stdin_stdout", "input": "176527 15\n2 81279\n2 22308\n2 145342\n1 106634\n2 60988\n1 170938...
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\nWorking from left-to-right if no...
[{"input": "0.75", "output": "[3088]", "fn_name": "bouncy_ratio"}, {"input": "0.9", "output": "[21780]", "fn_name": "bouncy_ratio"}, {"input": "0.15", "output": "[160]", "fn_name": "bouncy_ratio"}, {"input": "0.1", "output": "[132]", "fn_name": "bouncy_ratio"}, {"input": "0.5", "output": "[538]", "fn_name": "bouncy_rat...
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 an apple tree that bear...
[{"type": "stdin_stdout", "input": "3\n000000\n24912\n20652", "output": "second\n"}, {"type": "stdin_stdout", "input": "3\n100000\n30000\n29639", "output": "first\n"}, {"type": "stdin_stdout", "input": "3\n000000\n30000\n29639", "output": "first\n"}, {"type": "stdin_stdout", "input": "3\n000001\n30000\n29639", "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 will be given a contest sche...
[{"type": "stdin_stdout", "input": "5\n86 90 69 51 2 96 71 47 88 34 45 46 89 34 31 38 97 84 41 80 14 4 50 83 7 82\n19771 12979 18912 10432 10544 12928 13403 3047 10527 9740 8100 92 2856 14730 1396 15905 6534 4650 11469 3628 8433 2994 10899 16396 18355 11424\n6674 17707 13855 16407 12232 2886 11908 1705 5000 1537 10440 ...
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\nThese days Arkady works as an ai...
[{"type": "stdin_stdout", "input": "66 20\n0 16\n0 45\n0 58\n1 6\n1 19\n2 7\n2 9\n3 9\n3 25\n3 57\n4 38\n4 58\n5 21\n5 40\n6 16\n6 19\n6 58\n7 6\n7 26\n7 51\n8 13\n8 36\n8 55\n9 1\n9 15\n9 33\n10 12\n10 37\n11 15\n11 34\n12 8\n12 37\n12 55\n13 26\n14 0\n14 34\n14 36\n14 48\n15 23\n15 29\n15 43\n16 8\n16 41\n16 45\n17 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\n# Definition\n\n**_Disarium numb...
[{"input": "2646798", "output": "[\"Disarium !!\"]", "fn_name": "disarium_number"}, {"input": "1306", "output": "[\"Disarium !!\"]", "fn_name": "disarium_number"}, {"input": "2427", "output": "[\"Disarium !!\"]", "fn_name": "disarium_number"}, {"input": "1048576", "output": "[\"Not !!\"]", "fn_name": "disarium_number"}...
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\nLet’s get to know our hero: Agen...
[{"input": "\"ksdjai8983hdk?}{\"\n15", "output": "[\"zHsypx8983wsz?}{\"]", "fn_name": "caesar_crypto_encode"}, {"input": "\"eBIIL TLOIA!\"\n-127", "output": "[\"Hello world!\"]", "fn_name": "caesar_crypto_encode"}, {"input": "\"Hello world!\"\n127", "output": "[\"eBIIL TLOIA!\"]", "fn_name": "caesar_crypto_encode"}, {"...
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\nFor long time scientists study t...
[{"type": "stdin_stdout", "input": "127\n64 96 63 112 62 95 61 120 60 94 59 111 58 93 57 124 56 92 55 110 54 91 53 119 52 90 51 109 50 89 49 126 48 88 47 108 46 87 45 118 44 86 43 107 42 85 41 123 40 84 39 106 38 83 37 117 36 82 35 105 34 81 33 127 32 80 31 104 30 79 29 116 28 78 27 103 26 77 25 122 24 76 23 102 22 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\nA linear congruential generator ...
[{"type": "stdin_stdout", "input": "5\n0 1 3 11 0\n5\n-1 12 2 0 7\n10\n46 2 28 27 203 31 14 81 122 141\n0", "output": "9 15 10\n6 11 13\n6 13 6\n"}, {"type": "stdin_stdout", "input": "5\n10 4 3 3 1\n5\n7 12 2 0 7\n10\n372 8 42 18 176 40 12 56 169 141\n0", "output": "0 1 1\n6 11 13\n0 15 15\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\nMany internet protocols these da...
[{"type": "stdin_stdout", "input": "3 7\nhtml lmth/txft\nlht text/itml\ngnp image/png\nsug lmx+gvt/ehami\ntxt text/plajn\nindex.html\nthis.file.has.lots.of.dots.txt\nnoaotsdsall\nvires.uxe\ndont.let.the.png.fool.you\ncXT.trettam.esaT", "output": "unknown\nunknown\nlmth/txft\nunknown\nunknown\nunknown\nunknown\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\nOur brave travelers reached an i...
[{"type": "stdin_stdout", "input": "20 20\n####################\n############.####.##\n#######..####..#####\n######............##\n######.....#...###.#\n#####E..........##.#\n#.##.#.........#####\n##NR....KO.....#####\n##B........#...#####\n#Y.W...H.......#####\n#####Z.....#...#####\n######...#.#...#####\n#A.......#.#....
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\nSince the giant heads have appea...
[{"type": "stdin_stdout", "input": "100 50\n2 62 -62\n2 19 -19\n2 38 -38\n2 -84 84\n2 -16 16\n2 67 -67\n2 41 -41\n2 -32 32\n2 32 -32\n2 -62 62\n2 89 -89\n2 -84 84\n2 96 -96\n2 -11 11\n2 59 -59\n2 -13 13\n2 -70 70\n2 -3 3\n2 -41 41\n2 -74 74\n2 47 -47\n2 87 -87\n2 17 -17\n2 20 -20\n2 -14 14\n2 -67 67\n2 -95 95\n2 -15 15...
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\nEvery Turkish citizen has an ide...
[{"input": "\"x5810a78432\"", "output": "[false]", "fn_name": "check_valid_tr_number"}, {"input": "\"03868894286\"", "output": "[false]", "fn_name": "check_valid_tr_number"}, {"input": "692352217312", "output": "[false]", "fn_name": "check_valid_tr_number"}, {"input": "12762438338", "output": "[false]", "fn_name": "che...
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\nMakoto has a big blackboard with...
[{"type": "stdin_stdout", "input": "1000000000000000 10000\n", "output": "215514159\n"}, {"type": "stdin_stdout", "input": "1000000000000000 10000\n", "output": "215514159\n"}, {"type": "stdin_stdout", "input": "1000000000001000 10000\n", "output": "150774797\n"}, {"type": "stdin_stdout", "input": "1172768550854780 899...
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\nLife is not easy. Sometimes it i...
[{"type": "stdin_stdout", "input": "1\nnorth\n3\nnorth\neasu\nsouth\n0", "output": "5\n1\n"}, {"type": "stdin_stdout", "input": "1\nnorth\n0\nnorth\ntsae\nosuth\n-1", "output": "5\n"}, {"type": "stdin_stdout", "input": "1\nnorth\n0\nmorth\ntsae\nosuth\n-1", "output": "5\n"}, {"type": "stdin_stdout", "input": "1\nnorth\...
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\nNikolay has only recently starte...
[{"type": "stdin_stdout", "input": "25\n5 1 1\n5 2 3\n5 5 5\n5 5 1\n5 4 4\n10 1 2\n10 3 7\n10 10 10\n10 3 1\n10 7 6\n1000000 21232 1234\n999999 999999 999999\n1000000 300001 966605\n1000000 290001 679121\n500000 111099 123456\n100 1 1\n1000000000 1 1000000000\n1000000000 1 500000000\n100000000 1 12345678\n1000000000 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\nIt's the fourth quater of the Su...
[{"input": "[[3, \"run\"], [3, \"run\"], [3, \"run\"], [10, \"turnover\"]]", "output": "[false]", "fn_name": "did_we_win"}, {"input": "[[10, \"run\"], [10, \"sack\"], [10, \"pass\"], [1, \"sack\"]]", "output": "[false]", "fn_name": "did_we_win"}, {"input": "[[5, \"pass\"], [5, \"pass\"], [10, \"sack\"], [10, \"run\"]]"...
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 C: Earn Big\n\nA group o...
[{"type": "stdin_stdout", "input": "110 50", "output": "0.224802593637\n"}, {"type": "stdin_stdout", "input": "010 50", "output": "1.000000000000\n"}, {"type": "stdin_stdout", "input": "110 89", "output": "0.789224893493\n"}, {"type": "stdin_stdout", "input": "110 12", "output": "0.000000001745\n"}, {"type": "stdin_std...
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\nSince Grisha behaved well last y...
[{"type": "stdin_stdout", "input": "1000000000000000000 1000000000000000000\n", "output": "1152921504606846975\n"}, {"type": "stdin_stdout", "input": "1100000000000000000 1000000000000000000\n", "output": "1152921504606846975\n"}, {"type": "stdin_stdout", "input": "1100000000010000000 1000000000000000000\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 an undirected grap...
[{"type": "stdin_stdout", "input": "13 23\nABAAAABBBBAAB\n7 1\n10 6\n1 11\n2 10\n2 8\n2 11\n11 12\n8 3\n7 11\n11 2\n13 13\n11 9\n4 1\n9 7\n9 6\n8 13\n8 6\n4 10\n8 7\n4 3\n2 1\n8 12\n6 9", "output": "Yes\n"}, {"type": "stdin_stdout", "input": "13 23\nABAAAABBBBAAB\n7 1\n10 6\n1 11\n2 10\n2 8\n2 11\n11 12\n8 3\n7 12\n11 ...
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 takes a n...
[{"input": "54", "output": "[[54, 27, 18, 9, 6, 3, 2, 1]]", "fn_name": "factors"}, {"input": "\"hello world\"", "output": "[-1]", "fn_name": "factors"}, {"input": "49", "output": "[[49, 7, 1]]", "fn_name": "factors"}, {"input": "-12", "output": "[-1]", "fn_name": "factors"}, {"input": "\"a\"", "output": "[-1]", "fn_nam...
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\nAtCoDeer has three cards, one re...
[{"type": "stdin_stdout", "input": "4 3 2\n", "output": "YES\n"}, {"type": "stdin_stdout", "input": "2 3 4\n", "output": "NO\n"}, {"type": "stdin_stdout", "input": "7 3 2", "output": "YES\n"}, {"type": "stdin_stdout", "input": "7 6 0", "output": "YES\n"}, {"type": "stdin_stdout", "input": "2 6 0", "output": "YES\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 some village, there are 999 t...
[{"type": "stdin_stdout", "input": "290178 291177\n", "output": "208323\n"}, {"type": "stdin_stdout", "input": "336594 337545\n", "output": "115131\n"}, {"type": "stdin_stdout", "input": "124075 124692\n", "output": "65961\n"}, {"type": "stdin_stdout", "input": "82747 83560\n", "output": "247331\n"}, {"type": "stdin_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\nIn the popular spreadsheets syst...
[{"type": "stdin_stdout", "input": "10\nR50C12\nR23C47\nY96\nR44C13\nR19C21\nR95C73\nBK12\nR51C74\nAY34\nR63C25\n", "output": "L50\nAU23\nR96C25\nM44\nU19\nBU95\nR12C63\nBV51\nR34C51\nY63\n"}, {"type": "stdin_stdout", "input": "10\nR50C12\nR23C47\nY96\nR44C13\nR19C21\nR95C73\nBK12\nR51C74\nAY34\nR62C25\n", "output": "L...
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're given Q queries of the fo...
[{"type": "stdin_stdout", "input": "20\n862 928\n758 964\n541 789\n622 943\n328 900\n14 764\n217 1554\n461 847\n442 468\n544 1157\n518 529\n938 993\n620 851\n690 944\n484 601\n320 910\n98 1355\n816 794\n765 880\n551 1280\n", "output": "1\n4\n5\n6\n14\n32\n30\n9\n0\n12\n1\n1\n5\n4\n4\n15\n35\n0\n2\n13\n"}, {"type": "std...
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\nPlay by arranging whi...
[{"type": "stdin_stdout", "input": "8\n1\n0\n0\n0\n1\n0\n0\n0\n4\n1\n-1\n0\n1\n1\n1\n1\n1\n0", "output": "8\n0\n0\n0\n"}, {"type": "stdin_stdout", "input": "8\n1\n1\n0\n1\n0\n0\n0\n1\n4\n1\n0\n0\n1\n1\n0\n1\n1\n0", "output": "0\n0\n1\n0\n"}, {"type": "stdin_stdout", "input": "8\n1\n1\n1\n1\n0\n-1\n0\n1\n3\n1\n0\n1\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\nAfter the contest in comparing n...
[{"type": "stdin_stdout", "input": "Iran_\nPersian;\nW_o;n;d;e;r;f;u;l;\n7\nWonderfulPersianIran\nwonderful_PersIAN_IRAN;;_\nWONDERFUL___IRAN__PERSIAN__;;\nIra__Persiann__Wonderful\nWonder;;fulPersian___;I;r;a;n;\n__________IranPersianWonderful__________\nPersianIran_is_Wonderful\n", "output": "ACC\nACC\nACC\nWA\nACC\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\nBased on the information of the ...
[{"type": "stdin_stdout", "input": "10\n3\n6 11\n12 15\n18 22\n14\n2\n6 14\n13 20\n0", "output": "OK\nOK\n"}, {"type": "stdin_stdout", "input": "10\n3\n6 11\n12 15\n34 22\n14\n2\n6 14\n13 20\n0", "output": "14\nOK\n"}, {"type": "stdin_stdout", "input": "10\n3\n20 11\n2 15\n34 22\n13\n2\n4 14\n13 33\n0", "output": "18\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\nBerland has n cities connected b...
[{"type": "stdin_stdout", "input": "10 45\n3 5\n2 3\n4 8\n2 5\n6 8\n10 7\n2 1\n3 7\n5 10\n6 1\n9 8\n3 1\n2 10\n6 7\n1 7\n7 9\n6 9\n9 3\n4 2\n2 6\n5 6\n5 8\n3 4\n10 8\n7 8\n4 6\n9 1\n5 5\n7 4\n1 10\n9 2\n2 8\n6 10\n9 8\n1 5\n7 2\n10 3\n3 8\n2 10\n1 1\n10 7\n1 3\n1 8\n10 2\n4 10\n", "output": "0\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\nOpen Binary and Object Group org...
[{"type": "stdin_stdout", "input": "9\n-1 1\n0 1\n1 1\n-1 0\n0 0\n1 0\n-1 -1\n0 -2\n1 -1", "output": "No\n"}, {"type": "stdin_stdout", "input": "9\n-1 1\n0 1\n1 1\n-1 0\n0 0\n1 0\n-1 -1\n0 -1\n1 -1", "output": "No"}, {"type": "stdin_stdout", "input": "4\n0 1\n1 -1\n0 -1\n1 1", "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\nAs you could know there are no m...
[{"type": "stdin_stdout", "input": "100\n25 6 46 37 87 99 70 31 46 12 94 40 87 56 28 14 94 39 13 12 67 13 71 39 83 48 40 14 62 41 16 71 20 41 83 41 68 98 23 82 62 83 62 35 49 22 31 21 66 98 54 39 34 52 11 28 47 89 25 44 68 36 91 46 82 86 88 48 27 93 7 9 53 36 16 100 84 84 44 25 58 66 16 46 72 21 91 78 4 17 44 17 47 67 ...
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\nThree swimmers decided to organi...
[{"type": "stdin_stdout", "input": "10\n992222955174044630 49635415 8474 173727148\n618311281854681640 657834994 40173216 75996939\n710602478618400425 332897175 71490165 534449640\n768753872531302819 113476460 449 799174641\n633188994852953277 834175592 3132 788542124\n964246686346975322 539872840 295075 782348226\n683...
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 will be a launch of a new,...
[{"type": "stdin_stdout", "input": "30\nRLLRLRLLRRRLRRRLLLLLLRRRLRRLRL\n128 610 1680 2436 2896 2994 3008 3358 3392 4020 4298 4582 4712 4728 5136 5900 6088 6232 6282 6858 6934 7186 7224 7256 7614 8802 8872 9170 9384 9794\n", "output": "7\n"}, {"type": "stdin_stdout", "input": "30\nRLLRLRLLRRRLRRRLLLLLLRRRLRRLRL\n128 610...
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$ of $n...
[{"type": "stdin_stdout", "input": "1\n88 38\n9 143 135 72 74 12 120 27 108 183 18 24 163 122 140 155 166 188 197 14 134 66 188 161 79 100 40 55 161 118 121 18 72 141 136 31 39 187 2 98 16 118 120 196 127 66 135 186 49 16 17 50 107 192 50 23 62 110 83 124 197 127 185 129 131 182 45 147 174 115 89 109 177 7 70 43 75 5 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\nHeiankyo is known as a town with...
[{"type": "stdin_stdout", "input": "4\n0 2\n0\n1 2\n2\n0 0 0 1\n0 0 1 0\n4 0\n4\n1 0 0 0\n3 5 2 3\n4 0 4 0\n0 2 0 4\n15 5\n0", "output": "1\nMiserable Hokusai!\nMiserable Hokusai!\n15504\n"}, {"type": "stdin_stdout", "input": "4\n2 2\n0\n1 2\n2\n0 0 0 1\n0 0 1 0\n4 0\n4\n1 0 0 0\n3 3 2 3\n4 0 4 0\n0 2 0 3\n15 3\n0", "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\nDo you know \"sed,\" a tool prov...
[{"type": "stdin_stdout", "input": "2\na bb\nb aa\nb\nbbbbbbbb\n1\nb aa\nb\naaaaa\n3\nbb aab\nabc aadc\nad dee\nabc\ndeeeeeeeec\n10\na acb\nb bai\nc acf\nd bec\ne bbh\nf fag\ng abe\nh bag\ni aaj\nj bbb\na\nabaceaabe\n0", "output": "-1\n-1\n-1\n-1\n"}, {"type": "stdin_stdout", "input": "2\na bb\nb aa\nb\nbbbbbbbb\n1\nb ...
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\nTop-model Izabella participates ...
[{"type": "stdin_stdout", "input": "1111111111101111111111111111111111111011111111111111111111111101111011111101111111111101111111111111\n", "output": "yes\n"}, {"type": "stdin_stdout", "input": "0110111111111111111111011111111110110111110111111111111111111111111111111111111110111111111111111111\n", "output": "yes\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\nSo the Beautiful Regional Contes...
[{"type": "stdin_stdout", "input": "5\n12\n5 4 4 3 2 2 1 1 1 1 1 1\n4\n4 3 2 2\n1\n1000100\n20\n20 19 18 17 16 15 14 13 15 11 10 9 8 7 6 5 4 3 2 1\n32\n125 64 63 58 58 58 58 58 37 37 37 37 34 34 28 28 28 28 28 28 24 24 19 17 17 17 17 16 16 16 16 11\n", "output": "1 2 3\n0 0 0\n0 0 0\n1 2 7\n1 2 11\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\nRead problems statements in Mand...
[{"type": "stdin_stdout", "input": "5\nccade\nbddcc", "output": "3\n"}, {"type": "stdin_stdout", "input": "5\nccade\nccdcb", "output": "0\n"}, {"type": "stdin_stdout", "input": "5\nddacc\nbddcc", "output": "1\n"}, {"type": "stdin_stdout", "input": "5\nddacc\nccddb", "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\nRead problems statements in Mand...
[{"type": "stdin_stdout", "input": "2\n6 3\n1 4 14 4 11\n5 2\n-1 2 0 14 4", "output": "no\nno\n"}, {"type": "stdin_stdout", "input": "2\n6 3\n1 4 14 4 11\n5 4\n-1 2 0 14 4", "output": "no\nno\n"}, {"type": "stdin_stdout", "input": "2\n5 3\n1 2 14 4 11\n5 2\n-1 2 0 8 7", "output": "no\nno\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\nCodehorses has just hosted the s...
[{"type": "stdin_stdout", "input": "43\nL\nXXXL\nM\nXS\nL\nXXL\nS\nL\nM\nXXXL\nXXS\nS\nXS\nS\nXS\nXL\nXXL\nXXL\nXS\nXXS\nXXL\nL\nXXXL\nL\nL\nXXL\nXXL\nM\nXXXS\nM\nXXL\nXXXS\nXXXL\nXXS\nL\nL\nXS\nL\nXS\nXS\nL\nXXL\nM\nXXXL\nXXL\nXXL\nXL\nL\nXS\nM\nXL\nXXXS\nXXXS\nS\nXXL\nXXXL\nXXL\nXS\nXXS\nL\nS\nXXXS\nXL\nL\nXL\nXXXS\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\n# Description\n\"It's the end of...
[{"input": "[17, 20, 50, 61, 42, 44]", "output": "[132]", "fn_name": "candies"}, {"input": "[1, 2, 4, 6]", "output": "[11]", "fn_name": "candies"}, {"input": "[1, 3, 3, 7]", "output": "[14]", "fn_name": "candies"}, {"input": "[5, 8, 6, 4]", "output": "[9]", "fn_name": "candies"}, {"input": "[7, 7, 7, 7]", "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\nEverybody knows the classic [\"h...
[{"input": "17", "output": "[\"15-20\"]", "fn_name": "dating_range"}, {"input": "40", "output": "[\"27-66\"]", "fn_name": "dating_range"}, {"input": "15", "output": "[\"14-16\"]", "fn_name": "dating_range"}, {"input": "35", "output": "[\"24-56\"]", "fn_name": "dating_range"}, {"input": "53", "output": "[\"33-92\"]", "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\nThis time the Berland Team Olymp...
[{"type": "stdin_stdout", "input": "1 1000000000 1000000000\n100000\n", "output": " 0"}, {"type": "stdin_stdout", "input": "5 3 2\n1 1 2 1 1\n", "output": " 7"}, {"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\nE869120 has A 1-yen coins and in...
[{"type": "stdin_stdout", "input": "2018\n218\n", "output": "Yes\n"}, {"type": "stdin_stdout", "input": "2018\n113", "output": "Yes\n"}, {"type": "stdin_stdout", "input": "2018\n111", "output": "Yes\n"}, {"type": "stdin_stdout", "input": "2018\n101", "output": "Yes\n"}, {"type": "stdin_stdout", "input": "2018\n100", "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\nThere is a square grid of size $...
[{"type": "stdin_stdout", "input": "1000 24\n190 39 552 958\n539 146 763 587\n31 526 423 673\n208 432 953 442\n263 69 719 635\n162 428 623 797\n49 126 94 963\n749 623 979 919\n190 461 367 855\n211 240 939 914\n169 80 336 203\n684 546 829 582\n80 218 324 327\n560 452 656 637\n316 534 982 642\n521 634 758 686\n514 324 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\nAuction\n\nsquare1001 You were w...
[{"type": "stdin_stdout", "input": "5\n-1 -1 -2 -2 3", "output": "4\n5\n"}, {"type": "stdin_stdout", "input": "5\n-1 -1 -3 -2 3", "output": "3\n5\n"}, {"type": "stdin_stdout", "input": "5\n-1 -1 -3 -1 3", "output": "3\n5\n"}, {"type": "stdin_stdout", "input": "5\n-1 -1 -6 -1 3", "output": "3\n5\n"}, {"type": "stdin_std...
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\nDevu is a renowned classical sin...
[{"type": "stdin_stdout", "input": "100 6000\n41 31 23 17 24 78 26 96 93 48 46 2 49 33 35 9 73 100 34 48 83 36 33 69 43 24 3 74 8 81 27 33 94 38 77 9 76 90 62 90 21 67 22 22 12 2 17 27 102 18 72 85 59 65 71 38 90 75 74 66 60 47 58 50 90 95 75 10 5 100 97 29 83 88 65 26 93 90 22 98 36 55 70 38 50 92 88 72 99 96 25 14 74...
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 $2022$ year, Mike found t...
[{"type": "stdin_stdout", "input": "5\n1\n0\n3\n011\n3\n110\n6\n111000\n6\n001011\n", "output": "\n1\n110\n100\n101101\n101110\n"}, {"type": "stdin_stdout", "input": "5\n1\n0\n3\n011\n3\n110\n6\n111000\n6\n001011\n", "output": "1\n110\n100\n101101\n101110\n"}, {"type": "stdin_stdout", "input": "5\n1\n0\n3\n011\n3\n110\...
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 a simplified penalty ph...
[{"type": "stdin_stdout", "input": "4\n1001???0?1\n1111111111\n??????????\n0100001000\n", "output": "8\n10\n6\n10\n"}, {"type": "stdin_stdout", "input": "4\n1?0???1001\n1111111111\n??????????\n0000000000\n", "output": "7\n10\n6\n10\n"}, {"type": "stdin_stdout", "input": "4\n1001?1?0??\n0111111011\n??????????\n110001100...
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 $a$ of length $n$...
[{"type": "stdin_stdout", "input": "1\n40 39\n1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000...
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 has a string S consist...
[{"type": "stdin_stdout", "input": "a\n6\n2 2 a\n2 1 b\n1\n2 2 c\n1\n1\n", "output": "aabc\n"}, {"type": "stdin_stdout", "input": "a\n6\n2 2 a\n2 1 b\n1\n2 2 d\n1\n1", "output": "aabd\n"}, {"type": "stdin_stdout", "input": "a\n6\n2 2 b\n2 1 b\n1\n2 2 d\n1\n1", "output": "babd\n"}, {"type": "stdin_stdout", "input": "a\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\n# Base reduction\n\n## Input\n\n...
[{"input": "10", "output": "[2]", "fn_name": "basereduct"}, {"input": "15", "output": "[3]", "fn_name": "basereduct"}, {"input": "5", "output": "[5]", "fn_name": "basereduct"}, {"input": "7", "output": "[7]", "fn_name": "basereduct"}, {"input": "7", "output": "[7]", "fn_name": "basereduct"}]
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\nYou are playing a game called Gu...
[{"type": "stdin_stdout", "input": "RRLRRLRRRRLRRLRRRRLRRLRRRRLRRLRR", "output": "4"}, {"type": "stdin_stdout", "input": "RLLRRLLLRRRLLLLRR", "output": "0\n"}, {"type": "stdin_stdout", "input": "RLLRRLLMRRRLLLLRR", "output": "0\n"}, {"type": "stdin_stdout", "input": "RLLRLLLLRRRLLLRRR", "output": "0"}, {"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\nYou are given $q$ queries in the...
[{"type": "stdin_stdout", "input": "30\n1 1000000000 1\n1 1000000000 1\n1 1000000000 1\n1 1000000000 1\n1 1000000000 1\n1 1000000000 1\n1 1000000000 1\n1 1000000000 1\n1 1000000000 1\n1 1000000000 1\n1 1000000000 1\n1 1000000000 1\n1 1000000000 1\n1 1000000000 1\n1 1000000000 1\n1 1000000000 1\n1 1000000000 1\n1 100000...
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*This kata is based on [Project ...
[{"input": "50000", "output": "[22358]", "fn_name": "last_man_standing"}, {"input": "1000", "output": "[510]", "fn_name": "last_man_standing"}, {"input": "100", "output": "[54]", "fn_name": "last_man_standing"}, {"input": "10", "output": "[8]", "fn_name": "last_man_standing"}, {"input": "9", "output": "[6]", "fn_name":...
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\nFrom 1603 to 1867, people call t...
[{"type": "stdin_stdout", "input": "2\n10 11\n11 12\n2\nN 2\nE 1\n2\n10 11\n11 12\n2\nN 2\nW 1\n3\n0 15\n5 10\n5 15\n5\nW 20\nS 10\nN 20\nE 10\nS 10\n0", "output": "Yes\nNo\nNo\n"}, {"type": "stdin_stdout", "input": "2\n10 11\n11 12\n2\nN 2\nE 1\n2\n10 11\n11 12\n2\nN 3\nW 1\n3\n0 15\n5 10\n5 15\n5\nW 20\nS 10\nN 20\nE...
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 friend Cody has to sell a l...
[{"input": "\"10349349 13799132 14426622 17347290 19235496 23129720 24791793 32049435 33055724 42732580 48771579 51731211 58387395 59065617 65028772 67572870 68974948 71437914 77849860 78754156 81661776 88101462 90097160 95250552 97020531 108882368 114334791 117468616 128978592 129360708 138971622 140891505 151010565 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\nCapitalization is writing a word...
[{"type": "stdin_stdout", "input": "lZqBqKeGvNdSeYuWxRiVnFtYbKuJwQtUcKnVtQhAlOeUzMaAuTaEnDdPfDcNyHgEoBmYjZyFePeJrRiKyAzFnBfAuGiUyLrIeLrNhBeBdVcEeKgCcBrQzDsPwGcNnZvTsEaYmFfMeOmMdNuZbUtDoQoNcGwDqEkEjIdQaPwAxJbXeNxOgKgXoEbZiIsVkRrNpNyAkLeHkNfEpLuQvEcMbIoGaDzXbEtNsLgGfOkZaFiUsOvEjVeCaMcZqMzKeAdXxJsVeCrZaFpJtZxInQxFaSmGgSsV...
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 program which reads an i...
[{"type": "stdin_stdout", "input": "123\n158\n1100\n0", "output": "6\n14\n2\n"}, {"type": "stdin_stdout", "input": "123\n181\n1111\n0", "output": "6\n10\n4\n"}, {"type": "stdin_stdout", "input": "123\n418\n1100\n0", "output": "6\n13\n2\n"}, {"type": "stdin_stdout", "input": "123\n418\n1110\n0", "output": "6\n13\n3\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\nYour task is to calculate logica...
[{"input": "[true, false, false, false]\n\"AND\"", "output": "[false]", "fn_name": "logical_calc"}, {"input": "[true, true, false, false]\n\"AND\"", "output": "[false]", "fn_name": "logical_calc"}, {"input": "[true, true, false, false]\n\"XOR\"", "output": "[false]", "fn_name": "logical_calc"}, {"input": "[true, false,...
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\nScheduling is how the processor ...
[{"input": "[3, 10, 20, 1, 2, 10, 10]\n5", "output": "[26]", "fn_name": "SJF"}, {"input": "[3, 10, 10, 20, 1, 2]\n1", "output": "[16]", "fn_name": "SJF"}, {"input": "[3, 10, 10, 20, 1, 2]\n2", "output": "[26]", "fn_name": "SJF"}, {"input": "[3, 10, 20, 1, 2, 3]\n5", "output": "[9]", "fn_name": "SJF"}, {"input": "[3, 10...
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\nTakahashi, who is A years old, i...
[{"type": "stdin_stdout", "input": "30 100\n", "output": "100\n"}, {"type": "stdin_stdout", "input": "13 298\n", "output": "298\n"}, {"type": "stdin_stdout", "input": "60 654\n", "output": "654\n"}, {"type": "stdin_stdout", "input": "12 100\n", "output": "50\n"}, {"type": "stdin_stdout", "input": "6 482\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\nThe Smart Beaver from ABBYY love...
[{"type": "stdin_stdout", "input": "4\n-64322865 -60701256 -53458038 -42593211 -38971602 -31728384 -24485166 -17241948 -2755512 4487706 11730924 18974142 22595751 33460578 40703796 44325405\n", "output": "-39994920\n-60701256 -64322865 44325405 40703796\n-2755512 33460578 -53458038 -17241948\n18974142 -31728384 1173092...
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\nInternational Christmas Present ...
[{"type": "stdin_stdout", "input": "3 2 3\n0 1 10\n1 2 15\n0 -1\n1 8\n2 -1\n3 2 4\n0 1 10\n1 2 10\n0 0\n1 19\n2 20\n0 25\n13 10 10\n0 1 39\n2 3 48\n3 5 20\n4 8 25\n3 9 10\n8 9 40\n3 4 5\n5 0 17\n0 7 93\n1 3 13\n0 0\n1 100000000\n2 100\n3 543\n4 500\n5 400\n6 300\n6 200\n8 100\n9 100\n0 0 0", "output": "3\n3\n4\n"}, {"t...
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\nAirport Codes\n\nAirport code\n\...
[{"type": "stdin_stdout", "input": "3\nhaneda\noookayama\nssu\n2\nazusa\nazishirabe\n2\nsnuke\nsnake\n4\nhaneda\nhonda\nhanamaki\nhawaii\n0", "output": "1\n4\n-1\n3\n"}, {"type": "stdin_stdout", "input": "3\nhaneda\noookayama\nstu\n2\nazusa\nebarihsiza\n2\nsnuke\nsnake\n4\nhaneda\nhonda\nhanamaki\nhawaih\n0", "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\nEshag has an array $a$ consistin...
[{"type": "stdin_stdout", "input": "3\n6\n1 1 1 7 3 1\n6\n17 17 8 11 9 12\n6\n10 2 2 2 1 1\n", "output": "2\n5\n4\n"}, {"type": "stdin_stdout", "input": "3\n6\n1 1 1 7 3 1\n6\n17 17 8 11 9 12\n6\n10 2 2 2 0 1\n", "output": "2\n5\n5\n"}, {"type": "stdin_stdout", "input": "3\n6\n1 1 2 7 3 1\n6\n17 17 8 11 9 12\n6\n10 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\nRikhail Mubinchik believes that ...
[{"type": "stdin_stdout", "input": "10000 239\n", "output": "1168638\n"}, {"type": "stdin_stdout", "input": "10001 239\n", "output": "1168798\n"}, {"type": "stdin_stdout", "input": "10000 239\n", "output": "1168638"}, {"type": "stdin_stdout", "input": "10278 674\n", "output": "204510\n"}, {"type": "stdin_stdout", "inpu...
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\nHave you ever played Hanabi? If ...
[{"type": "stdin_stdout", "input": "100\nY3 Y3 Y5 Y2 Y4 Y1 Y2 Y3 Y1 Y5 Y3 Y1 Y4 Y5 Y5 Y3 Y1 Y5 Y2 Y3 Y1 Y4 Y4 Y1 Y2 Y2 Y4 Y2 Y4 Y5 Y5 Y2 Y3 Y1 Y3 Y5 Y3 Y1 Y5 Y3 Y3 Y2 Y5 Y1 Y5 Y5 Y4 Y2 Y2 Y1 Y2 Y4 Y3 Y2 Y5 Y3 Y4 Y3 Y1 Y4 Y2 Y4 Y4 Y3 Y3 Y1 Y1 Y4 Y2 Y5 Y3 Y4 Y4 Y4 Y3 Y2 Y2 Y2 Y3 Y4 Y4 Y2 Y1 Y2 Y2 Y4 Y3 Y5 Y4 Y2 Y5 Y3 Y1 ...
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 again, Boris needs the help...
[{"type": "stdin_stdout", "input": "5\n3\n1 -1 0\n1 1 -2\n3\n0 1 1\n0 2 2\n2\n1 -1\n1 44\n2\n-1 0\n-1 -38\n5\n1 1 -1 1 -1\n1 1 -1 1 -1\n", "output": "YES\nNO\nYES\nYES\nYES\n"}, {"type": "stdin_stdout", "input": "5\n3\n0 -1 -1\n1 1 -2\n3\n0 1 1\n0 1 2\n2\n1 0\n1 41\n2\n-1 0\n-1 -41\n5\n0 1 -1 1 -1\n0 1 -1 1 -1\n", "out...
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 and Dima bought a table of ...
[{"type": "stdin_stdout", "input": "14 34\nDDDDDDDDDDDDIMADDDDDDDDDDDDDDDIMAD\nDDDDDDIMADDDDDDDDDDDDDDDDDDDDDIMAD\nDDDDDDDDDDDDDIDDDDDDDDDDDIDIMIDIMA\nDDDDDDIMDDDDDDDDDDDDDIDDDDDDDDDDDD\nDDDDDDDDDDDDDDDDDMADDDDDDDDDDDDDMD\nDDDDDDIMIDDDDDDDDDDDDIMIDIMIDDDIDD\nDDDDDDDDDDDDDDDDDMIMDDDDIMDDIMADIM\nDDDDDDDDDDDADIMADIDDDDDDI...
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\nYou've just moved into...
[{"input": "20\n3400", "output": "[6781]", "fn_name": "over_the_road"}, {"input": "10\n22", "output": "[35]", "fn_name": "over_the_road"}, {"input": "7\n11", "output": "[16]", "fn_name": "over_the_road"}, {"input": "9\n26", "output": "[44]", "fn_name": "over_the_road"}, {"input": "20\n10", "output": "[1]", "fn_name": "...
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# Task\n You are given a string ...
[{"input": "\"gztxxxxxggggggggggggsssssssbbbbbeeeeeeehhhmmmmmmmitttttttlllllhkppppp\"", "output": "[2]", "fn_name": "repeat_adjacent"}, {"input": "\"ccccoodeffffiiighhhhhhhhhhttttttts\"", "output": "[3]", "fn_name": "repeat_adjacent"}, {"input": "\"ccccoooooooooooooooooooooooddee\"", "output": "[1]", "fn_name": "repeat...
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\nLet's call beauty of an array $b...
[{"type": "stdin_stdout", "input": "52 52\n19752 66708 73109 84463 95683 96876 98503 98812 99766 99778 99913 99975 99977 99997 99997 99997 99998 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 ...
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, turn each letter...
[{"input": "\"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ\"", "output": "[96]", "fn_name": "calc"}, {"input": "\"jfmgklf8hglbe\"", "output": "[6]", "fn_name": "calc"}, {"input": "\"aaaaaddddr\"", "output": "[30]", "fn_name": "calc"}, {"input": "\"ifkhchlhfd\"", "output": "[6]", "fn_name": "calc"}, {"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\nConstruct a function 'coordinate...
[{"input": "[-4, -5]\n[-5, -4]\n1", "output": "[1.4]", "fn_name": "coordinates"}, {"input": "[-2, 5]\n[-2, -10]\n2", "output": "[15]", "fn_name": "coordinates"}, {"input": "[4, 7]\n[6, 2]\n3", "output": "[5.385]", "fn_name": "coordinates"}, {"input": "[5, 3]\n[10, 15]\n2", "output": "[13]", "fn_name": "coordinates"}, {...
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\nGerald plays the following game....
[{"type": "stdin_stdout", "input": "10 5\n2 1\n4 4\n2 2\n4 3\n1 1\n", "output": "11\n"}, {"type": "stdin_stdout", "input": "5 5\n3 2\n5 4\n3 3\n2 3\n1 2\n", "output": "1\n"}, {"type": "stdin_stdout", "input": "5 5\n3 2\n1 4\n5 1\n4 5\n3 1\n", "output": "2\n"}, {"type": "stdin_stdout", "input": "5 5\n2 2\n5 3\n2 3\n5 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 the world of DragonBool there...
[{"type": "stdin_stdout", "input": "2\n2 3\n10 1\n20 2\n5 2\n4 2\n18 1\n5 5\n73 87\n100 13\n36 36\n77 46\n16 93\n49 46\n27 93\n118 87\n172 13\n63 36", "output": "8\n155\n"}, {"type": "stdin_stdout", "input": "2\n2 3\n7 1\n20 2\n5 2\n4 2\n18 1\n5 5\n73 87\n100 13\n36 36\n77 46\n16 93\n49 46\n27 93\n118 87\n172 13\n63 36...
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 objective of this Kata is to...
[{"input": "2\n100", "output": "[{\"2\": [\"None\"], \"3\": [\"None\"], \"4\": [2], \"5\": [\"None\"], \"6\": [2, 3], \"7\": [\"None\"], \"8\": [2, 4], \"9\": [3], \"10\": [2, 5], \"11\": [\"None\"], \"12\": [2, 3, 4, 6], \"13\": [\"None\"], \"14\": [2, 7], \"15\": [3, 5], \"16\": [2, 4, 8], \"17\": [\"None\"], \"18\":...
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 the triangle of consecutiv...
[{"input": "101", "output": "[1030301]", "fn_name": "row_sum_odd_numbers"}, {"input": "74", "output": "[405224]", "fn_name": "row_sum_odd_numbers"}, {"input": "86", "output": "[636056]", "fn_name": "row_sum_odd_numbers"}, {"input": "93", "output": "[804357]", "fn_name": "row_sum_odd_numbers"}, {"input": "41", "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\nA ski base is planned to be buil...
[{"type": "stdin_stdout", "input": "2 40\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n", "output": "0\n1\n3\n7\n15\n31\n63\n127\n255\n511\n1023\n2047\n4095\n8191\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\nCheesy Cheeseman just got a new ...
[{"input": "3840\n\"32:9\"", "output": "[\"3840x1080\"]", "fn_name": "find_screen_height"}, {"input": "1920\n\"16:9\"", "output": "[\"1920x1080\"]", "fn_name": "find_screen_height"}, {"input": "5120\n\"32:9\"", "output": "[\"5120x1440\"]", "fn_name": "find_screen_height"}, {"input": "1280\n\"16:9\"", "output": "[\"1280...
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 x that is gr...
[{"type": "stdin_stdout", "input": "000", "output": "1\n"}, {"type": "stdin_stdout", "input": "000", "output": "1\n"}, {"type": "stdin_stdout", "input": "1\n", "output": "0\n"}, {"type": "stdin_stdout", "input": "0\n", "output": "1\n"}, {"type": "stdin_stdout", "input": "1", "output": "0"}, {"type": "stdin_stdout", "in...
code_stdio