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\nLittle Artem has invented a time...
[{"type": "stdin_stdout", "input": "10\n1 1 1000000000\n1 4 1000000000\n2 2 1000000000\n1 5 1000000000\n1 8 1000000000\n2 15 1000000000\n3 3 1000000000\n3 10 1000000000\n3 6 1000000000\n3 7 1000000000\n", "output": "0\n3\n2\n2\n"}, {"type": "stdin_stdout", "input": "10\n1 1 1000000000\n1 4 1000000000\n2 2 1000000000\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\nThere are N holes in a two-dimen...
[{"type": "stdin_stdout", "input": "5\n0 0\n2 8\n4 5\n2 6\n3 10", "output": "0.43160120892732328768\n0.03480224363653196956\n0.13880483535586193855\n0.00000000000000000000\n0.39479171208028279727"}, {"type": "stdin_stdout", "input": "5\n1 0\n2 13\n-1 1\n4 10\n3 10", "output": "0.277405019286\n0.367426913906\n0.21519775...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 two positive integ...
[{"type": "stdin_stdout", "input": "100000", "output": "10"}, {"type": "stdin_stdout", "input": "1697", "output": "23\n"}, {"type": "stdin_stdout", "input": "199", "output": "19\n"}, {"type": "stdin_stdout", "input": "178", "output": "16\n"}, {"type": "stdin_stdout", "input": "389", "output": "20\n"}, {"type": "stdin_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\nRead problems statements in Mand...
[{"type": "stdin_stdout", "input": "2\n19 4 6\n1 4 6 7\n1 2 3 4 6 8\n12 2 2\n1 4\n1 4", "output": "3 12\n2 10\n"}, {"type": "stdin_stdout", "input": "2\n19 4 6\n1 4 6 7\n1 2 3 4 6 7\n12 2 2\n1 4\n1 4", "output": "4 13\n2 10\n"}, {"type": "stdin_stdout", "input": "2\n17 4 6\n1 3 6 11\n1 2 3 5 6 7\n5 2 2\n2 4\n3 4", "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 huge decimal num...
[{"type": "stdin_stdout", "input": "213 5 3\n111001111110111001101011111100010010011001000001111010110110011000100000101010111110010001111110001010011001101000000011111110101001101100100100110100000111111100010100011010010001011100111011000001110000111000101\n", "output": "3\n"}, {"type": "stdin_stdout", "input": "213 ...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nMaya writes weekly articles to a...
[{"input": "103247", "output": "[\"boiled\"]", "fn_name": "hidden"}, {"input": "942547", "output": "[\"melted\"]", "fn_name": "hidden"}, {"input": "49632", "output": "[\"email\"]", "fn_name": "hidden"}, {"input": "12674", "output": "[\"blade\"]", "fn_name": "hidden"}, {"input": "56124", "output": "[\"table\"]", "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\nIf you draw a few infinitely lon...
[{"type": "stdin_stdout", "input": "1\n705", "output": "2\n248866\n"}, {"type": "stdin_stdout", "input": "1\n506", "output": "2\n128272\n"}, {"type": "stdin_stdout", "input": "1\n154", "output": "2\n11936\n"}, {"type": "stdin_stdout", "input": "1\n238", "output": "2\n28442\n"}, {"type": "stdin_stdout", "input": "1\n373...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nMr. E Ven only likes even length...
[{"input": "\"underscore is not considered a word..in this case,\"", "output": "[\"underscore is nott considered aa wordin this case\"]", "fn_name": "evenator"}, {"input": "\"lorem is so ipsum. why bother?\"", "output": "[\"loremm is so ipsumm whyy bother\"]", "fn_name": "evenator"}, {"input": "\"hi. how are you? Bye!!...
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\nAt 17:00, special agent Jack sta...
[{"type": "stdin_stdout", "input": "6 6\n4 4 X X T T\n4 7 8 2 X 7\n1 X X X 1 8\n1 2 X X X 6\n1 1 2 4 4 7\nS S 2 3 X X\n2 10\nT 1\n1 X\n1 X\n1 X\n1 1\n1 X\n1 X\n1 1\n1 X\nS S\n2 10\nT X\n1 X\n1 X\n1 X\n1 1\n1 X\n1 X\n1 1\n1 X\nS S\n10 10\nT T T T T T T T T T\nX 2 X X X X X 3 4 X\n9 8 9 X X X 2 9 X 9\n7 7 X 7 3 X X 8 9 X...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 kata is from check py.check...
[{"input": "[1, 1, 1, 1, 1, 1, 1, 1, 1, 100]\n9", "output": "[1000000000000000000]", "fn_name": "index"}, {"input": "[75, 68, 35, 61, 9, 36, 89, 0, 30]\n10", "output": "[-1]", "fn_name": "index"}, {"input": "[1, 1, 1, 1, 1, 1, 1, 1, 1, 1]\n9", "output": "[1]", "fn_name": "index"}, {"input": "[1, 3, 10, 100]\n3", "outpu...
code_functional
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nThe official capital and the cul...
[{"type": "stdin_stdout", "input": "20 102\n73 79 75 27\n13 15 62 47\n74 75 85 86\n49 81 23 69\n43 17 45 27\n35 14 90 35\n51 74 35 33\n54 66 46 24\n33 76 49 3\n34 53 25 76\n69 72 76 31\n41 31 8 48\n49 48 85 24\n19 2 59 83\n19 31 51 86\n31 10 45 76\n56 47 79 86\n49 33 15 1\n77 89 26 64\n7 52 76 77\n", "output": "59201\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\nNezzar has $n$ balls, numbered w...
[{"type": "stdin_stdout", "input": "5\n6\n1 1 1 2 3 4\n5\n1 1 2 2 3\n4\n2 2 2 2\n3\n1 2 3\n1\n1\n", "output": "\n3\n2\n4\n1\n1\n"}, {"type": "stdin_stdout", "input": "5\n6\n1 1 1 2 3 4\n5\n1 1 2 2 3\n4\n2 2 2 2\n3\n1 2 3\n1\n1\n", "output": "3\n2\n4\n1\n1\n"}, {"type": "stdin_stdout", "input": "5\n6\n1 1 1 2 3 4\n5\n1 ...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nWe, the researchers who discover...
[{"type": "stdin_stdout", "input": "aaaabaaaabaaaabaaaab\naabaa", "output": "1576\n"}, {"type": "stdin_stdout", "input": "aaaabaaaabaa`abaaaab\naabaa", "output": "1248\n"}, {"type": "stdin_stdout", "input": "aaaabaaaabaa`ababaaa\naabaa", "output": "1446\n"}, {"type": "stdin_stdout", "input": "aaaabaaaabaaaabaaaab\nbaaa...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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": "26\nlolthisiscoolfreehackforya\n", "output": "llthisiscoolfreehackforya\n"}, {"type": "stdin_stdout", "input": "26\nlolthisiscoolfreehackforya\n", "output": "llthisiscoolfreehackforya\n"}, {"type": "stdin_stdout", "input": "26\nlolthisiscoolfrfehackforya\n", "output": "llthisiscoolfr...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nOmkar is playing his favorite pi...
[{"type": "stdin_stdout", "input": "5\n4\nRLRL\n6\nLRRRRL\n8\nRLLRRRLL\n12\nLLLLRRLRRRLL\n5\nRRRRR\n", "output": "0\n1\n1\n3\n2\n"}, {"type": "stdin_stdout", "input": "5\n4\nRLRL\n6\nLRRRRL\n8\nRLLRRRLL\n12\nLLRRRLRRLLLL\n5\nRRRRR\n", "output": "0\n1\n1\n3\n2\n"}, {"type": "stdin_stdout", "input": "5\n4\nRLRL\n6\nRRRLR...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nNotice that the memory limit is ...
[{"type": "stdin_stdout", "input": "50\n97 97\n61 61\n59 59\n29 29\n13 13\n7 7\n5 5\n3 3\n1 1\n3 3\n1 1\n13 13\n11 11\n9 9\n3 3\n1 1\n1 1\n1 1\n27 27\n25 25\n1 1\n21 21\n19 19\n17 17\n15 15\n5 5\n1 1\n1 1\n7 7\n1 1\n3 3\n1 1\n15 15\n13 13\n1 1\n9 9\n7 7\n5 5\n3 3\n1 1\n15 15\n5 5\n1 1\n1 1\n3 3\n1 1\n1 1\n1 1\n1 1\n1 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\nWherever the destination is, who...
[{"type": "stdin_stdout", "input": "20 50000 50000\n2 45955 55488\n1 19804 29337\n2 3767 90811\n2 24025 33558\n1 46985 56518\n2 21094 30627\n2 5787 15320\n1 4262 91306\n2 37231 46764\n1 18125 27658\n1 36532 12317\n1 31330 40863\n1 18992 28525\n1 29387 38920\n1 44654 54187\n2 45485 55018\n2 36850 46383\n1 44649 54182\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\nWe ask you to select some number...
[{"type": "stdin_stdout", "input": "103 135 85", "output": "YES\n"}, {"type": "stdin_stdout", "input": "1 100 97\n", "output": "YES\n"}, {"type": "stdin_stdout", "input": "40 98 58\n", "output": "YES\n"}, {"type": "stdin_stdout", "input": "103 98 58", "output": "YES\n"}, {"type": "stdin_stdout", "input": "103 98 87", "...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 looking at the floor pla...
[{"type": "stdin_stdout", "input": "100000000 100000000 100000000 100000000 1\n100000000 100000000 100001000 1\n", "output": "100000999\n"}, {"type": "stdin_stdout", "input": "100000000 100000000 100000000 100000000 1\n100000000 100000000 100000000 1\n", "output": "99999999\n"}, {"type": "stdin_stdout", "input": "10000...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nWe have a rectangular grid of sq...
[{"type": "stdin_stdout", "input": "2 6 11\n2 1\nRLDRRUDDLRL\nURRDRLLDLRD", "output": "NO\n"}, {"type": "stdin_stdout", "input": "5 6 11\n2 0\nRLDRRUDDLRL\nURRDRLLDLRD", "output": "NO\n"}, {"type": "stdin_stdout", "input": "4 6 11\n2 1\nRLDRRUDDLRL\nURRDRLLDLRD", "output": "NO\n"}, {"type": "stdin_stdout", "input": "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\nFor an array $b$ of length $m$ w...
[{"type": "stdin_stdout", "input": "6\n0 1 6 12 51 68\n4\n1 6\n2 6\n3 3\n2 4\n", "output": "125\n125\n6\n13\n"}, {"type": "stdin_stdout", "input": "6\n1 2 4 12 16 32\n4\n1 6\n2 6\n3 4\n1 4\n", "output": "56\n56\n12\n14\n"}, {"type": "stdin_stdout", "input": "6\n1 2 4 12 32 32\n4\n1 6\n2 6\n3 4\n1 4\n", "output": "44\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\nAt Akabeko Elementary School, al...
[{"type": "stdin_stdout", "input": "2\n3 4\n13 4\n5\n789 289\n166 46\n9 4\n617 272\n972 303\n2\n11 5\n23 20\n0", "output": "13\n3\n1598397732\n1209243492\n1939462992\n1923746112\n1360317793\n23\n44\n"}, {"type": "stdin_stdout", "input": "2\n3 4\n13 4\n5\n789 289\n166 46\n9 4\n617 272\n972 303\n2\n11 5\n32 20\n0", "outp...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nNow I have a card with n numbers...
[{"type": "stdin_stdout", "input": "4\n2\n8\n6\n10", "output": "1177916\n"}, {"type": "stdin_stdout", "input": "4\n4\n8\n6\n10", "output": "1315948\n"}, {"type": "stdin_stdout", "input": "4\n1\n5\n7\n17", "output": "1022430\n"}, {"type": "stdin_stdout", "input": "4\n4\n8\n3\n10", "output": "1108900\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\nA **bouncy number** is a positiv...
[{"input": "129347924210", "output": "[true]", "fn_name": "is_bouncy"}, {"input": "92722983", "output": "[true]", "fn_name": "is_bouncy"}, {"input": "234689", "output": "[false]", "fn_name": "is_bouncy"}, {"input": "98874", "output": "[false]", "fn_name": "is_bouncy"}, {"input": "2379", "output": "[false]", "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\nAssume that you started to store...
[{"input": "25", "output": "[3]", "fn_name": "layers"}, {"input": "30", "output": "[4]", "fn_name": "layers"}, {"input": "50", "output": "[5]", "fn_name": "layers"}, {"input": "1", "output": "[1]", "fn_name": "layers"}, {"input": "5", "output": "[2]", "fn_name": "layers"}]
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\nTaking into consideration the [3...
[{"input": "20", "output": "[{\"modifier\": 5, \"maximum_spell_level\": 9, \"extra_spells\": [2, 1, 1, 1, 1]}]", "fn_name": "char_attribute"}, {"input": "1", "output": "[{\"modifier\": -5, \"maximum_spell_level\": -1, \"extra_spells\": []}]", "fn_name": "char_attribute"}, {"input": "5", "output": "[{\"modifier\": -3, \...
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 named `first_no...
[{"input": "\"Go hang a salami, I'm a lasagna hog!\"", "output": "[\",\"]", "fn_name": "first_non_repeating_letter"}, {"input": "\"hello world, eh?\"", "output": "[\"w\"]", "fn_name": "first_non_repeating_letter"}, {"input": "\"moonmen\"", "output": "[\"e\"]", "fn_name": "first_non_repeating_letter"}, {"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 has got a robot which is s...
[{"type": "stdin_stdout", "input": "386\nRUDLURLUURDDLLLRLDURLRRDLDUUURLLRDLRRDLDRLDDURDURURDRLUULLDUULRULDLLLLDLUURRLRRRUDULRDDRDLDULRLDDRDDRLRLDLDULLULUDULLLDUUDURURDDLDRLUDDDDLDUDUURLUUDURRUDRLUDRLULLRLRRDLULDRRURUULLRDLDRLURDUDRLDLRLLUURLURDUUDRDURUDDLLDURURLLRRULURULRRLDLDRLLUUURURDRRRLRDRURULUDURRLRLDRUDLRRRRLLRU...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 country live wizards. Th...
[{"type": "stdin_stdout", "input": "66\n7 0\n5 7\n1 3\n3 2\n3 5\n0 6\n1 2\n0 7\n4 5\n4 7\n5 1\n2 0\n4 0\n0 5\n3 6\n7 2\n6 0\n5 3\n6 6\n1 7\n5 6\n2 2\n3 4\n2 0\n5 3\n4 6\n6 1\n5 3\n100000000000 0000000000000000000\n0 1\n4 1\n2 6\n5 5\n4 5\n0 3\n3 7\n3 1\n1 0\n4 4\n1000000000000000000 100000000000\n12 6\n4 2\n7 5\n1 6\n6...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 hash of letters and the ...
[{"input": "{\"2\": [\"i\", \"a\"], \"1\": [\"z\", \"x\"]}", "output": "[[\"aaiixz\", \"aaiizx\", \"aaixiz\", \"aaixzi\", \"aaizix\", \"aaizxi\", \"aaxiiz\", \"aaxizi\", \"aaxzii\", \"aaziix\", \"aazixi\", \"aazxii\", \"aiaixz\", \"aiaizx\", \"aiaxiz\", \"aiaxzi\", \"aiazix\", \"aiazxi\", \"aiiaxz\", \"aiiazx\", \"aiix...
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\nAs AtCoder Beginner Contest 100 ...
[{"type": "stdin_stdout", "input": "10000\n126382592 432418816 117063168 213396480 379143680 515038208 324231168 266539520 602792960 314653184 650153984 883734016 33309696 9005056 46451200 158759424 33279488 319342080 499438080 853167616 310094336 919876608 882363392 132034048 288561664 745817600 28561408 9703936 79297...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nFor a given positive integer n d...
[{"type": "stdin_stdout", "input": "1005856822 8\n", "output": "50292841100000000\n"}, {"type": "stdin_stdout", "input": "1522186596 8\n", "output": "38054664900000000\n"}, {"type": "stdin_stdout", "input": "123456789 8\n", "output": "12345678900000000\n"}, {"type": "stdin_stdout", "input": "999999999 8\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 the string s of le...
[{"type": "stdin_stdout", "input": "100 1 1\naaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaabbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb\n", "output": "100\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\nb\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\nIn this problem you have to solv...
[{"type": "stdin_stdout", "input": "-116\n", "output": "0\n1\n1\n0\n1\n1\n0\n1\n1\n1\n1\n1\n0\n1\n0\n1\n1\n1\n0\n1\n1\n1\n1\n1\n0\n1\n0\n1\n1\n1\n"}, {"type": "stdin_stdout", "input": "-132\n", "output": "0\n1\n1\n0\n1\n1\n0\n1\n1\n1\n1\n1\n0\n1\n0\n1\n1\n1\n0\n1\n1\n1\n1\n1\n0\n1\n0\n1\n1\n1\n"}, {"type": "stdin_stdou...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nVus the Cossack holds a programm...
[{"type": "stdin_stdout", "input": "100 100 100\n", "output": "Yes\n"}, {"type": "stdin_stdout", "input": "100 100 100\n", "output": "Yes\n"}, {"type": "stdin_stdout", "input": "000 100 000\n", "output": "YES\n"}, {"type": "stdin_stdout", "input": "000 100 100\n", "output": "YES\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\nA substring of some string is ca...
[{"type": "stdin_stdout", "input": "76\namnctposz\nmnctpos\nos\nu\ne\nam\namnc\neamnctpo\nl\nx\nq\nposzq\neamnc\nctposzq\nctpos\nmnc\ntpos\namnctposzql\ntposzq\nmnctposz\nnctpos\nctposzql\namnctpos\nmnct\np\nux\nposzql\ntpo\nmnctposzql\nmnctp\neamnctpos\namnct\ntposzql\nposz\nz\nct\namnctpo\noszq\neamnct\ntposz\ns\nmn\...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 which outputs t...
[{"input": "\"(a(b)c()d)\"", "output": "[{\"0\": 9, \"2\": 4, \"6\": 7}]", "fn_name": "bracket_pairs"}, {"input": "\"len(list)\"", "output": "[{\"3\": 8}]", "fn_name": "bracket_pairs"}, {"input": "\"f(x[0])\"", "output": "[{\"1\": 6}]", "fn_name": "bracket_pairs"}, {"input": "\"def f(x\"", "output": "[false]", "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\nAddition of Big Integers\n\nGive...
[{"type": "stdin_stdout", "input": "109 30", "output": "139\n"}, {"type": "stdin_stdout", "input": "195 30", "output": "225\n"}, {"type": "stdin_stdout", "input": "302 30", "output": "332\n"}, {"type": "stdin_stdout", "input": "552 30", "output": "582\n"}, {"type": "stdin_stdout", "input": "139 37", "output": "176\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\nDiamond Miner is a game that is ...
[{"type": "stdin_stdout", "input": "3\n2\n0 1\n1 0\n0 -1\n-2 0\n4\n1 0\n3 0\n-5 0\n6 0\n0 3\n0 1\n0 2\n0 4\n5\n3 0\n0 4\n0 -3\n4 0\n2 0\n2 0\n-3 0\n0 -10\n0 -1\n0 -10\n", "output": "3.6502815398728847\n18.061819283610365\n32.052255376143336\n"}, {"type": "stdin_stdout", "input": "3\n2\n0 1\n1 0\n0 -1\n-2 0\n4\n1 0\n3 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\nKate has a set $S$ of $n$ intege...
[{"type": "stdin_stdout", "input": "21031\n", "output": "1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nA string is called palindrome if...
[{"type": "stdin_stdout", "input": "wrwrwfrrfrffrrwwwffffwrfrrwfrrfrwwfwfrwfwfwffwrrwfrrrwwwfrrrwfrrfwrwwrwrrrffffwrrrwrwfffwrffrwwwrwww\n", "output": "fffffffffffffffrrrrrrrrrrrrrrrrrrwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwrrrrrrrrrrrrrrrrrrfffffffffffffff\n"}, {"type": "stdin_stdout", "input": "wrwrwfrrfrffrrwwwffffwrfrrw...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 might have heard about our n...
[{"type": "stdin_stdout", "input": "2\n4 INDIAN\nCONTEST_WON 1\nTOP_CONTRIBUTOR\nBUG_FOUND 100\nCONTEST_HOSTED\n4 NON_INDIAN\nCONTEST_WON 1\nTOP_CONTRIBUTOR\nBUG_FOUND 100\nCONTEST_HOSTED\n", "output": "3\n1\n"}, {"type": "stdin_stdout", "input": "2\n4 INDIAN\nCONTEST_WON 0\nTOP_CONTRIBUTOR\nBUG_FOUND 110\nCONTEST_HOST...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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": "10 4\n2 3 3 1 1 2 1 4 3 3\n", "output": "4\n4 1 3 2\n"}, {"type": "stdin_stdout", "input": "10 4\n2 3 5 1 1 2 1 4 3 3\n", "output": "4\n4 1 5 3\n"}, {"type": "stdin_stdout", "input": "10 4\n2 3 5 2 1 2 1 4 2 3\n", "output": "4\n3 2 4 1\n"}, {"type": "stdin_stdout", "input": "10 4\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\nAccording to Berland laws it is ...
[{"type": "stdin_stdout", "input": "4\n1475\nKXJURNYJHVLVKULJBPRBCZSOTKNTOGKGFKIQDQEMEAFTPNXQTIQWROI\nKTR\nRHVRWGODYWWTYZFLFYKCVUFFRTQDINKNWPKFHZBFWBHWINWJW\n", "output": "0\n"}, {"type": "stdin_stdout", "input": "4\n1475\nKXJURNYJHVLVKULJBPRBCZSOTKNTOGKGFKIQDQEMEAFTPNXQTIQWROI\nRTK\nRHVRWGODYWWTYZFLFYKCVUFFRTQDINKNWPK...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 $a_1, a...
[{"type": "stdin_stdout", "input": "100 1186\n619 240 80 547 446 128 43 285 725 220 56 690 770 431 777 5 41 549 405 203 2 477 919 481 453 787 680 326 318 241 942 497 504 324 598 925 346 628 851 38 355 493 748 685 901 63 698 676 154 162 313 964 455 617 381 41 479 746 83 253 164 907 950 918 264 307 980 743 257 322 845 41...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 problem is used an extre...
[{"type": "stdin_stdout", "input": "<table><tr><td><table><tr><td><table><tr><td><table><tr><td><table><tr><td><table><tr><td><table><tr><td><table><tr><td><table><tr><td><table><tr><td><table><tr><td><table><tr><td><table><tr><td><table><tr><td></td></tr></table></td></tr></table></td></tr></table></td></tr></table></...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 simple exercise, you wil...
[{"input": "4\n27", "output": "[[4, 8, 12, 16, 20, 24]]", "fn_name": "find_multiples"}, {"input": "5\n25", "output": "[[5, 10, 15, 20, 25]]", "fn_name": "find_multiples"}, {"input": "11\n54", "output": "[[11, 22, 33, 44]]", "fn_name": "find_multiples"}, {"input": "1\n2", "output": "[[1, 2]]", "fn_name": "find_multiples...
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\nOne day shooshuns found a sequen...
[{"type": "stdin_stdout", "input": "20 20\n20 1 19 2 18 3 17 4 16 5 15 6 14 7 13 8 12 9 11 10\n", "output": "19\n"}, {"type": "stdin_stdout", "input": "20 10\n1 2 3 4 8 6 7 10 9 10 1 1 1 1 1 1 1 1 1 1\n", "output": "-1\n"}, {"type": "stdin_stdout", "input": "20 10\n1 2 3 4 8 6 7 10 9 10 1 1 1 1 0 1 1 1 1 1\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\nMr. A, who will graduate next sp...
[{"type": "stdin_stdout", "input": "6\n0 1 80\n1 3 20\n0 2 60\n2 4 50\n3 2 66\n0 4 165\n2\n0 1 1\n1 2 1\n0", "output": "2 262\n1 2\n"}, {"type": "stdin_stdout", "input": "6\n0 1 80\n1 3 20\n0 2 60\n2 4 50\n3 2 66\n0 4 165\n2\n0 1 1\n0 2 1\n0", "output": "2 262\n0 2\n"}, {"type": "stdin_stdout", "input": "6\n0 1 113\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\nB: Dansunau www --Dance Now!-\n\...
[{"type": "stdin_stdout", "input": "9\n9 8 7 6 9 5 3 2 1\n1 1 1\n3 4 2\n4 3 3\n4 0 4\n5 10 5\n12 9 7\n7 7 7\n8 11 8\n9 11 9", "output": "3\n"}, {"type": "stdin_stdout", "input": "9\n9 8 7 6 9 5 3 2 1\n1 1 1\n3 4 2\n4 3 3\n4 0 4\n5 10 5\n12 9 7\n7 7 7\n8 8 8\n9 11 9", "output": "3\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\nproblem\n\nFive students, Taro, ...
[{"type": "stdin_stdout", "input": "10\n130\n100\n37\n101", "output": "82\n"}, {"type": "stdin_stdout", "input": "10\n130\n100\n65\n101", "output": "87\n"}, {"type": "stdin_stdout", "input": "10\n130\n100\n98\n101", "output": "93\n"}, {"type": "stdin_stdout", "input": "10\n130\n110\n98\n100", "output": "95\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\nWrite a program which computes t...
[{"type": "stdin_stdout", "input": "34 12\n234598000 42842091", "output": "2 204\n1 10050668864418000\n"}, {"type": "stdin_stdout", "input": "34 12\n234598000 60832539", "output": "2 204\n1 14271191984322000\n"}, {"type": "stdin_stdout", "input": "34 9\n234598000 42842091", "output": "1 306\n1 10050668864418000\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\nTakahashi has a lot of peculiar ...
[{"type": "stdin_stdout", "input": "4 123456789\nAABA", "output": "BABA\n"}, {"type": "stdin_stdout", "input": "4 110986646\nAABB", "output": "BABA\n"}, {"type": "stdin_stdout", "input": "4 123456789\nAAAA", "output": "BABA\n"}, {"type": "stdin_stdout", "input": "4 110986646\nBABA", "output": "BABA\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\nThere is a programming language ...
[{"type": "stdin_stdout", "input": "2 100\n44\n1 2\n2 2\n2 2\n1 2\n1 1\n2 2\n2 2\n1 2\n1 1\n1 1\n1 2\n1 1\n1 2\n1 1\n2 2\n1 1\n1 2\n2 2\n1 2\n1 2\n2 2\n2 2\n1 2\n1 1\n1 1\n1 2\n1 1\n2 2\n1 2\n1 2\n2 2\n1 2\n1 2\n2 2\n1 2\n2 2\n1 1\n1 1\n1 2\n1 2\n2 2\n1 2\n1 1\n1 2\n1 2\n2 2\n1 1\n2 2\n1 2\n1 1\n2 2\n1 1\n1 2\n2 2\n1 2...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nSee the following triangle:\n```...
[{"input": "50", "output": "[[1625625, 1235000, 390625]]", "fn_name": "mult_triangle"}, {"input": "10", "output": "[[3025, 2400, 625]]", "fn_name": "mult_triangle"}, {"input": "5", "output": "[[225, 144, 81]]", "fn_name": "mult_triangle"}, {"input": "4", "output": "[[100, 84, 16]]", "fn_name": "mult_triangle"}, {"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\nStep through my `green glass doo...
[{"input": "\"airplane\"", "output": "[false]", "fn_name": "step_through_with"}, {"input": "\"aardvark\"", "output": "[true]", "fn_name": "step_through_with"}, {"input": "\"glasses\"", "output": "[true]", "fn_name": "step_through_with"}, {"input": "\"branch\"", "output": "[false]", "fn_name": "step_through_with"}, {"in...
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\n10^{10^{10}} participants, inclu...
[{"type": "stdin_stdout", "input": "99\n207579013 207579013\n376140463 376140463\n186969586 186969586\n326402540 326402540\n158176573 158176573\n127860890 127860890\n570870045 570870045\n178509023 178509023\n61263305 61263305\n558212775 558212775\n26389630 26389630\n496148000 496148000\n837151741 837151741\n656585276 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\nAfter you had helped Fedor to fi...
[{"type": "stdin_stdout", "input": "2\nABBABAABBAABABBABAABABBAABBABAABBAABABBAABBABAABABBABAABBAABABBA ABBABAABBAABABBABAABABBAABBABAABBAABABBAABBABAABABBABAABBAABABA\n2\nABBABAABBAABABBABAABABBAABBABAAABAABABBAABBABAABABBABAABBAABABA neuzaiheshi\nABBABAABBAABABBABAABABBAABBABAABBAABABBAABBABAABABBABAABBAABABBA ABBABA...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 has been selling state se...
[{"type": "stdin_stdout", "input": "243\n", "output": " 1\n"}, {"type": "stdin_stdout", "input": "108\n", "output": " 2\n"}, {"type": "stdin_stdout", "input": "81\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\nN of us are going on a trip, by ...
[{"type": "stdin_stdout", "input": "12 -13 -107", "output": "-156\n"}, {"type": "stdin_stdout", "input": "-1719 1 -2", "output": "-1719\n"}, {"type": "stdin_stdout", "input": "10 -2 -141", "output": "-141\n"}, {"type": "stdin_stdout", "input": "10 -2 -162", "output": "-162\n"}, {"type": "stdin_stdout", "input": "10 -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\nPari wants to buy an expensive c...
[{"type": "stdin_stdout", "input": "9 436\n1 2 4 8 14 32 27 128 256\n", "output": "160\n0 1 2 3 4 6 8 9 10 11 14 15 16 17 18 20 22 23 24 25 27 28 29 30 32 34 35 36 37 38 41 42 43 44 46 48 49 50 51 52 128 129 130 131 132 134 136 137 138 139 142 143 144 145 146 148 150 151 152 153 155 156 157 158 160 162 163 164 165 166 ...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 thre...
[{"type": "stdin_stdout", "input": "-1 -1 -1", "output": "No\n"}, {"type": "stdin_stdout", "input": "-1 -1 -2", "output": "No\n"}, {"type": "stdin_stdout", "input": "18 10 10", "output": "No\n"}, {"type": "stdin_stdout", "input": "-1 0 2", "output": "Yes\n"}, {"type": "stdin_stdout", "input": "-1 -1 2", "output": "No\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\nA population of bears consists o...
[{"input": "[\"white\", \"brown\"]", "output": "[\"light brown\"]", "fn_name": "bear_fur"}, {"input": "[\"black\", \"brown\"]", "output": "[\"dark brown\"]", "fn_name": "bear_fur"}, {"input": "[\"pink\", \"black\"]", "output": "[\"unknown\"]", "fn_name": "bear_fur"}, {"input": "[\"black\", \"black\"]", "output": "[\"bl...
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\nClock shows 'h' hours, 'm' minut...
[{"input": "1\n1\n1", "output": "[3661000]", "fn_name": "past"}, {"input": "1\n0\n1", "output": "[3601000]", "fn_name": "past"}, {"input": "1\n0\n0", "output": "[3600000]", "fn_name": "past"}, {"input": "0\n1\n1", "output": "[61000]", "fn_name": "past"}, {"input": "0\n0\n0", "output": "[0]", "fn_name": "past"}]
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 permutation of n...
[{"type": "stdin_stdout", "input": "30 153\n18 5 24 7 12 6 25 14 21 20 27 4 30 8 23 19 11 13 17 1 29 28 15 22 16 9 2 10 26 3\n", "output": "217.500536909325035\n"}, {"type": "stdin_stdout", "input": "30 136\n1 29 20 25 15 2 3 16 24 30 17 14 7 10 11 22 6 8 23 18 12 5 19 9 26 21 28 13 27 4\n", "output": "217.499666343987...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nDante is engaged in a fight with...
[{"type": "stdin_stdout", "input": "63 100 1960\n", "output": "Yes\n"}, {"type": "stdin_stdout", "input": "73 100 3111\n", "output": "Yes\n"}, {"type": "stdin_stdout", "input": "26 100 5582\n", "output": "Yes\n"}, {"type": "stdin_stdout", "input": "128 81 3880\n", "output": "Yes\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\nArithmetic Progressions\n\nAn ar...
[{"type": "stdin_stdout", "input": "6\n-2 11 12 30 3 0", "output": "2\n"}, {"type": "stdin_stdout", "input": "6\n-4 1 6 2 13 -1", "output": "3\n"}, {"type": "stdin_stdout", "input": "6\n-2 1 -1 8 13 9", "output": "2\n"}, {"type": "stdin_stdout", "input": "6\n-2 11 5 20 8 0", "output": "3\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\nA triple of numbers is said to b...
[{"type": "stdin_stdout", "input": "1 -2 -2", "output": "Yes\n"}, {"type": "stdin_stdout", "input": "0 -2 -2", "output": "Yes\n"}, {"type": "stdin_stdout", "input": "5 7 5\n", "output": "Yes\n"}, {"type": "stdin_stdout", "input": "3 3 4\n", "output": "Yes\n"}, {"type": "stdin_stdout", "input": "6 1 6\n", "output": "Yes...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 strange game w...
[{"type": "stdin_stdout", "input": "2\n6\n5 3 2 4 1 6\n1 2\n1 3\n1 4\n4 5\n4 6\n4\n1 3 4 5\n3\n3 5 2\n6\n5 3 2 4 1 6\n1 2\n1 3\n1 4\n4 5\n4 6\n3\n1 2 3\n3\n4 1 6\n", "output": "B 4\nA 4\nC -1\nB 2\nC 1\n"}, {"type": "stdin_stdout", "input": "2\n6\n5 3 2 8 1 6\n1 2\n1 3\n1 4\n4 5\n4 6\n4\n1 3 4 5\n3\n3 5 2\n6\n5 3 2 4 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\nIvan unexpectedly saw a present ...
[{"type": "stdin_stdout", "input": "37\n52 52 66 149 149 130 47 47 26 110 185 -1 73 73 65 -1 -1 130 -1 -1 -1 94 97 190 -1 -1 49 49 54 -1 92 92 5 25 48 79 79\n", "output": "903952722\n"}, {"type": "stdin_stdout", "input": "37\n52 52 66 149 149 130 47 47 26 110 185 -1 73 73 65 -1 -1 130 -1 -1 -1 94 97 190 -1 -1 49 49 54 ...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nGeneral primality test are often...
[{"input": "11215", "output": "[false]", "fn_name": "lucas_lehmer"}, {"input": "11213", "output": "[true]", "fn_name": "lucas_lehmer"}, {"input": "101", "output": "[false]", "fn_name": "lucas_lehmer"}, {"input": "10", "output": "[false]", "fn_name": "lucas_lehmer"}, {"input": "33", "output": "[false]", "fn_name": "luca...
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\nKarafs is some kind of vegetable...
[{"type": "stdin_stdout", "input": "447 74474 4\n47 777474 1358\n74 744744 74477\n477 477447 777\n7 477777 444444\n", "output": "-1\n-1\n-1\n7\n"}, {"type": "stdin_stdout", "input": "447 74474 4\n47 777474 747\n74 744744 74477\n477 477447 777\n7 477777 444444\n", "output": "-1\n-1\n-1\n7\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\nAnu has created her own function...
[{"type": "stdin_stdout", "input": "100\n8650752 65536 131072 134217728 2112 8 0 0 0 0 0 1 0 0 268435456 1024 0 18890756 0 0 0 135364608 6291464 0 0 0 0 0 32 0 16384 0 0 0 0 33554560 256 0 16 0 0 536870912 536870912 0 0 128 0 0 4096 2048 0 0 0 0 268435456 64 1 0 0 262144 524288 0 11769 0 0 0 2 2 512 131072 0 0 67108864...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 determine the to...
[{"input": "[{\"name\": \"Anna\", \"results\": [\"XO\", \"O\", \"XO\", \"XO\"]}, {\"name\": \"Allison\", \"results\": [\"XO\", \"O\", \"XXO\", \"XXX\"]}, {\"name\": \"Olivia\", \"results\": [\"O\", \"XO\", \"XXO\", \"XXX\"]}, {\"name\": \"Rhiana\", \"results\": [\"XO\", \"O\", \"XO\", \"XO\"]}, {\"name\": \"Zola\", \"r...
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\nOne day, Niwango-kun, an employe...
[{"type": "stdin_stdout", "input": "8 2\n13 0 11 2 14 4 11 8", "output": "55\n"}, {"type": "stdin_stdout", "input": "8 4\n10 2 18 7 21 1 10 1", "output": "58\n"}, {"type": "stdin_stdout", "input": "8 4\n10 2 28 7 23 0 10 3", "output": "70\n"}, {"type": "stdin_stdout", "input": "8 2\n18 0 28 5 17 1 16 1", "output": "84\...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nZonk is addictive dice game. In ...
[{"input": "[1, 1, 1, 1, 1, 1]", "output": "[4000]", "fn_name": "get_score"}, {"input": "[3, 3, 3, 3, 3, 3]", "output": "[1200]", "fn_name": "get_score"}, {"input": "[4, 4, 4, 4, 4, 4]", "output": "[1600]", "fn_name": "get_score"}, {"input": "[5, 5, 5, 5, 5, 5]", "output": "[2000]", "fn_name": "get_score"}, {"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\nKing of Berland Berl IV has rece...
[{"type": "stdin_stdout", "input": "30 50\n17 >= 29\n19 <= 18\n3 > 50\n54 >= 56\n47 < 15\n50 <= 33\n49 < 8\n57 <= 16\n30 > 35\n49 < 21\n3 >= 37\n56 <= 51\n46 > 51\n35 >= 48\n32 < 15\n12 <= 4\n38 > 57\n55 < 9\n49 <= 1\n9 >= 38\n60 = 60\n1 > 12\n40 >= 43\n13 > 38\n24 >= 39\n9 < 2\n12 > 58\n15 >= 30\n13 > 50\n42 <= 16\n23...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nProfessor Matsuzaki is a scienti...
[{"type": "stdin_stdout", "input": "0 55\n0 1\n0 2\n0 3\n10 1\n10 2\n10 3\n10 4\n10 5\n10 6\n11 1\n11 2\n11 3\n100001 100\n-1 -1", "output": "42\n4\n5\n6\n22\n24\n26\n28\n30\n30\n26\n30\n32\n200274\n"}, {"type": "stdin_stdout", "input": "0 55\n0 1\n0 2\n0 3\n10 1\n10 2\n10 3\n10 4\n10 5\n10 1\n11 1\n11 2\n11 3\n100001 ...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 Bus of Characters there a...
[{"type": "stdin_stdout", "input": "10\n24 53 10 128 141 9 15 62 32 47\n00100000000111111111\n", "output": "6 3 3 7 1 9 10 2 8 4 5 5 4 8 2 10 9 1 7 6\n"}, {"type": "stdin_stdout", "input": "10\n24 53 10 128 141 9 15 97 32 47\n00100000000111111111\n", "output": "6 3 3 7 1 9 10 2 8 4 5 5 4 8 2 10 9 1 7 6\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\nWe have a tree with N vertices, ...
[{"type": "stdin_stdout", "input": "10\n1 2 4 2 11 1 7 11 0 4\n1 3\n2 3\n3 4\n7 5\n2 6\n6 7\n1 8\n2 9\n2 10", "output": "1\n2\n2\n2\n4\n2\n3\n2\n2\n3\n"}, {"type": "stdin_stdout", "input": "10\n1 2 4 0 12 1 7 11 0 4\n1 5\n2 3\n3 4\n7 5\n2 6\n6 7\n1 8\n2 9\n2 10", "output": "1\n2\n3\n3\n2\n2\n2\n2\n2\n3\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\nWe have a string of letters 'a' ...
[{"type": "stdin_stdout", "input": "abaaaaaabaaaabbabbaaabbbbabababaaaaabbaabbaaaaabbbaababaaaaaaabbbbbaaaaabaababbabababbabbbbabbbaabbabbbabaabbaabbaaaaaab\n", "output": "502032780\n"}, {"type": "stdin_stdout", "input": "abaaaaaabaaaabbabbaaabbababababaaaaabbaabbaaaaabbbaababaaaaaaabbbbbaaaaabbababbabababbabbbbabbbaab...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nIroha has a sequence of N string...
[{"type": "stdin_stdout", "input": "3 3\ndxx\naxx\ncxx\n", "output": "axxcxxdxx\n"}, {"type": "stdin_stdout", "input": "3 3\ndxx\naxx\ndxx", "output": "axxdxxdxx\n"}, {"type": "stdin_stdout", "input": "3 3\ndxx\naxx\nxxd", "output": "axxdxxxxd\n"}, {"type": "stdin_stdout", "input": "3 3\ndxx\nxxa\nxxd", "output": "dxxx...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nSuppose there is a $h \\times w$...
[{"type": "stdin_stdout", "input": "19 16\n16 16 16 16 15 15 0 5 0 4 9 9 1 4 4 0 8 16 12\n6 12 19 15 8 6 19 19 14 6 12 16 10 11 15 4\n", "output": "974740338\n"}, {"type": "stdin_stdout", "input": "19 16\n16 16 16 16 15 15 0 5 0 4 9 9 1 4 4 0 8 16 12\n6 12 19 15 8 6 19 19 14 6 9 16 10 11 15 4\n", "output": "797922655\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 the online judge system, a ju...
[{"type": "stdin_stdout", "input": "3\n14\n11\n14\n2\n58\n0", "output": "Case 1: 3\nCase 2: 14\nCase 3: 11\nCase 4: 14\nCase 5: 2\nCase 6: 58\n"}, {"type": "stdin_stdout", "input": "3\n5\n11\n14\n26\n34\n0", "output": "Case 1: 3\nCase 2: 5\nCase 3: 11\nCase 4: 14\nCase 5: 26\nCase 6: 34\n"}, {"type": "stdin_stdout", "i...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nAll of the animals are having a ...
[{"input": "\"great blue heron\"\n\"garlic naan\"", "output": "[true]", "fn_name": "feast"}, {"input": "\"blue-footed booby\"\n\"blueberry\"", "output": "[true]", "fn_name": "feast"}, {"input": "\"chickadee\"\n\"chocolate cake\"", "output": "[true]", "fn_name": "feast"}, {"input": "\"brown bear\"\n\"bear claw\"", "outp...
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<image> <image>\n\n*The two imag...
[{"type": "stdin_stdout", "input": "-1079\n", "output": "-1164239\n"}, {"type": "stdin_stdout", "input": "-340\n", "output": "-115598\n"}, {"type": "stdin_stdout", "input": "-449\n", "output": "-201599\n"}, {"type": "stdin_stdout", "input": "-685\n", "output": "-469223\n"}, {"type": "stdin_stdout", "input": "-432\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 S sheep and W wolves.\...
[{"type": "stdin_stdout", "input": "100 100\n", "output": "unsafe\n"}, {"type": "stdin_stdout", "input": "10 10\n", "output": "unsafe\n"}, {"type": "stdin_stdout", "input": "99 99\n", "output": "unsafe\n"}, {"type": "stdin_stdout", "input": "74 74\n", "output": "unsafe\n"}, {"type": "stdin_stdout", "input": "63 64\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\nThe pair of integer numbers `(m,...
[{"input": "150", "output": "[[149, 140]]", "fn_name": "closest_pair_tonum"}, {"input": "200", "output": "[[197, 28]]", "fn_name": "closest_pair_tonum"}, {"input": "100", "output": "[[97, 72]]", "fn_name": "closest_pair_tonum"}, {"input": "30", "output": "[[29, 20]]", "fn_name": "closest_pair_tonum"}, {"input": "50", "...
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 had a pair of two posi...
[{"type": "stdin_stdout", "input": "38823 9265", "output": "550080294\n"}, {"type": "stdin_stdout", "input": "11695 7143", "output": "10362628\n"}, {"type": "stdin_stdout", "input": "31415 9265", "output": "287927211"}, {"type": "stdin_stdout", "input": "11695 9265", "output": "2953665\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\nFood contains three nutrients ca...
[{"type": "stdin_stdout", "input": "4\n1 7 14 47\n2 5 35 55\n3 6 3 59\n4 6 5 15\n10 15 50 110\n2\n1 8 10 116\n-1 4 18 33\n10 10 50 300\n0", "output": "NA\nNA\n"}, {"type": "stdin_stdout", "input": "4\n1 7 14 47\n2 5 35 55\n3 6 3 59\n4 6 5 15\n10 15 50 110\n2\n1 8 10 116\n0 4 18 33\n10 10 50 300\n0", "output": "NA\nNA\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\nI'm traveling to a country with ...
[{"type": "stdin_stdout", "input": "5\n101.13623414746552 91.04161232454778\n1 -1\n1 10\n0 3\n19 -1\n20 7", "output": "9\n"}, {"type": "stdin_stdout", "input": "5\n100.60853142327974 90.65666260699702\n1 0\n1 10\n8 3\n10 -1\n12 10", "output": "2\n"}, {"type": "stdin_stdout", "input": "5\n100.60853142327974 90.656662606...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nNumbers of black and white point...
[{"type": "stdin_stdout", "input": "3 3\n100 700\n200 200\n600 600\n500 100\n605 300\n800 578\n3 3\n100 300\n400 600\n400 100\n600 400\n500 900\n300 300\n3 4\n300 300\n935 300\n400 600\n100 100\n200 900\n500 900\n158 110\n1 2\n300 300\n100 100\n500 500\n1 1\n100 100\n200 100\n2 2\n0 0\n500 700\n1000 1400\n1500 2100\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\nConsider a tic-tac-toe on a 3x3 ...
[{"type": "stdin_stdout", "input": "bbw\nbww\n+b+\nbwb\nwbx\nwbw\n0", "output": "NA\nNA\n"}, {"type": "stdin_stdout", "input": "caw\nwbw\n+b+\nbwb\nwxb\nwbw\n0", "output": "NA\nNA\n"}, {"type": "stdin_stdout", "input": "bbw\nbww\n+b+\nbwb\nwbx\nwbv\n0", "output": "NA\nNA\n"}, {"type": "stdin_stdout", "input": "cbw\nbww...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 has come to the math exam ...
[{"type": "stdin_stdout", "input": "10\n3 5 1 3\n0 0 1\n2 1 4\n2 5 2 3\n1 0\n3 2\n1 20 2 4\n0\n16\n6 20 2 5\n1 1 0 1 0 0\n0 8 2 9 11 6\n4 12 3 6\n1 0 1 1\n8 3 5 6\n6 20 3 12\n0 1 0 0 1 0\n20 11 3 20 16 17\n7 17 1 6\n1 1 0 1 0 0 0\n1 8 0 11 15 15 10\n6 17 2 6\n0 0 1 0 0 1\n7 11 2 7 10 12\n5 17 2 5\n1 1 1 1 0\n17 11 10 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\nVasya is reading a e-book. The f...
[{"type": "stdin_stdout", "input": "5\n20 10 2 9\n1000000000 2 89 4\n1000000000 2 89 8\n1000000000 142 1 1000000000\n1000000000 1000000000 4 3\n", "output": "4\n23\n12\n1\n333333332\n"}, {"type": "stdin_stdout", "input": "5\n20 10 2 9\n1000000000 2 89 4\n1000000000 2 89 5\n1000000000 142 1 1000000000\n1000000000 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\nRead problems statements in Mand...
[{"type": "stdin_stdout", "input": "2\n3\n3 14 3\n4\n1 2 3 3", "output": "2\n3\n"}, {"type": "stdin_stdout", "input": "2\n3\n1 14 3\n4\n1 2 3 3", "output": "3\n3\n"}, {"type": "stdin_stdout", "input": "2\n2\n3 3 1\n4\n1 12 3 3", "output": "2\n3\n"}, {"type": "stdin_stdout", "input": "2\n3\n6 14 3\n4\n1 2 3 3", "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 only difference between easy...
[{"type": "stdin_stdout", "input": "20\n10\n3 8 1 4 9 6 10 2 7 5\n10\n10 4 8 6 5 3 1 2 9 7\n1\n1\n2\n2 1\n10\n2 5 3 6 9 7 4 10 8 1\n10\n1 7 4 6 9 10 8 2 3 5\n8\n3 8 1 7 6 4 2 5\n8\n7 4 5 2 8 1 6 3\n5\n1 2 4 3 5\n6\n4 2 5 6 3 1\n5\n5 3 2 4 1\n5\n4 3 5 1 2\n7\n6 5 1 7 4 2 3\n6\n6 2 4 1 5 3\n3\n3 1 2\n4\n1 3 4 2\n3\n3 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\nWe define $x \\bmod y$ as the re...
[{"type": "stdin_stdout", "input": "500000 250000\n", "output": "803991687\n"}, {"type": "stdin_stdout", "input": "500000 250000\n", "output": "803991687\n"}, {"type": "stdin_stdout", "input": "500000 471528\n", "output": "588862109\n"}, {"type": "stdin_stdout", "input": "500000 121854\n", "output": "377057930\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\nThere are n boys and m girls att...
[{"type": "stdin_stdout", "input": "30 30 30\n", "output": "118264581548187697"}, {"type": "stdin_stdout", "input": "30 29 19\n", "output": "1396982287132530\n"}, {"type": "stdin_stdout", "input": "30 30 19\n", "output": "2044156982307300\n"}, {"type": "stdin_stdout", "input": "30 29 42\n", "output": "277508869722315\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 special offer in Vasy...
[{"type": "stdin_stdout", "input": "16\n1 1 1 1\n1 1 1 1000000000\n1 1 1000000000 1\n1 1 1000000000 1000000000\n1 1000000000 1 1\n1 1000000000 1 1000000000\n1 1000000000 1000000000 1\n1 1000000000 1000000000 1000000000\n1000000000 1 1 1\n1000000000 1 1 1000000000\n1000000000 1 1000000000 1\n1000000000 1 1000000000 1000...
code_stdio