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\nLet's call a sequence of integer...
[{"type": "stdin_stdout", "input": "1\n30\n0 0 0 2 0 0 0 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2\n", "output": "998244352\n"}, {"type": "stdin_stdout", "input": "1\n30\n0 0 0 2 0 0 0 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2\n", "output": "998244352\n"}, {"type": "stdin_stdout", "input": "1\n30\n0 0 0 1 0 0 0...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nGiven the string S and m queries...
[{"type": "stdin_stdout", "input": "icpcsummertraining\n9\nmm n\nicpc summer\ntrain ing\nsummer mm\ni c\ni i\nh f\ntrain i\nsummer er", "output": "11\n10\n8\n0\n4\n16\n0\n6\n6\n"}, {"type": "stdin_stdout", "input": "icpcsummertraining\n9\nmm n\nicpc summer\nniart ing\nsummer mm\ni c\ni i\nh f\ntrain i\nsummer er", "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\nYou are given a chess board with...
[{"type": "stdin_stdout", "input": "104\n", "output": "WBWBWBWBWBWBWBWBWBWBWBWBWBWBWBWBWBWBWBWBWBWBWBWBWBWBWBWBWBWBWBWBWBWBWBWBWBWBWBWBWBWBWBWBWBWBWBWBWBWBWBWB\nBWBWBWBWBWBWBWBWBWBWBWBWBWBWBWBWBWBWBWBWBWBWBWBWBWBWBWBWBWBWBWBWBWBWBWBWBWBWBWBWBWBWBWBWBWBWBWBWBWBWBWBW\nWBWBWBWBWBWBWBWBWBWBWBWBWBWBWBWBWBWBWBWBWBWBWBWBWBWBW...
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\nRound any given number to the cl...
[{"input": "4.74999999999", "output": "[4.5]", "fn_name": "solution"}, {"input": "4.74999999991", "output": "[4.5]", "fn_name": "solution"}, {"input": "4.25", "output": "[4.5]", "fn_name": "solution"}, {"input": "4.55", "output": "[4.5]", "fn_name": "solution"}, {"input": "4.74", "output": "[4.5]", "fn_name": "solution...
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 is a simplified version of ...
[{"type": "stdin_stdout", "input": "61\nkzaaa\ncodeforces\narchive\ny\nxxxxxx\nkzaaa\ncodeforces\narchive\ny\nxxxxxx\nkzaaa\ncodeforces\narchive\ny\nxxxxxx\nkzaaa\ncodeforces\narchive\ny\nxxxxxx\nkzaaa\ncodeforces\narchive\ny\nxxxxxx\nkzaaa\ncodeforces\narchive\ny\nxxxxxx\nkzaaa\ncodeforces\narchive\ny\nxxxxxx\nkzaaa\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 will be given a string. \n\n...
[{"input": "\"reusetestcasesbitcointakeovertheworldmaybewhoknowsperhaps\"", "output": "[[\"spahrepswonkohwebyamdlroweht\", \"reusetestcasesbitcointakeove\", \"r\"]]", "fn_name": "pop_shift"}, {"input": "\"turnsoutrandomtestcasesareeasierthanwritingoutbasicones\"", "output": "[[\"senocisabtuognitirwnahtreis\", \"turnsou...
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 us consider sets of positive...
[{"type": "stdin_stdout", "input": "9 3 23\n10 3 22\n10 3 28\n16 10 107\n26 8 102\n20 10 105\n24 10 155\n3 4 3\n4 2 11\n0 0 0", "output": "1\n5\n0\n20\n32200\n5448\n10222\n0\n0\n"}, {"type": "stdin_stdout", "input": "9 3 23\n9 3 22\n10 3 28\n16 10 107\n26 8 102\n20 10 105\n24 10 155\n3 4 3\n4 2 11\n0 0 0", "output": "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\nIs every value in the array an a...
[{"input": "[\"A\", \"R\", \"R\", \"A\", \"Y\"]", "output": "[false]", "fn_name": "arr_check"}, {"input": "[[1], [2], [3]]", "output": "[true]", "fn_name": "arr_check"}, {"input": "[[\"string\"]]", "output": "[true]", "fn_name": "arr_check"}, {"input": "[[], {}]", "output": "[false]", "fn_name": "arr_check"}, {"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\nVasya will fancy any number as l...
[{"type": "stdin_stdout", "input": "1000000000 -1000\n", "output": "14\n"}, {"type": "stdin_stdout", "input": "1000000000 -1000\n", "output": "14\n"}, {"type": "stdin_stdout", "input": "1000000010 -1000\n", "output": "15\n"}, {"type": "stdin_stdout", "input": "1010000000 -1000\n", "output": "15\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\nThere are N towns located in a l...
[{"type": "stdin_stdout", "input": "10 100\n7 10 4 5 9 3 6 8 2 1\n", "output": "2\n"}, {"type": "stdin_stdout", "input": "10 100\n7 10 4 5 9 3 6 8 1 1", "output": "2\n"}, {"type": "stdin_stdout", "input": "10 100\n7 10 4 5 9 3 6 8 2 1", "output": "2"}, {"type": "stdin_stdout", "input": "5 8\n50 30 40 10 20\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\nHaruna is a high school student....
[{"type": "stdin_stdout", "input": "1 2\n11 0\n0 0", "output": "yes\nyes\n"}, {"type": "stdin_stdout", "input": "2 1\n10 0\n0 0", "output": "yes\nyes\n"}, {"type": "stdin_stdout", "input": "1 4\n11 0\n0 0", "output": "yes\nyes\n"}, {"type": "stdin_stdout", "input": "2 -1\n8 0\n0 0", "output": "yes\nyes\n"}, {"type": "s...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nA bracket sequence is a string, ...
[{"type": "stdin_stdout", "input": "[()][([[]])][[[]()]][()[]]()()([[][]][[]][](()))[[[(())]]][]()(([([])(([[[]]()])(()))]((())))([()]([()[[[]([][[[[][(())([[]()])]]][[(())]([])]()][[](())]()[])]()[][]]([[]])[]])[(()[()((()[][()]))][])[]()()([]())](()[][][])()()[]()))[]()[]\n", "output": "61\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\nNot long ago Billy came across s...
[{"type": "stdin_stdout", "input": "1000000\n", "output": "111111074060178115\n"}, {"type": "stdin_stdout", "input": "987572\n", "output": "107019643962508968\n"}, {"type": "stdin_stdout", "input": "983242\n", "output": "105618162572849728\n"}, {"type": "stdin_stdout", "input": "600000\n", "output": "23999973325791164\...
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 can perfectly predict the pr...
[{"type": "stdin_stdout", "input": "100\n411 642 560 340 276 440 515 519 182 314 35 227 390 136 97 5 502 584 567 79 543 444 413 463 455 316 545 329 437 443 9 435 291 384 328 501 603 234 285 297 453 587 550 72 130 163 282 298 605 349 270 198 24 179 243 92 115 56 83 26 3 456 622 325 366 360 299 153 140 552 216 117 61 307...
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 monster is attacking the Cyber...
[{"type": "stdin_stdout", "input": "100 100 100\n100 100 100\n100 100 100\n", "output": "100\n"}, {"type": "stdin_stdout", "input": "100 100 100\n100 100 100\n100 100 100\n", "output": "100\n"}, {"type": "stdin_stdout", "input": "50 100 51\n100 100 100\n1 100 100\n", "output": "1384\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\n# Base64 Numeric Translator\n\nO...
[{"input": "\"HelloWorld\"", "output": "[134710352538679645]", "fn_name": "base64_to_base10"}, {"input": "\"b64\"", "output": "[114360]", "fn_name": "base64_to_base10"}, {"input": "\"/+/\"", "output": "[262079]", "fn_name": "base64_to_base10"}, {"input": "\"WIN\"", "output": "[90637]", "fn_name": "base64_to_base10"}, {...
code_functional
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nPetya's friends made him a birth...
[{"type": "stdin_stdout", "input": "500\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\nAn array of integers $p_1, p_2, ...
[{"type": "stdin_stdout", "input": "5\n-1 2 -3 -1\n", "output": "4 3 5 2 1 "}, {"type": "stdin_stdout", "input": "5\n-1 2 -3 -1\n", "output": "4 3 5 2 1 "}, {"type": "stdin_stdout", "input": "5\n3 -2 1 -3\n", "output": "2 5 3 4 1 "}, {"type": "stdin_stdout", "input": "5\n-4 1 2 -1\n", "output": "5 1 2 4 3 "}, {"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\nUser ainta has a permutation p_1...
[{"type": "stdin_stdout", "input": "15\n6 1 2 7 9 13 14 8 4 5 3 12 10 15 11\n000100100100100\n000010010010010\n000001001001001\n100000100100100\n010000010010010\n001000001001001\n100100000100100\n010010000010010\n001001000001001\n100100100000100\n010010010000010\n001001001000001\n100100100100000\n010010010010000\n00100...
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$ consi...
[{"type": "stdin_stdout", "input": "50\n6\nbxyxcz\n4\nzzcy\n2\nzb\n2\nyb\n6\nzzbxyx\n4\nbxzb\n4\naaca\n4\nbzyx\n4\nxaac\n2\nbb\n2\nzb\n6\ncabcbb\n6\nyxzbbb\n2\nxz\n2\ncc\n6\nazcaza\n4\nyyaa\n2\nxb\n2\nyb\n6\nzaxxxz\n4\nbyab\n4\naxxz\n2\nay\n2\nyb\n2\ncx\n4\nzyab\n6\nybcyya\n6\nxayzaz\n4\nzacx\n6\nzzyxbz\n2\ncc\n4\nbycx...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nFor the multiset of positive int...
[{"type": "stdin_stdout", "input": "10\n972 972 324 972 324 648 1944 243 324 474\n", "output": "162\n"}, {"type": "stdin_stdout", "input": "10\n61 1677 535 769 324 1309 1589 243 324 184\n", "output": "1\n"}, {"type": "stdin_stdout", "input": "10\n61 1677 535 769 627 1309 1589 243 324 184\n", "output": "1\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\nNatasha is going to fly to Mars....
[{"type": "stdin_stdout", "input": "50 13\nqwertyuiopasdfghjklzxcvbnmaaaaaaaaaaaaaaaaaaaaaaaa\n", "output": "169\n"}, {"type": "stdin_stdout", "input": "50 13\nqwertyuiopasdfghjklzxcvbnmaaaaaaaaaaaaaaaaaaaaaaaa\n", "output": "169"}, {"type": "stdin_stdout", "input": "50 31\nahbyyoxltryqdmvenemaqnbakglgqolxnaifnqtoclnnq...
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 tree with N vertices a...
[{"type": "stdin_stdout", "input": "10\n5 4\n5 7\n-1 13\n0 9\n12 10\n4 11\n7 4\n11 10\n7 4", "output": "152\n"}, {"type": "stdin_stdout", "input": "10\n5 16\n5 6\n-1 24\n1 10\n13 10\n4 6\n13 4\n6 3\n7 3", "output": "187\n"}, {"type": "stdin_stdout", "input": "10\n5 16\n5 6\n-1 24\n1 10\n13 10\n4 6\n13 4\n6 5\n7 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\nTakahashi has N sticks that are ...
[{"type": "stdin_stdout", "input": "2000\n1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 100...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nYou will be given an array that ...
[{"input": "[\"joey\", \"louise\"]", "output": "[\"j l\\no o\\ne u\\ny i\\n s\\n e\"]", "fn_name": "transpose_two_strings"}, {"input": "[\"Hello\", \"World\"]", "output": "[\"H W\\ne o\\nl r\\nl l\\no d\"]", "fn_name": "transpose_two_strings"}, {"input": "[\"!a!a!\", \"?b?b\"]", "output": "[\"! ?\\na b\\n! ?\\na b\\n...
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 country decides to build a pal...
[{"type": "stdin_stdout", "input": "1000\n20 -20\n51765 34765 54644 24887 70030 45034 46376 88410 33772 52941 79750 44783 70874 36236 36651 16147 23251 11281 36605 69084 74679 18310 88655 92253 0 76064 82769 20419 60361 61197 51619 35110 6063 82815 99426 22379 61759 34008 31814 22642 80907 10203 11864 18291 34343 35250...
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 day n friends met at a party...
[{"type": "stdin_stdout", "input": "10\n10 1000\n10 1000\n10 1000\n10 1000\n10 1000\n10 1000\n10 1000\n10 1000\n10 1000\n10 1000\n", "output": "90000 90000 90000 90000 90000 90000 90000 90000 90000 90000 "}, {"type": "stdin_stdout", "input": "10\n10 1000\n10 1000\n10 1000\n10 1000\n10 1000\n10 1000\n10 1000\n10 1000\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\nKattapa, as you all know was one...
[{"type": "stdin_stdout", "input": "5\n12 -1 -2 -2 -2", "output": "READY FOR BATTLE\n"}, {"type": "stdin_stdout", "input": "5\n2 -1 -2 -2 -2", "output": "READY FOR BATTLE\n"}, {"type": "stdin_stdout", "input": "5\n2 -1 -1 -2 -2", "output": "READY FOR BATTLE\n"}, {"type": "stdin_stdout", "input": "5\n4 -1 -1 -2 -2", "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\nSame as [the original](https://w...
[{"input": "\"***\"", "output": "[[\"000\", \"006\", \"012\", \"018\", \"024\", \"030\", \"036\", \"042\", \"048\", \"054\", \"060\", \"066\", \"072\", \"078\", \"084\", \"090\", \"096\", \"102\", \"108\", \"114\", \"120\", \"126\", \"132\", \"138\", \"144\", \"150\", \"156\", \"162\", \"168\", \"174\", \"180\", \"186\...
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\nNeko is playing with his toys on...
[{"type": "stdin_stdout", "input": "1000\n", "output": "143886430\n"}, {"type": "stdin_stdout", "input": "450\n", "output": "690479399\n"}, {"type": "stdin_stdout", "input": "999\n", "output": "742390865\n"}, {"type": "stdin_stdout", "input": "900\n", "output": "454329300\n"}, {"type": "stdin_stdout", "input": "500\n",...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nIn this Kata, we will calculate ...
[{"input": "[4, 2, 8, 3, 1]", "output": "[19]", "fn_name": "solve"}, {"input": "[4, 2, 7, 3, 1]", "output": "[18]", "fn_name": "solve"}, {"input": "[2, 12, 3, 1]", "output": "[7]", "fn_name": "solve"}, {"input": "[4, 2, 12, 3]", "output": "[1]", "fn_name": "solve"}, {"input": "[1, 2, 8, 7]", "output": "[4]", "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\nYou need count how many valleys ...
[{"input": "\"UFFDDFDUDFUFUUFFDDFDUDFUFUUFFDDFDUDFUFUUFFDDFDUDFUFUUFFDDFDUDFUFUUFFDDFDUDFUFU\"", "output": "[6]", "fn_name": "counting_valleys"}, {"input": "\"UFFDDFDUDFUFUUFFDDFDUDFUFUUFFDDFDUDFUFUUFFDDFDUDFUFU\"", "output": "[4]", "fn_name": "counting_valleys"}, {"input": "\"UFFDDFDUDFUFUUFFDDUFFDDUFFDDUDUDUDUDUDUUUU...
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\nSimon has a prime number x and a...
[{"type": "stdin_stdout", "input": "26 7\n0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 2 2\n", "output": "49\n"}, {"type": "stdin_stdout", "input": "26 7\n0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 2 2\n", "output": "49\n"}, {"type": "stdin_stdout", "input": "26 2\n0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nLike any unknown mathematician, ...
[{"type": "stdin_stdout", "input": "86565 229134 356183 486713\n", "output": "1559833368660730\n"}, {"type": "stdin_stdout", "input": "90528 225462 336895 417903\n", "output": "1043176084391535\n"}, {"type": "stdin_stdout", "input": "178561 294901 405737 476436\n", "output": "911664147520700\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\nYou are playing a variation of g...
[{"type": "stdin_stdout", "input": "6\n4\n1024 512 64 512\n1\n2048\n3\n128 512 2\n2\n4096 8\n1\n2048 2 2048 2048 2048 2048 2048\n2\n2048 4898\n", "output": "YES\nYES\nNO\nNO\nYES\nYES\n"}, {"type": "stdin_stdout", "input": "6\n4\n1024 512 64 512\n1\n2048\n3\n64 512 2\n2\n4096 4\n7\n2048 2 2048 2048 2048 2048 2048\n2\n2...
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 checks if...
[{"input": "100\n5\n10", "output": "[true]", "fn_name": "is_divisible"}, {"input": "100\n5\n3", "output": "[false]", "fn_name": "is_divisible"}, {"input": "17\n17\n17", "output": "[true]", "fn_name": "is_divisible"}, {"input": "17\n1\n17", "output": "[true]", "fn_name": "is_divisible"}, {"input": "3\n2\n2", "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\nWrite a program which calculates...
[{"type": "stdin_stdout", "input": "-10 2", "output": "-20 -16\n"}, {"type": "stdin_stdout", "input": "-16 -2", "output": "32 -36\n"}, {"type": "stdin_stdout", "input": "-16 -1", "output": "16 -34\n"}, {"type": "stdin_stdout", "input": "-16 1", "output": "-16 -30\n"}, {"type": "stdin_stdout", "input": "4 122", "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\nMy friend John and I are members...
[{"input": "\"387087 176 351832 100 430372 8 58052 54 175432 120 269974 147 309754 91 404858 67 271476 164 295747 111 40\"", "output": "[\"100 111 120 40 8 54 91 164 147 67 176 430372 58052 175432 351832 271476 309754 404858 387087 295747 269974\"]", "fn_name": "order_weight"}, {"input": "\"71899703 200 6 91 425 4 6740...
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 two positive integ...
[{"type": "stdin_stdout", "input": "5\n2 3\n10 10\n2 4\n7 4\n9 3\n", "output": "1\n0\n2\n2\n1\n"}, {"type": "stdin_stdout", "input": "5\n2 3\n10 10\n2 4\n4 4\n9 3\n", "output": "1\n0\n2\n0\n1\n"}, {"type": "stdin_stdout", "input": "5\n2 3\n10 10\n2 7\n4 4\n9 3\n", "output": "1\n0\n1\n0\n1\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\nVlad went into his appartment ho...
[{"type": "stdin_stdout", "input": "69\n1 2 3\n3 1 2\n3 2 1\n1 2 3\n3 1 2\n3 2 1\n1 2 3\n3 1 2\n3 2 1\n1 2 3\n3 1 2\n3 2 1\n1 2 3\n3 1 2\n3 2 1\n1 2 3\n3 1 2\n3 2 1\n1 2 3\n3 1 2\n3 2 1\n1 2 3\n3 1 2\n3 2 1\n1 2 3\n3 1 2\n3 2 1\n1 2 3\n3 1 2\n3 2 1\n1 2 3\n3 1 2\n3 2 1\n1 2 3\n3 1 2\n3 2 1\n1 2 3\n3 1 2\n3 2 1\n1 2 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\nWe have a grid with 3 rows and N...
[{"type": "stdin_stdout", "input": "7\n21 12 1 16 14 6 10\n20 11 0 27 14 7 8\n19 10 3 18 7 4 12", "output": "No\n"}, {"type": "stdin_stdout", "input": "7\n21 12 1 16 14 6 10\n20 12 0 27 14 7 8\n19 10 3 18 7 4 12", "output": "No\n"}, {"type": "stdin_stdout", "input": "7\n21 12 1 16 12 6 10\n20 12 0 27 14 7 8\n19 10 3 18...
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 rectangle grid. ...
[{"type": "stdin_stdout", "input": "1000000000 1000000000 286536427 579261823 230782719 575570138\n", "output": "171145067 291476754 401927786 867046892\n"}, {"type": "stdin_stdout", "input": "1000000000 1000000000 623214043 753726318 970868535 929707704\n", "output": "29131465 70292296 1000000000 1000000000\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\nWrite a function that checks if ...
[{"input": "[\"mastering\", \"streaming\"]", "output": "[true]", "fn_name": "letter_check"}, {"input": "[\"THE EYES\", \"they see\"]", "output": "[true]", "fn_name": "letter_check"}, {"input": "[\"drapes\", \"compadres\"]", "output": "[false]", "fn_name": "letter_check"}, {"input": "[\"assert\", \"staring\"]", "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\nLa Confiserie d'ABC sells cakes ...
[{"type": "stdin_stdout", "input": "100\n", "output": "Yes\n"}, {"type": "stdin_stdout", "input": "11\n", "output": "Yes\n"}, {"type": "stdin_stdout", "input": "40\n", "output": "Yes\n"}, {"type": "stdin_stdout", "input": "12\n", "output": "Yes\n"}, {"type": "stdin_stdout", "input": "15\n", "output": "Yes\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\nInnovation technologies are on a...
[{"type": "stdin_stdout", "input": "10\n739 307\n523 658\n700 143\n373 577\n120 433\n353 833\n665 516\n988 101\n817 604\n800 551\n10\n431 425 227 147 153 170 954 757 222 759\n", "output": "6 3621\n6 2\n2 8\n9 7\n4 1\n7 10\n5 4\n"}, {"type": "stdin_stdout", "input": "10\n739 307\n523 658\n700 143\n373 577\n120 433\n353 ...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nYou are given a tree with $n$ ve...
[{"type": "stdin_stdout", "input": "15\n4 6\n8 4\n12 11\n7 6\n9 8\n5 1\n14 13\n6 13\n1 4\n1 2\n6 11\n10 8\n15 14\n3 1\n", "output": "4\n"}, {"type": "stdin_stdout", "input": "15\n4 6\n8 4\n12 11\n7 6\n9 8\n5 1\n14 13\n6 13\n1 4\n1 2\n6 11\n10 8\n15 14\n3 1\n", "output": "4\n"}, {"type": "stdin_stdout", "input": "15\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\nRead problems statements in Mand...
[{"type": "stdin_stdout", "input": "3\n5\nABCDE\nEBCDA\n1 10 34 18 78 225\n4\nCHEE\nQUIZ\n15 3 3 1 0\n8\nABBABAAB\nABABABAB\n100 100 100 100 001 001 000 000 000", "output": "34\n15\n100\n"}, {"type": "stdin_stdout", "input": "3\n5\nABCDE\nEBCDA\n1 10 34 18 63 225\n4\nCHEE\nQUIZ\n15 3 3 1 0\n8\nABBABAAB\nABABABAB\n100 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\nUnary is a minimalistic Brainfuc...
[{"type": "stdin_stdout", "input": ",]+>.],,+->+>-[]][><,-]><]++<.,-[.>.<+.[.<,[-,,[<]+>]->>]>]-+-+<][].,.]+][[<,-.+][+<<-+.],,,<,.]-].-\n", "output": "859903\n"}, {"type": "stdin_stdout", "input": ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n", "output": "20887...
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\nZS the Coder and Chris the Baboo...
[{"type": "stdin_stdout", "input": "84\n2 50 67 79 71 45 43 40 57 20 25 8 60 47 52 10 37 23 1 28 22 26 3 42 11 63 61 68 49 32 55 18 5 24 31 70 66 27 38 41 54 12 65 51 15 34 30 35 77 74 21 62 33 16 81 14 19 48 80 73 69 78 39 6 76 46 75 72 84 29 58 59 13 17 82 9 83 4 36 56 53 7 64 44\n", "output": "428380105\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 has a cute cat. To keep he...
[{"type": "stdin_stdout", "input": "6\n3 2 2 2\n0 0 -2 -2 2 2\n3 1 4 1\n0 0 -1 -1 1 1\n1 1 1 1\n1 1 1 1 1 1\n0 0 0 1\n0 0 0 0 0 1\n5 1 1 1\n0 0 -100 -100 0 100\n1 1 5 1\n0 0 -100 -100 100 0\n", "output": "Yes\nNo\nNo\nYes\nYes\nYes\n"}, {"type": "stdin_stdout", "input": "6\n3 2 2 2\n0 1 -2 -2 2 2\n3 1 4 1\n0 0 -1 -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\nBizon the Champion isn't just at...
[{"type": "stdin_stdout", "input": "30\n1 4 5 3 9 7 8 4 5 9 2 3 4 2 3 4 5 5 6 8 1 2 9 4 3 7 2 6 5 4\n", "output": "26\n"}, {"type": "stdin_stdout", "input": "30\n1 4 5 3 9 7 8 4 5 9 2 3 4 2 3 4 5 5 6 8 1 2 9 4 3 7 2 6 5 4\n", "output": "26\n"}, {"type": "stdin_stdout", "input": "30\n1 4 5 3 9 7 8 4 5 1 2 3 4 2 3 4 5 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\nThe Chef likes to stay in touch ...
[{"type": "stdin_stdout", "input": "3\n2\n0 -1\n-1 -1\n1 0\n2\n0 0\n0 -1\n1 -1\n2\n1 0\n1 2\n1 1", "output": "yes\nyes\nyes\n"}, {"type": "stdin_stdout", "input": "3\n2\n0 -1\n-1 -1\n1 0\n2\n1 0\n0 -1\n1 -1\n2\n1 0\n1 2\n1 1", "output": "yes\nyes\nyes\n"}, {"type": "stdin_stdout", "input": "3\n2\n0 -1\n-1 -1\n1 0\n2\n0...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nA [Word Square](https://en.wikip...
[{"input": "\"DESCENDANTECHENEIDAESHORTCOATSCERBERULUSENTEROMERENECROLATERDIOUMABANAADALETABATNATURENAMETESSERATED\"", "output": "[true]", "fn_name": "word_square"}, {"input": "\"GLASSESRELAPSEIMITATESMEAREDTANNERY\"", "output": "[false]", "fn_name": "word_square"}, {"input": "\"FRACTUREOUTLINEDBLOOMINGSEPTETTE\"", "ou...
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\nWrite a function that will check...
[{"input": "\"abcdefghba\"", "output": "[false]", "fn_name": "permute_a_palindrome"}, {"input": "\"racecars\"", "output": "[false]", "fn_name": "permute_a_palindrome"}, {"input": "\"baabcd\"", "output": "[false]", "fn_name": "permute_a_palindrome"}, {"input": "\"baa\"", "output": "[true]", "fn_name": "permute_a_palindr...
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\n3\n1 3 3\n2\...
[{"type": "stdin_stdout", "input": "3\n0 2 0\n-1\n1 2\n0 2", "output": "3\n"}, {"type": "stdin_stdout", "input": "3\n0 2 0\n-1\n1 2\n0 1", "output": "3\n"}, {"type": "stdin_stdout", "input": "3\n1 1 0\n0\n1 2\n-1 1", "output": "3\n"}, {"type": "stdin_stdout", "input": "3\n0 1 1\n0\n2 1\n-1 1", "output": "3\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\nBarney lives in country USC (Uni...
[{"type": "stdin_stdout", "input": "85\n1 1 2 2 4 6 1 3 6 3 3 11 9 14 12 5 8 11 16 19 12 17 2 19 1 24 6 2 6 6 24 3 20 1 1 1 17 8 4 25 31 32 39 12 35 23 31 26 46 9 37 7 5 23 41 41 39 9 11 54 36 54 28 15 25 58 56 18 23 70 68 18 3 48 57 70 15 65 22 35 25 13 49 34\n", "output": "1.00000000 28.50000000 27.00000000 38.000000...
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**Debug** a function called calc...
[{"input": "-2\n\"codewars\"\n-2", "output": "[null]", "fn_name": "calculate"}, {"input": "3.2\n\"+\"\n8", "output": "[11.2]", "fn_name": "calculate"}, {"input": "3.2\n\"-\"\n8", "output": "[-4.8]", "fn_name": "calculate"}, {"input": "3.2\n\"*\"\n8", "output": "[25.6]", "fn_name": "calculate"}, {"input": "6\n\"-\"\n1.5...
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\nTwo bears are playing tic-tac-to...
[{"type": "stdin_stdout", "input": "xxo xoo xxo\nooo ooo xxx\noox oxo oxx\n\noxo oxo xxx\nxoo oxx oxo\nxxx oxx ooo\n\noxx xoo xxo\nxxx oox xox\nxxo o.o oxo\n9 6\n", "output": "xxo xoo xxo \nooo ooo xxx \noox oxo oxx \n\noxo oxo xxx \nxoo oxx oxo \nxxx oxx ooo \n\noxx xoo xxo \nxxx oox xox \nxxo o!o oxo \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\nA sequence $a = [a_1, a_2, \\ldo...
[{"type": "stdin_stdout", "input": "10\n3 62 24 39\n1 17\n1 99\n1 60\n1 64\n1 30\n2 79 29\n2 20 73\n2 85 37\n1 100\n", "output": "72\n"}, {"type": "stdin_stdout", "input": "10\n3 62 24 39\n1 17\n1 99\n1 60\n1 64\n1 30\n2 79 29\n2 20 73\n2 85 37\n1 100\n", "output": "72\n"}, {"type": "stdin_stdout", "input": "5\n5 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\nDropCaps means that the first le...
[{"input": "\"Revelation of the contents outraged American public opinion, and helped generate\"", "output": "[\"Revelation of The Contents Outraged American Public Opinion, And Helped Generate\"]", "fn_name": "drop_cap"}, {"input": "\"more than one space between words\"", "output": "[\"More Than One Space Betw...
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\nStudent Valera is an undergradua...
[{"type": "stdin_stdout", "input": "1\n1000000000 999999999\n", "output": "999999999\n"}, {"type": "stdin_stdout", "input": "1\n1000000000 999999999\n", "output": "999999999\n"}, {"type": "stdin_stdout", "input": "1\n1010000000 999999999\n", "output": "999999999\n"}, {"type": "stdin_stdout", "input": "1\n1010000000 498...
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 frequency operation i...
[{"type": "stdin_stdout", "input": "10\n2 5 1 -1 3 4 27 0 -2 6\n0", "output": "2\n10 10 10 10 10 10 10 10 10 10\n"}, {"type": "stdin_stdout", "input": "10\n2 1 0 0 3 5 0 0 0 12\n0", "output": "3\n10 10 10 10 10 10 10 10 10 10\n"}, {"type": "stdin_stdout", "input": "10\n2 5 1 0 3 4 27 0 -2 10\n0", "output": "2\n8 8 8 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\nArseniy is already grown-up and ...
[{"type": "stdin_stdout", "input": "10 3 3\n2 2 1 3 1 2 1 2 2 2\n10 8\n9 6\n8 10\n", "output": "0\n"}, {"type": "stdin_stdout", "input": "10 1 3\n2 2 1 3 1 2 1 2 2 2\n10 8\n9 6\n8 10\n", "output": "0\n"}, {"type": "stdin_stdout", "input": "10 1 3\n2 2 1 3 1 2 1 2 2 2\n10 8\n9 6\n3 10\n", "output": "0\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\nRead problems statements in Engl...
[{"type": "stdin_stdout", "input": "2\n3\n#..\n..#\n#..\n3\n#.#\n#.#\n#.#", "output": "3\n0\n"}, {"type": "stdin_stdout", "input": "2\n3\n#..\n\"..\n#..\n3\n#.#\n#.#\n#.#", "output": "6\n0\n"}, {"type": "stdin_stdout", "input": "2\n3\n$..\n..#\n#..\n3\n\"-#\n#.#\n\"#.", "output": "3\n1\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\nYou are given an integer n. You ...
[{"type": "stdin_stdout", "input": "5\n178 170\n26 25\n64 84\n19 12\n20 136\n", "output": "764520\n12\n1015\n6\n32483\n"}, {"type": "stdin_stdout", "input": "5\n178 170\n26 25\n64 84\n19 12\n38 136\n", "output": "764520\n12\n1015\n6\n46148\n"}, {"type": "stdin_stdout", "input": "5\n178 170\n26 25\n64 84\n19 6\n20 136\n...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nThere are three houses on a numb...
[{"type": "stdin_stdout", "input": "31 61 59", "output": "Yes\n"}, {"type": "stdin_stdout", "input": "31 61 51", "output": "Yes\n"}, {"type": "stdin_stdout", "input": "31 86 59", "output": "Yes\n"}, {"type": "stdin_stdout", "input": "39 69 59", "output": "Yes\n"}, {"type": "stdin_stdout", "input": "31 49 59", "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\nA bracket sequence is a string c...
[{"type": "stdin_stdout", "input": "10\n()()(\n)((\n)()(((()(\n(((()(\n)(()((\n))\n()()()()\n))()))((\n)\n))())(\n", "output": "2\n"}, {"type": "stdin_stdout", "input": "10\n()()(\n)((\n)()(((()(\n(((()(\n)(()((\n))\n()()()()\n))()))((\n)\n))())(\n", "output": "2\n"}, {"type": "stdin_stdout", "input": "10\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\nYour company was appointed to la...
[{"type": "stdin_stdout", "input": "3\n10 1 1\n11 4 10\n1000000 1 1000100\n", "output": "10\n16\n500049499900\n"}, {"type": "stdin_stdout", "input": "3\n10 1 1\n16 4 10\n1000000 1 1000100\n", "output": "10\n18\n500049499900\n"}, {"type": "stdin_stdout", "input": "3\n10 1 1\n16 4 10\n1000001 1 1000100\n", "output": "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\nMonocarp wants to draw four line...
[{"type": "stdin_stdout", "input": "4\n1 1 5 4\n4 16 10 4\n2 1 4 1\n100 21 54 111\n", "output": "4\n40\n2\n2100\n"}, {"type": "stdin_stdout", "input": "4\n0 5 2 4\n6 14 10 3\n2 0 5 1\n101 40 47 111\n", "output": "0\n30\n0\n4040\n"}, {"type": "stdin_stdout", "input": "4\n1 1 5 8\n4 16 10 4\n2 1 4 1\n100 21 54 111\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\nTakahashi is meeting up with Aok...
[{"type": "stdin_stdout", "input": "7202 7775 4325\n", "output": "Yes\n"}, {"type": "stdin_stdout", "input": "3982 4784 8417\n", "output": "Yes\n"}, {"type": "stdin_stdout", "input": "2156 1932 5902\n", "output": "Yes\n"}, {"type": "stdin_stdout", "input": "1 10000 10000\n", "output": "Yes\n"}, {"type": "stdin_stdout",...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\n## Your Story\n\"A *piano* in th...
[{"input": "2017", "output": "[\"white\"]", "fn_name": "black_or_white_key"}, {"input": "100", "output": "[\"black\"]", "fn_name": "black_or_white_key"}, {"input": "111", "output": "[\"white\"]", "fn_name": "black_or_white_key"}, {"input": "200", "output": "[\"black\"]", "fn_name": "black_or_white_key"}, {"input": "12"...
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 and an array of i...
[{"input": "\"abracadabra\"\n[2, 6, 9, 10]", "output": "[\"abRacaDabRA\"]", "fn_name": "capitalize"}, {"input": "\"indexinglessons\"\n[0]", "output": "[\"Indexinglessons\"]", "fn_name": "capitalize"}, {"input": "\"codewars\"\n[1, 3, 5, 50]", "output": "[\"cOdEwArs\"]", "fn_name": "capitalize"}, {"input": "\"codewarrior...
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\nIlya is a very clever lion, he l...
[{"type": "stdin_stdout", "input": "-1000000000\n", "output": "-100000000\n"}, {"type": "stdin_stdout", "input": "-1000000000\n", "output": "-100000000\n"}, {"type": "stdin_stdout", "input": "-1015555150\n", "output": "-101555510\n"}, {"type": "stdin_stdout", "input": "-1620057635\n", "output": "-162005763\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\nAddition is easy to calculate by...
[{"type": "stdin_stdout", "input": "-1 -1 -1 -1 -1 -1 -1 -1 -1", "output": "168"}, {"type": "stdin_stdout", "input": "-1 -1 -1 -1 -1 -1 3 4 6", "output": "0\n"}, {"type": "stdin_stdout", "input": "-1 -1 -1 -1 -1 -1 3 2 6", "output": "0\n"}, {"type": "stdin_stdout", "input": "-1 -1 -1 -1 -1 -2 3 2 6", "output": "0\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\nExample\n\nInput\n\n3 3 1 2 4\n1...
[{"type": "stdin_stdout", "input": "4 1 2 1 2\n1 2\n2 3\n11 0", "output": "IMPOSSIBLE\n"}, {"type": "stdin_stdout", "input": "8 1 2 1 2\n1 2\n2 3\n11 0", "output": "IMPOSSIBLE\n"}, {"type": "stdin_stdout", "input": "3 3 2 2 4\n1 2\n2 3\n3 1", "output": "IMPOSSIBLE\n"}, {"type": "stdin_stdout", "input": "3 3 2 1 4\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\nThere are $n$ computers in a row...
[{"type": "stdin_stdout", "input": "100 999999733\n", "output": "499246611\n"}, {"type": "stdin_stdout", "input": "350 999999733\n", "output": "255248393\n"}, {"type": "stdin_stdout", "input": "397 999999733\n", "output": "239189389\n"}, {"type": "stdin_stdout", "input": "398 999999733\n", "output": "875462745\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\nYou are given a tree with N vert...
[{"type": "stdin_stdout", "input": "30\n20 2 885820291\n9 3 833676138\n21 8 969316096\n13 10 732239064\n14 12 568976928\n4 14 362005859\n4 17 46938898\n4 21 706609800\n13 4 114271135\n18 13 475446302\n20 22 582315387\n7 23 941896909\n18 7 546231774\n30 24 698675648\n30 25 13971027\n11 26 760254873\n30 27 731457744\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\nJapan achieved the second straig...
[{"type": "stdin_stdout", "input": "6\nA 1 0 0 2 -1\nB 0 0 1 2 -1\nC 2 1 1 1 1\nD 2 0 -1 0 2\nE 2 0 0 0 0\nF 1 1 1 2 2\n4\nh 1 1 1\ng 0 2 2\nx -1 0 0\n` 0 2 2\n0", "output": "E\nD\nA\nB\nF\nC\nx\ng\n`\nh\n"}, {"type": "stdin_stdout", "input": "6\nA 1 0 0 2 -1\nB 0 0 1 1 0\nC 1 1 1 1 1\nD 1 1 0 0 2\nE 2 0 -1 0 0\nF 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\nJohnny drives a truck and must d...
[{"type": "stdin_stdout", "input": "281 12 23\n178 650197\n129 288456\n34 1664910\n43 683515\n305 957083\n103 724815\n105 308008\n252 1280706\n74 87088\n229 146026\n85 241042\n35 39127\n62 47524\n217 760274\n156 562141\n10 209057\n50 714473\n201 164128\n97 624021\n120 102709\n147 388268\n317 1546753\n190 1448117\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\nFast Forwarding\n\nMr. Anderson ...
[{"type": "stdin_stdout", "input": "2139", "output": "21\n"}, {"type": "stdin_stdout", "input": "1374", "output": "22\n"}, {"type": "stdin_stdout", "input": "3723", "output": "23\n"}, {"type": "stdin_stdout", "input": "138", "output": "12\n"}, {"type": "stdin_stdout", "input": "149", "output": "13\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\nWhen Serezha was three years old...
[{"type": "stdin_stdout", "input": "400\nzzzerrzrzzrozrezooreroeoeezerrzeerooereezeeererrezrororoorrzezoeerrorzrezzrzoerrzorrooerzrzeozrrorzzzzeoeereeroeozezeozoozooereoeorrzoroeoezooeerorreeorezeozeroerezoerooooeerozrrorzozeroereerozeozeoerroroereeeerzzrzeeozrezzozeoooeerzzzorozrzezrrorozezoorzzerzroeeeerorreeoezoeroe...
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 sequence (P_1,P_...
[{"type": "stdin_stdout", "input": "8\n6\n3\n2\n1\n7\n4\n8\n5", "output": "5\n"}, {"type": "stdin_stdout", "input": "8\n6\n3\n1\n2\n5\n4\n8\n7", "output": "6\n"}, {"type": "stdin_stdout", "input": "8\n6\n3\n2\n1\n4\n7\n8\n5", "output": "5\n"}, {"type": "stdin_stdout", "input": "8\n6\n3\n2\n1\n7\n4\n5\n8", "output": "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\nOn a chessboard with a width of ...
[{"type": "stdin_stdout", "input": "1000000000000000000\n1000000000000000010 1000000000000000000\n", "output": "black\n"}, {"type": "stdin_stdout", "input": "1000000000000000000\n1100000000000000010 1000000000000000000\n", "output": "black\n"}, {"type": "stdin_stdout", "input": "1000000000000000000\n1100000000000001010...
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\nKnights' tournaments were quite ...
[{"type": "stdin_stdout", "input": "14", "output": "0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nA motorcade of n trucks, driving...
[{"type": "stdin_stdout", "input": "20\n7892 2 0 24\n4201 1 2 23\n3667 1 3 22\n6388 1 4 21\n2406 1 5 20\n1148 1 6 19\n3958 1 7 18\n7363 1 8 17\n9025 2 9 15\n1909 1 11 14\n73 1 12 13\n5477 2 13 11\n1869 1 15 10\n107 1 16 9\n523 1 17 8\n6589 2 18 6\n6277 2 20 4\n3881 1 22 3\n5771 1 23 2\n622 2 24 0\n", "output": "20\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\n# Task\n Sorting is one of the m...
[{"input": "[9, 9, 9, 9, 9, 8, 8, 8, 8, 7, 7, 7, 7, 7, 7]", "output": "[6]", "fn_name": "exchange_sort"}, {"input": "[9, 9, 9, 7, 7, 8, 9, 7, 8, 9, 7, 9]", "output": "[4]", "fn_name": "exchange_sort"}, {"input": "[8, 8, 7, 9, 9, 9, 8, 9, 7]", "output": "[4]", "fn_name": "exchange_sort"}, {"input": "[7, 7, 8, 8, 9, 9]",...
code_functional
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nWrite a program which reads a $ ...
[{"type": "stdin_stdout", "input": "3 4\n1 4 -2 1\n0 3 0 -1\n4 1 0 0\n0\n-2\n3\n0", "output": "-14\n-6\n-2\n"}, {"type": "stdin_stdout", "input": "3 4\n0 7 -13 0\n0 0 0 1\n4 2 2 0\n1\n1\n3\n-1", "output": "-32\n-1\n12\n"}, {"type": "stdin_stdout", "input": "3 4\n0 7 -13 0\n0 0 0 1\n4 2 2 0\n1\n2\n3\n-1", "output": "-25...
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\nBitwise exclusive OR (or bitwise...
[{"type": "stdin_stdout", "input": "9992164445234764941\n8162963574901971597\n", "output": "914600435166396672 9077564010068368269"}, {"type": "stdin_stdout", "input": "1367480970723947\n584615739735395\n", "output": "391432615494276 976048355229671"}, {"type": "stdin_stdout", "input": "339671107814\n208405902980\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\nLet's suppose you have an array ...
[{"type": "stdin_stdout", "input": "40 39\n25 4 26 34 35 11 22 23 21 2 1 28 20 8 36 5 27 15 39 7 24 14 17 19 33 6 38 16 18 3 32 10 30 13 37 31 29 9 12\n", "output": "-1\n"}, {"type": "stdin_stdout", "input": "40 39\n25 4 26 34 35 11 22 23 21 2 1 28 20 8 36 5 27 15 39 7 24 14 17 19 33 6 38 16 18 3 32 10 30 13 37 31 29 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\nRecall that string $a$ is a subs...
[{"type": "stdin_stdout", "input": "ovvvvovovvvvovoovovovovvvvvvvoovoovvovvoooooovo\n", "output": "463\n"}, {"type": "stdin_stdout", "input": "ovvvvovovvvvovoovovovovvvvvvvoovoovvovvoooooovo\n", "output": "463\n"}, {"type": "stdin_stdout", "input": "vvovooovovvovoovoovvvvovovvvov\n", "output": "100\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\nStudents of group 199 have writt...
[{"type": "stdin_stdout", "input": "10\n9 10 6 8 5 3 1 7 4 2\n7 6 2 9 5 10 8 4 1 3\n", "output": "8 3 10 1 5 2 4 9 7 6 "}, {"type": "stdin_stdout", "input": "10\n2 9 1 7 6 8 5 4 10 3\n6 8 5 1 9 10 2 3 4 7\n", "output": "5 6 7 3 2 9 1 10 8 4 "}, {"type": "stdin_stdout", "input": "10\n5 9 7 1 4 10 3 6 2 8\n8 3 9 10 6 5 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\nYou are given n points on the pl...
[{"type": "stdin_stdout", "input": "20\n-2967010 48581504\n-2967318 48581765\n-2967443 48581988\n-2967541 48582265\n-2967443 48582542\n-2967318 48582765\n-2967010 48583026\n-2966691 48583154\n-2966252 48583234\n-2965813 48583154\n-2965494 48583026\n-2965186 48582765\n-2965061 48582542\n-2964963 48582265\n-2965061 48581...
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# Esolang Interpreters #2 - Cust...
[{"input": "\"*>*>>>*>*>>>>>*>[>*]\"\n\"0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000\"", "output": "[\"11001...
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 string S of leng...
[{"type": "stdin_stdout", "input": "5\naabbc", "output": "17\n"}, {"type": "stdin_stdout", "input": "5\nabcda", "output": "23\n"}, {"type": "stdin_stdout", "input": "5\nbdacf", "output": "31\n"}, {"type": "stdin_stdout", "input": "5\nabcaa", "output": "15\n"}, {"type": "stdin_stdout", "input": "5\nabbaa", "output": "11...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nThere are N mountains in a circl...
[{"type": "stdin_stdout", "input": "4347\n260851 113568 146755 277208 291368 365593 306158 216020 344668 347475 275144 352224 284362 117882 195739 364750 445348 416819 269652 99635 82915 80392 51627 75388 237943 322687 343290 419290 298882 162789 250158 343046 283281 278723 215017 105840 263209 271290 119076 276553 322...
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 only difference between easy...
[{"type": "stdin_stdout", "input": "100\n2\n8\n5\n6\n5\n4\n4\n6\n12\n2\n9\n5\n10\n8\n4\n10\n9\n6\n9\n4\n5\n6\n4\n4\n7\n1\n2\n2\n5\n6\n1\n5\n10\n9\n10\n16\n3\n2\n2\n3\n2\n7\n9\n2\n9\n5\n7\n8\n1\n5\n2\n5\n1\n3\n8\n4\n7\n9\n3\n1\n7\n1\n2\n4\n7\n2\n7\n1\n1\n10\n8\n5\n7\n12\n10\n8\n1\n7\n5\n10\n7\n6\n6\n6\n7\n4\n9\n3\n4\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\nSeveral days ago you bought a ne...
[{"type": "stdin_stdout", "input": "69\n2 6\n2 6\n2 6\n2 6\n2 6\n2 6\n2 6\n2 6\n2 6\n2 6\n2 6\n2 6\n2 6\n2 6\n2 6\n2 6\n2 6\n2 6\n2 6\n2 6\n2 15\n2 6\n2 6\n2 6\n2 6\n2 6\n2 11\n2 6\n2 6\n2 6\n2 6\n2 6\n2 6\n2 6\n2 7\n2 11\n2 6\n2 6\n2 6\n2 6\n4 6\n2 6\n2 6\n2 6\n2 6\n2 6\n2 6\n2 6\n2 6\n2 6\n2 6\n2 6\n2 6\n2 6\n2 6\n2 ...
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\nTaro and Hanako have numbers of ...
[{"type": "stdin_stdout", "input": "2 2\n1\n6\n3\n14\n6 5\n3\n4\n5\n2\n4\n7\n11\n2\n7\n4\n1\n4 5\n10\n-1\n3\n11\n1\n9\n6\n0\n1\n7 4\n1\n0\n4\n0\n2\n1\n4\n4\n2\n1\n-1\n2 3\n0\n1\n2\n4\n2\n0 0", "output": "-1\n2 2\n3 0\n2 -1\n-1\n"}, {"type": "stdin_stdout", "input": "2 2\n1\n6\n3\n14\n6 5\n3\n4\n5\n2\n4\n7\n11\n2\n7\n4\...
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\nInzane finally found Zane with a...
[{"type": "stdin_stdout", "input": "11 1 5\n6\n1 2\n2 3\n3 4\n4 5\n5 6\n6 11\n7 8\n8 9\n9 10\n10 11\n", "output": "0\n\n"}, {"type": "stdin_stdout", "input": "11 1 5\n6\n1 2\n2 3\n3 4\n4 5\n5 6\n6 7\n7 8\n8 9\n9 10\n10 11\n", "output": "0\n"}, {"type": "stdin_stdout", "input": "11 1 5\n6\n1 2\n2 3\n3 4\n4 5\n5 6\n6 7\n...
code_stdio