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\nConsider the number `1176` and i...
[{"input": "100000\n1000000", "output": "[2302]", "fn_name": "solve"}, {"input": "2\n1000000", "output": "[2549]", "fn_name": "solve"}, {"input": "2\n100000", "output": "[247]", "fn_name": "solve"}, {"input": "1176\n1200", "output": "[1]", "fn_name": "solve"}, {"input": "2\n1200", "output": "[1]", "fn_name": "solve"}]
code_functional
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nPhoenix has $n$ coins with weigh...
[{"type": "stdin_stdout", "input": "100\n30\n30\n30\n30\n30\n30\n30\n30\n30\n30\n30\n30\n30\n30\n30\n30\n30\n30\n30\n30\n30\n30\n30\n30\n30\n30\n30\n30\n30\n30\n30\n30\n30\n30\n30\n30\n30\n30\n30\n30\n30\n30\n30\n30\n30\n30\n30\n30\n30\n30\n30\n30\n30\n30\n30\n30\n30\n30\n30\n30\n30\n30\n30\n30\n30\n30\n30\n30\n30\n30\...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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# 'Magic' recursion call depth n...
[{"input": "\"p6023R6F95L64R98P3321L15qP8886P8063P2161p3321P6023P6023F86L64qp8886F12F3L33P3321P3321R57qp8063P3321L35P3321P8886P6023F51qp2161P8063P8063F32R6F46q\"", "output": "[[3, 5]]", "fn_name": "magic_call_depth_number"}, {"input": "\"p5048L50R23P2998R9qp2125P3445R41R48qp1776R41P392qP2904p2998R4P2125P1776qp3445F57P1...
code_functional
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nGiven is a string S. Replace eve...
[{"type": "stdin_stdout", "input": "kvtvweokpottycaeeyfthzfvsgckwjmgqadfekjfitnsieylhumxjjezqvidkxjpywokrnzxxwraamuimhmrjwqeyvjvyjjzsxxf\n", "output": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\n"}, {"type": "stdin_stdout", "input": "qvssniprlkdntynymqcjoxpttvp...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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.\nFin...
[{"type": "stdin_stdout", "input": "1000\n", "output": "972926972\n"}, {"type": "stdin_stdout", "input": "1001", "output": "513172208\n"}, {"type": "stdin_stdout", "input": "108", "output": "875619122\n"}, {"type": "stdin_stdout", "input": "111", "output": "130571620\n"}, {"type": "stdin_stdout", "input": "101", "outpu...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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": "1740680371580423905 1636173592742219971\n", "output": "NO\n"}, {"type": "stdin_stdout", "input": "999999999999999999 1636173592742219971\n", "output": "NO\n"}, {"type": "stdin_stdout", "input": "616543106594181990 1600944574522397396\n", "output": "NO\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\nSnuke is buying a bicycle.\nThe ...
[{"type": "stdin_stdout", "input": "10000 10000 10000\n", "output": "20000\n"}, {"type": "stdin_stdout", "input": "10000 10100 10000", "output": "20000\n"}, {"type": "stdin_stdout", "input": "10000 00100 10000", "output": "10100\n"}, {"type": "stdin_stdout", "input": "11000 10100 10000", "output": "20100\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\nSquare Route\n\nSquare root\n\nE...
[{"type": "stdin_stdout", "input": "3 3\n2\n1\n2\n-1\n3\n1\n1 2\n22\n11\n10\n0 0", "output": "7\n0\n"}, {"type": "stdin_stdout", "input": "3 3\n1\n1\n2\n1\n1\n1\n1 2\n10\n10\n23\n0 0", "output": "11\n1\n"}, {"type": "stdin_stdout", "input": "3 3\n1\n1\n1\n2\n3\n1\n1 2\n10\n10\n10\n0 0", "output": "6\n2\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 `bouncy number` is a positive ...
[{"input": "50", "output": "[99999999999999999999999999999999999999912040301674]", "fn_name": "bouncy_count"}, {"input": "20", "output": "[99999999999959940181]", "fn_name": "bouncy_count"}, {"input": "10", "output": "[9999722967]", "fn_name": "bouncy_count"}, {"input": "6", "output": "[987048]", "fn_name": "bouncy_cou...
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\nRead problems statements in Mand...
[{"type": "stdin_stdout", "input": "4\n1\n11\n23\n11", "output": "11\n"}, {"type": "stdin_stdout", "input": "4\n4\n11\n18\n16", "output": "16\n"}, {"type": "stdin_stdout", "input": "4\n1\n15\n17\n14", "output": "14\n"}, {"type": "stdin_stdout", "input": "4\n13\n10\n3\n13", "output": "13\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\nFor a given sequence of distinct...
[{"type": "stdin_stdout", "input": "109\n74 18 237 179 195 112 156 11 72 68 173 202 78 250 224 251 107 55 186 144 57 62 28 210 132 64 93 6 211 0 174 163 248 226 167 246 46 102 253 180 121 56 151 35 150 254 168 201 242 118 190 158 196 30 75 116 187 96 215 244 192 73 12 175 33 222 131 256 181 230 114 165 128 234 63 90 44...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nBomboslav likes to look out of t...
[{"type": "stdin_stdout", "input": "2000000000\n0\n", "output": "1\n"}, {"type": "stdin_stdout", "input": "1999999995\n0\n", "output": "2\n"}, {"type": "stdin_stdout", "input": "1999999995\n1\n", "output": "1\n"}, {"type": "stdin_stdout", "input": "1999999995\n2\n", "output": "0\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\nYou have an array of integers (i...
[{"type": "stdin_stdout", "input": "8\n2 1 4\n1 1\n1 4\n1 2\n2 2 4\n2 4 3\n1 2\n2 2 7\n", "output": "1 3 3 7 \n"}, {"type": "stdin_stdout", "input": "8\n2 1 4\n1 1\n1 4\n1 2\n2 2 4\n2 4 3\n1 2\n2 2 7\n", "output": "1 3 3 7 "}, {"type": "stdin_stdout", "input": "8\n2 2 4\n1 1\n1 4\n1 2\n2 2 4\n2 4 3\n1 2\n2 2 7\n", "out...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\n> I would, if I could,\n> If I ...
[{"type": "stdin_stdout", "input": "15 2 3\n16 3 6\n110 9 112\n0 0 0", "output": "1\n11\n98\n"}, {"type": "stdin_stdout", "input": "15 2 4\n16 3 6\n110 9 112\n0 0 0", "output": "8\n11\n98\n"}, {"type": "stdin_stdout", "input": "15 2 4\n15 3 6\n110 9 112\n0 0 0", "output": "8\n10\n98\n"}, {"type": "stdin_stdout", "input...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nIn this kata, you will write a f...
[{"input": "[1, 2, 5, 4, 3, 2, 3, 6, 4, 1, 2, 3, 3, 4, 5, 3, 2, 1, 2, 3, 5, 5, 4, 3]", "output": "[{\"pos\": [2, 7, 14, 20], \"peaks\": [5, 6, 5, 5]}]", "fn_name": "pick_peaks"}, {"input": "[3, 2, 3, 6, 4, 1, 2, 3, 2, 1, 2, 2, 2, 1]", "output": "[{\"pos\": [3, 7, 10], \"peaks\": [6, 3, 2]}]", "fn_name": "pick_peaks"}, ...
code_functional
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nIn an attempt to escape the Misc...
[{"type": "stdin_stdout", "input": "491 172\n01111101111111100000111010110001010001110111000010101111101000100010010111011101110110111101101010111000111000011100011010010010111111000011011010100110001000011100111000001011100010001111101111101000111001100110010100101000001110010100100100100101001100010101001000010000111...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nE869120 is initially standing at...
[{"type": "stdin_stdout", "input": "100\n-62558 -455059\n-78926 -574123\n-122264 -889372\n-29760 -216480\n-91884 -668382\n-122636 -892078\n-134168 -975964\n-17670 -128535\n-127782 -929511\n-74524 -542102\n-104470 -759935\n-133362 -970101\n-93124 -677402\n-16368 -119064\n-19530 -142065\n-82336 -598928\n-87358 -635459\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\nAt Aizu Riverside Hospital, inpa...
[{"type": "stdin_stdout", "input": "5\n263 1519 1817\n2 1240 1985\n11656 1896 4132\n10001 503 3107\n51 1421 2690\n3\n345 1628 2181\n7 3910 1590\n5982 2525 3616\n0", "output": "11656 6028\n5982 6141\n"}, {"type": "stdin_stdout", "input": "5\n263 1519 1817\n2 1240 1985\n11656 1896 4132\n10001 503 3107\n51 1421 2690\n3\n3...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nExpression Mining\n\nConsider an...
[{"type": "stdin_stdout", "input": "3\n(3+2)*3+1\n1\n1*1*1+1+1*1\n1307\n1*(2*3*4)+5+((5+7*8))*(9)\n0", "output": "2\n10\n0\n"}, {"type": "stdin_stdout", "input": "3\n(1+2)*4+3\n1\n1*1*1+1*1*1\n1108\n1*(2*3*4)+5+((6+7*8))*(9)\n0", "output": "3\n12\n0\n"}, {"type": "stdin_stdout", "input": "3\n(1+2)*3+3\n1\n1*1*1+1+1*1\n...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nThere are n shovels in Polycarp'...
[{"type": "stdin_stdout", "input": "499999999\n", "output": "1249999995\n"}, {"type": "stdin_stdout", "input": "1000000000\n", "output": "500000000\n"}, {"type": "stdin_stdout", "input": "499999998\n", "output": "1249999991\n"}, {"type": "stdin_stdout", "input": "458679894\n", "output": "1043399471\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\nAs you may know, MemSQL has Amer...
[{"type": "stdin_stdout", "input": "100\nSFFSSFFFFFFSSFFFSSFSFFFFFSSFFFSFFFFFFSFSSSFSFSFFFFSFSSFFFFFFFFSFFFFFSFFFFFSSFFFSFFSFSFFFFSFFSFFFFFFF\n", "output": "YES\n"}, {"type": "stdin_stdout", "input": "100\nSFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF\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 contestants participated in a ...
[{"type": "stdin_stdout", "input": "7\n1\n2\n2\n3\n1\n4", "output": "4\n"}, {"type": "stdin_stdout", "input": "7\n1\n4\n2\n3\n1\n3", "output": "5\n"}, {"type": "stdin_stdout", "input": "7\n1\n4\n2\n3\n1\n4", "output": "4\n"}, {"type": "stdin_stdout", "input": "7\n1\n4\n2\n3\n1\n7", "output": "4\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\nEugene likes working with arrays...
[{"type": "stdin_stdout", "input": "3\n41 -41 41\n", "output": "3\n"}, {"type": "stdin_stdout", "input": "3\n41 -60 41\n", "output": "6\n"}, {"type": "stdin_stdout", "input": "3\n57 -60 41\n", "output": "6\n"}, {"type": "stdin_stdout", "input": "3\n57 -33 41\n", "output": "6\n"}, {"type": "stdin_stdout", "input": "3\n5...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nWe have a rectangular parallelep...
[{"type": "stdin_stdout", "input": "19 9 5", "output": "45\n"}, {"type": "stdin_stdout", "input": "11 5 5", "output": "25\n"}, {"type": "stdin_stdout", "input": "-1 2 10", "output": "0\n"}, {"type": "stdin_stdout", "input": "19 5 5", "output": "25\n"}, {"type": "stdin_stdout", "input": "5 5 5", "output": "25\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\nGreg has an array a = a1, a2, .....
[{"type": "stdin_stdout", "input": "4 3 6\n2 1 3 4\n1 2 2\n2 3 2\n3 4 4\n1 2\n1 3\n2 3\n1 2\n1 3\n2 3\n", "output": "10 21 31 20\n"}, {"type": "stdin_stdout", "input": "4 3 6\n2 1 3 4\n1 2 2\n2 4 2\n3 4 4\n1 2\n1 3\n2 3\n1 2\n1 3\n2 3\n", "output": "10 21 31 32\n"}, {"type": "stdin_stdout", "input": "4 3 6\n2 1 3 4\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\nSimon has an array a_1, a_2, ......
[{"type": "stdin_stdout", "input": "5\n2 3 5 7 11\n", "output": "5 0\n1 2 3 4 5 \n"}, {"type": "stdin_stdout", "input": "5\n2 3 5 9 17\n", "output": "5 0\n1 2 3 4 5\n"}, {"type": "stdin_stdout", "input": "5\n2 3 5 7 11\n", "output": "5 0\n1 2 3 4 5 "}, {"type": "stdin_stdout", "input": "2\n999999 1000000\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\nIn number theory, an **[abundan...
[{"input": "1111", "output": "[[[1110], [516]]]", "fn_name": "abundant"}, {"input": "900", "output": "[[[900], [1021]]]", "fn_name": "abundant"}, {"input": "999", "output": "[[[996], [360]]]", "fn_name": "abundant"}, {"input": "300", "output": "[[[300], [268]]]", "fn_name": "abundant"}, {"input": "400", "output": "[[[4...
code_functional
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nProblem Statement\n\nLet's consi...
[{"type": "stdin_stdout", "input": "00000000111111110000000011111111000000001111111100000000111111110000000011111111000000001111111100000000111111110000000111111111\n10000000111111110000000011111111000000001111111100000000111111110000000011111111000000001111111100000000111111110000000011111111\n010101010101010101010101...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nF: Multiplication is fun --Multi...
[{"type": "stdin_stdout", "input": "3 3.9884088227062082\n4.1091643442474926\n2.4255254960412556\n3.5822804934056625\n5.345178229082616\n3.4110023092801276\n4.814519106855367", "output": "1\n"}, {"type": "stdin_stdout", "input": "2 2.7392730443507527\n3.4955293017360702\n2.1596061630199546\n2.4656347357978543\n4.322234...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 generalizes [Twice Lin...
[{"input": "[17, 14, 9, 16, 11, 8, 13, 19, 7]\n185", "output": "[1090]", "fn_name": "n_linear"}, {"input": "[18, 12, 16, 15, 10, 17, 6, 8, 7]\n534", "output": "[2601]", "fn_name": "n_linear"}, {"input": "[3, 18, 10, 9, 19, 6, 7, 17, 4]\n195", "output": "[361]", "fn_name": "n_linear"}, {"input": "[16, 5, 18, 13, 11, 8, ...
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 an array $a$ consi...
[{"type": "stdin_stdout", "input": "82\n53931 67166 20637 68570 4855 63080 53128 28375 54407 70564 46622 46903 32659 68966 20614 11381 51217 94774 90448 13368 51098 46518 15907 1090 44331 39269 17316 22813 66082 78034 58245 36364 45200 78881 4933 66406 58312 74413 94780 12718 61328 57754 75973 93986 26719 12938 21718 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\n## Overview\nResistors are elect...
[{"input": "\"330k ohms\"", "output": "[\"orange orange yellow gold\"]", "fn_name": "encode_resistor_colors"}, {"input": "\"47k ohms\"", "output": "[\"yellow violet orange gold\"]", "fn_name": "encode_resistor_colors"}, {"input": "\"330 ohms\"", "output": "[\"orange orange brown gold\"]", "fn_name": "encode_resistor_co...
code_functional
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nThere are a total of n x n squar...
[{"type": "stdin_stdout", "input": "10\n...*....**\n..........\n**....**..\n........*.\n..*.......\n..........\n.*........\n..........\n....*..***\n.*....*...\n10\n*****.****\n*..*.*....\n****.*....\n*....*....\n*....*****\n..........\n****.*****\n*..*...*..\n****...*..\n*..*...*..\n0", "output": "5\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\nA bus moves along the coordinate...
[{"type": "stdin_stdout", "input": "1000000 1000000 500000 10000\n", "output": "10000\n"}, {"type": "stdin_stdout", "input": "1000000 1000000000 999999 10000\n", "output": "10\n"}, {"type": "stdin_stdout", "input": "1000000 1000000000 999999 10000\n", "output": "10\n"}, {"type": "stdin_stdout", "input": "1000000 100000...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\n# Task\nGiven two integers `a` a...
[{"input": "100\n1000", "output": "[11]", "fn_name": "fraction"}, {"input": "114\n200", "output": "[157]", "fn_name": "fraction"}, {"input": "3\n118", "output": "[121]", "fn_name": "fraction"}, {"input": "90\n120", "output": "[7]", "fn_name": "fraction"}, {"input": "3\n15", "output": "[6]", "fn_name": "fraction"}, {"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\nDr. Evil is interested in math a...
[{"type": "stdin_stdout", "input": "1 1 1\n1107891008\n15017817\n1 1 821220804\n", "output": "1092873191\n1914093995\n"}, {"type": "stdin_stdout", "input": "1 1 1\n937982044\n179683049\n1 1 821220804\n", "output": "758298995\n1579519799\n"}, {"type": "stdin_stdout", "input": "1 1 1\n937982044\n179683049\n1 1 821220804\...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nPrint all combinations which can...
[{"type": "stdin_stdout", "input": "10 5", "output": "31: 0 1 2 3 4\n47: 0 1 2 3 5\n55: 0 1 2 4 5\n59: 0 1 3 4 5\n61: 0 2 3 4 5\n62: 1 2 3 4 5\n79: 0 1 2 3 6\n87: 0 1 2 4 6\n91: 0 1 3 4 6\n93: 0 2 3 4 6\n94: 1 2 3 4 6\n103: 0 1 2 5 6\n107: 0 1 3 5 6\n109: 0 2 3 5 6\n110: 1 2 3 5 6\n115: 0 1 4 5 6\n117: 0 2 4 5 6\n118: ...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nBasic regex tasks. Write a funct...
[{"input": "9453", "output": "[false]", "fn_name": "validate_code"}, {"input": "123", "output": "[true]", "fn_name": "validate_code"}, {"input": "248", "output": "[true]", "fn_name": "validate_code"}, {"input": "321", "output": "[true]", "fn_name": "validate_code"}, {"input": "8", "output": "[false]", "fn_name": "valid...
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\nWilson primes satisfy the follow...
[{"input": "101", "output": "[false]", "fn_name": "am_i_wilson"}, {"input": "569", "output": "[false]", "fn_name": "am_i_wilson"}, {"input": "11", "output": "[false]", "fn_name": "am_i_wilson"}, {"input": "563", "output": "[true]", "fn_name": "am_i_wilson"}, {"input": "0", "output": "[false]", "fn_name": "am_i_wilson"}...
code_functional
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nThere is a function f(x), which ...
[{"type": "stdin_stdout", "input": "4\n1 -1000000000 1000000000\n1 -1000000000 1000000000\n1 -1000000000 1000000000\n2\n", "output": "-1000000000 3000000000\n"}, {"type": "stdin_stdout", "input": "4\n1 -1000000000 1000000000\n1 -1000000000 0000000000\n1 -1000000000 1000000000\n2", "output": "-1000000000 2000000000\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\nOur old friend Alexey has finall...
[{"type": "stdin_stdout", "input": "71\n1 99\n11 69\n86 92\n7 49\n31 70\n42 53\n48 81\n86 96\n36 91\n19 38\n39 91\n41 64\n87 93\n83 97\n40 41\n3 32\n15 18\n58 65\n22 32\n1 71\n58 86\n64 77\n15 69\n4 34\n42 89\n9 66\n15 18\n58 65\n59 96\n39 89\n19 38\n6 63\n26 73\n29 47\n55 88\n5 78\n41 74\n48 81\n20 71\n59 96\n42 49\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\nGiven are a sequence of N positi...
[{"type": "stdin_stdout", "input": "2896 1518\n498 2010 1723 2089 76 1224 1972 612 465 880 283 143 1538 372 841 1998 292 2096 423 728 2199 807 2325 1185 1664 2349 531 40 1039 2006 2179 1842 2954 2847 2540 1045 2697 2112 1625 2062 631 2136 544 2420 1199 2592 2820 802 1157 383 1164 617 1513 2876 2625 947 1720 1640 1772 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\nA [sequence or a series](http://...
[{"input": "10", "output": "[[0, 1, 3, 6, 10, 15, 21, 28, 36, 45, 55]]", "fn_name": "sum_of_n"}, {"input": "-4", "output": "[[0, -1, -3, -6, -10]]", "fn_name": "sum_of_n"}, {"input": "3", "output": "[[0, 1, 3, 6]]", "fn_name": "sum_of_n"}, {"input": "1", "output": "[[0, 1]]", "fn_name": "sum_of_n"}, {"input": "0", "out...
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\nN cells are arranged in a row. S...
[{"type": "stdin_stdout", "input": "50\n10101000010011011110001001111110001101010111100110", "output": "11\n"}, {"type": "stdin_stdout", "input": "50\n10101000010011011010001001111110001101010111100100", "output": "10\n"}, {"type": "stdin_stdout", "input": "50\n10101110010101010110001001011111001001110111000000", "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\nThere are $n$ cities and $m$ bid...
[{"type": "stdin_stdout", "input": "4\n4 5 7\n4 1 3\n1 2 5\n2 1 6\n1 3 1\n3 4 4\n4 6 5\n1 2 1\n1 3 1\n1 4 2\n2 4 2\n4 3 1\n3 2 1\n3 2 10\n1 2 8\n1 3 10\n5 5 2\n1 2 17\n3 1 15\n2 3 18\n1 4 14\n2 5 12\n", "output": "1\n3\n0\n50\n"}, {"type": "stdin_stdout", "input": "4\n4 5 7\n4 1 3\n1 2 5\n2 1 6\n1 3 1\n3 4 4\n4 6 5\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\nOnce n people simultaneously sig...
[{"type": "stdin_stdout", "input": "12\n11 4\n9 2\n10000 100\n1000000000 2345\n123456 1234567\n123456 65536\n5 55\n5 3\n2323 10\n999111000 232323\n999888777 284079058\n999888777 777\n", "output": " 4\n ...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nWrite a code that receives an ar...
[{"input": "[\"this\", \"code\", \"is\", \"right\", \"the\"]", "output": "[[\"this\", \"is\", \"the\", \"right\", \"code\"]]", "fn_name": "yes_no"}, {"input": "[1, 2, 3, 4, 5, 6, 7, 8, 9, 10]", "output": "[[1, 3, 5, 7, 9, 2, 6, 10, 8, 4]]", "fn_name": "yes_no"}, {"input": "[\"a\", \"b\"]", "output": "[[\"a\", \"b\"]]",...
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\nRead problems statements in Mand...
[{"type": "stdin_stdout", "input": "5\nQb 1 10\nQr 4 2\nQi\nQb 4 11\nQr 4 12", "output": "2\n1\n2\n3\n"}, {"type": "stdin_stdout", "input": "5\nQb 4 10\nQr 3 11\nQi\nQb 4 3\nQr 4 12", "output": "2\n3\n2\n3\n"}, {"type": "stdin_stdout", "input": "5\nQb 4 10\nQr 4 4\nQi\nQb 4 4\nQr 4 12", "output": "2\n0\n0\n3\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\nWe have two permutations P and Q...
[{"type": "stdin_stdout", "input": "8\n7 3 5 4 2 1 6 8\n3 8 2 5 4 6 7 1\n", "output": "17517\n"}, {"type": "stdin_stdout", "input": "8\n5 7 4 2 8 3 6 1\n1 7 8 4 6 2 5 3\n", "output": "19898\n"}, {"type": "stdin_stdout", "input": "8\n1 2 3 4 5 6 7 8\n8 7 6 5 4 3 2 1\n", "output": "40319\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\n# Task\n You are a magician. You...
[{"input": "10000\n10000", "output": "[\"White\"]", "fn_name": "not_so_random"}, {"input": "11111\n22222", "output": "[\"Black\"]", "fn_name": "not_so_random"}, {"input": "1\n1", "output": "[\"Black\"]", "fn_name": "not_so_random"}, {"input": "2\n1", "output": "[\"White\"]", "fn_name": "not_so_random"}, {"input": "1\n2...
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\nToday Tavas got his test result ...
[{"type": "stdin_stdout", "input": "73\n", "output": "seventy-three\n"}, {"type": "stdin_stdout", "input": "77\n", "output": "seventy-seven\n"}, {"type": "stdin_stdout", "input": "78\n", "output": "seventy-eight\n"}, {"type": "stdin_stdout", "input": "77\n", "output": "seventy-seven\n"}, {"type": "stdin_stdout", "input...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nGiven a certain integer ```n```,...
[{"input": "-1800.1", "output": "[\"The number has a decimal part. No Results\"]", "fn_name": "big_primefac_div"}, {"input": "1969", "output": "[[179, 179]]", "fn_name": "big_primefac_div"}, {"input": "-1800", "output": "[[5, 900]]", "fn_name": "big_primefac_div"}, {"input": "100", "output": "[[5, 50]]", "fn_name": "bi...
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\nAsterix, Obelix and their tempor...
[{"type": "stdin_stdout", "input": "btbdpnzdenxueteteytvkwnegodyhmdwhmrmbftrifytzudumzlacwytsuzefqfpjesdblxhpcsidgksisjdmhyxmmugrjmtfcgxmcgpmvbxbyszdugvmoyjeeqsywcvuqskcjotyhvdijyslgfvyujxthngnonasgnbzzygyikhfelirdfsvuicbiazfdeqecbtbdpnzdenxueteteytvkwnegodyhmdwhmrmbftrifytzudumzlacwytsuzefqfpjesdblxhpcsidgksisjdmhyxmm...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 English booklet has been crea...
[{"type": "stdin_stdout", "input": "3\nHoshimo\nHashino\nMasayuki Hoshino was the grandson of Ieyasu Tokugawa.", "output": "Hoshimo\nHashino\nMasayuki Hoshina was the grandson of Ieyasu Tokugawa.\n"}, {"type": "stdin_stdout", "input": "3\nHoshimo\nHashino\nMasayuki Hoshino was the grandspn of Ieyasu Tokugawa.", "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\nWhen Mr. X is away from home, he...
[{"type": "stdin_stdout", "input": "100 79\n359 483\n836 935\n246 178\n901 621\n246 967\n428 447\n65 252\n294 631\n903 95\n965 92\n901 614\n528 580\n420 398\n727 132\n266 536\n991 973\n419 606\n710 676\n418 666\n268 141\n500 874\n685 455\n868 169\n222 348\n748 482\n535 214\n487 952\n52 336\n380 985\n581 209\n516 292\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\nA newspaper is published in Walr...
[{"type": "stdin_stdout", "input": "ehfjaabjfedhddejjfcfijagefhjeahjcddhchahjbagi\nfbfdjbjhibjgjgaaajgdbcfdbhjcajcbbieijhcjgajhgaa\n", "output": "10\n"}, {"type": "stdin_stdout", "input": "ehfjaabjfedhddejjfcfihagefhjeahjcddjchahjbagi\nfbfdjbjhibjgjgaaajgdbcfdbhjcajcbbieijhcjgajhgaa\n", "output": "10\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\nRecently Bob invented a new game...
[{"type": "stdin_stdout", "input": "50\n45 39\n18 12\n13 6\n48 45\n46 36\n46 8\n40 36\n29 28\n2 18\n43 26\n25 14\n43 31\n13 30\n12 35\n38 42\n20 5\n7 35\n10 50\n27 13\n1 41\n24 21\n25 5\n7 31\n15 45\n32 25\n43 23\n4 50\n46 11\n40 14\n37 21\n50 2\n41 42\n43 30\n14 22\n36 48\n8 24\n49 20\n19 26\n32 10\n35 29\n1 6\n34 33\...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nYou are given an integer sequenc...
[{"type": "stdin_stdout", "input": "2000 1161 195\n120890687 120890687 120890687 120890687 120890687 120890687 120890687 120890687 120890687 120890687 120890687 120890687 120890687 120890687 120890687 120890687 120890687 120890687 120890687 120890687 120890687 120890687 120890687 120890687 120890687 120890687 120890687...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nDima, Inna and Seryozha have gat...
[{"type": "stdin_stdout", "input": "88 10\n6 64 43 1 1 1 8 15 39 1 95 2 1 80 36 40 25 2 52 24 29 26 16 45 96 99 1 91 16 97 67 1 39 91 1 41 72 67 93 84 1 12 67 53 26 1 14 39 94 92 28 75 10 16 81 97 77 22 1 1 41 90 51 49 90 74 5 61 1 45 88 1 40 7 4 59 16 33 6 4 92 1 38 20 4 53 10 80\n70 45 1 73 52 1 20 78 68 98 1 95 2 61...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nBerland SU holds yet another tra...
[{"type": "stdin_stdout", "input": "7 200000\n66 57 15 65 32 46 30\n66 31 64 9 63 57 65\n", "output": "-1"}, {"type": "stdin_stdout", "input": "7 200000\n66 57 15 65 32 46 30\n7 31 64 9 63 57 65\n", "output": "-1\n"}, {"type": "stdin_stdout", "input": "6 200000\n66 57 15 65 32 46 30\n7 31 64 9 63 57 65\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\nLet's call an array of non-negat...
[{"type": "stdin_stdout", "input": "3\n1000000000 1000000000 1000000000\n", "output": "500000000\n"}, {"type": "stdin_stdout", "input": "3\n1000000000 1000000000 1000100000\n", "output": "500000000\n"}, {"type": "stdin_stdout", "input": "3\n1000000000 1000000000 1000100010\n", "output": "500000000\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\nWe have a board with a 2 \\times...
[{"type": "stdin_stdout", "input": "52\nRvvttdWIyyPPQFFZZssffEEkkaSSDKqcibbeYrhAljCCGGJppHHn\nRLLwwdWIxxNNQUUXXVVMMooCBaggDKqcimmeYrhAljOOTTJuuzzn", "output": "958681902\n"}, {"type": "stdin_stdout", "input": "52\nnHHppJGGCCjlAhrYebbicqKDSSakkEEffssZZFFQPPyyIWdttvvR\nnzzuuJTTOOjlAhrYemmicqKDggaBBooMMVVXXUUQNNxxIWdwwLLR...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nWilbur the pig is tinkering with...
[{"type": "stdin_stdout", "input": "22\n1000000000 -1000000000 1000000000 -1000000000 1000000000 -1000000000 1000000000 -1000000000 1000000000 -1000000000 1000000000 -1000000000 1000000000 -1000000000 1000000000 -1000000000 1000000000 -1000000000 1000000000 -1000000000 1000000000 -1000000000\n", "output": "43000000000\...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 simple code of a...
[{"type": "stdin_stdout", "input": "3\n3 1 -1\n1 0 6\nXOR\n3 1 0\n1 2 3\nAND\n3 2 1\n-1 2 1\nOR", "output": "-8\n0\n-1\n"}, {"type": "stdin_stdout", "input": "3\n3 1 -1\n1 3 3\nXOR\n2 1 0\n1 1 3\nAND\n3 0 -2\n0 3 4\nOR", "output": "-2\n0\n-2\n"}, {"type": "stdin_stdout", "input": "3\n3 1 -1\n1 2 6\nXOR\n3 1 0\n1 2 3\nA...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nDr. Bruce Banner hates his enemi...
[{"type": "stdin_stdout", "input": "100\n", "output": "I hate that I love that I hate that I love that I hate that I love that I hate that I love that I hate that I love that I hate that I love that I hate that I love that I hate that I love that I hate that I love that I hate that I love that I hate that I love that 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\nThe Fire Lord attacked the Frost...
[{"type": "stdin_stdout", "input": "23\n99 110 99 100 100 100 100 99 100 99 99 100 000 100 99 111 100 100 100 99 99 99 99\n", "output": "ARARARARARARARARARARARARALLLLLLLLLLLLAARARARARARARARARARARARARALLLLLLLLLLLLAARARARARARARARARARARARARALLLLLLLLLLLLAARARARARARARARARARARARARALLLLLLLLLLLLAARARARARARARARARARARARARALLLLLL...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 World Programming Olympics M...
[{"type": "stdin_stdout", "input": "10 24 2621 2533 3148 3544 4273 4921 2950 3780 4483\n10 1687 4906 4246 2814 1874 3020 3039 3971 102 492\n10 3458 2699 2463 4395 3607 550 1608 958 3970 3077\n4 891\n", "output": "4919.7621246685\n"}, {"type": "stdin_stdout", "input": "10 24 2621 2533 3148 3544 4273 4921 2950 3780 4461\...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 Ohgas are a prestigious fami...
[{"type": "stdin_stdout", "input": "4\n1000000\n8\n2\n0 0.7358189007888192 3000\n1 0.17615020446016216 3825\n6620000\n7\n2\n0 0.6920348397011968 48227\n0 0.0740966796875 40942\n56271855\n4\n4\n0 0.19624457693261887 30754\n1 0.00634765625 26165\n0 1.6296802800223897 27575\n0 0.8924194187554844 10932\n6380784\n0\n4\n1 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\nComrade Dujikov is busy choosing...
[{"type": "stdin_stdout", "input": "10000 10000 10000\n", "output": "1\n"}, {"type": "stdin_stdout", "input": "10000 10000 10000\n", "output": "1\n"}, {"type": "stdin_stdout", "input": "1 10000 10000\n", "output": "1\n"}, {"type": "stdin_stdout", "input": "10000 1 10000\n", "output": "1\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\nYou are given a string S.\n\nTak...
[{"type": "stdin_stdout", "input": "ARAABHAIKAA", "output": "NO\n"}, {"type": "stdin_stdout", "input": "AR@ABHAIKAA", "output": "NO\n"}, {"type": "stdin_stdout", "input": "AR@ABHAIJAA", "output": "NO\n"}, {"type": "stdin_stdout", "input": "AAJIAHBA@RA", "output": "NO\n"}, {"type": "stdin_stdout", "input": "AAIJAHBA@RA"...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nCoffee Vending Machine Problems ...
[{"input": "239\n[1, 2, 3, 10]", "output": "[26]", "fn_name": "optimal_number_of_coins"}, {"input": "333\n[1, 1, 5, 25]", "output": "[17]", "fn_name": "optimal_number_of_coins"}, {"input": "543\n[1, 3, 5, 25]", "output": "[25]", "fn_name": "optimal_number_of_coins"}, {"input": "777\n[1, 2, 3, 10]", "output": "[80]", "f...
code_functional
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nBash wants to become a Pokemon m...
[{"type": "stdin_stdout", "input": "BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBbbbbbbbbbbbbbbbbbbbbuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuullllllllllllllllllllssssssssssssssssssssaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 has a friend who loves pali...
[{"type": "stdin_stdout", "input": "11635543554796045289140983157483950524203250955411464324183518580611424141988904394156045071683009945\n", "output": "11635543554796045289140983157483950524203250955411464324183518580611424141988904394156045071683009945549900386170540651493409889141424116085815381423464114559052302425...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 Statement\n\nYou want to...
[{"type": "stdin_stdout", "input": "5 4 10\n4 3 1\n6 4 3\n3 2 4\n2 2 1\n0 5 3\n1 2\n2 1\n3 4\n4 5\n3 3 1000\n1000 2 100\n1 7 100\n10 9 100\n1 2\n1 1\n3 2\n1 0 5\n25 25 2\n1 -1 25\n25 25 2\n5 5 100\n1 1 20\n1 1 20\n10 1 1\n10 1 1\n10 1 0\n1 2\n2 1\n3 4\n4 5\n5 3\n3 3 100\n70 17 10\n50 16 20\n90 10 10\n1 2\n2 2\n2 3\n0 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\nPetya has recently started worki...
[{"type": "stdin_stdout", "input": "870 396 187 223 444 202 222 732\n", "output": "999.7945324433952405951409048 550.7817151597707949206572664\n699.8933625471825917263579697 538.6454762496719970710223890\n784.9466812735912958354234092 467.3227381248359985355111945\n314.6021379638620081853339627 -93.56941780067005040577...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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\n**_Given_** *an array...
[{"input": "[-23, 4, -5, 99, -27, 329, -2, 7, -921]", "output": "[-14]", "fn_name": "adjacent_element_product"}, {"input": "[9, 5, 10, 2, 24, -1, -48]", "output": "[50]", "fn_name": "adjacent_element_product"}, {"input": "[5, 6, -4, 2, 3, 2, -23]", "output": "[30]", "fn_name": "adjacent_element_product"}, {"input": "[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\nIn some country there are exactl...
[{"type": "stdin_stdout", "input": "10 11\n1 3\n2 3\n3 4\n4 5\n4 6\n3 7\n3 10\n4 9\n4 10\n7 9\n8 10\n1 1 3\n6 2 3\n", "output": "8\n"}, {"type": "stdin_stdout", "input": "10 11\n1 3\n2 3\n3 4\n4 5\n4 6\n3 7\n3 10\n4 9\n4 10\n7 9\n8 10\n1 1 3\n6 2 5\n", "output": "8\n"}, {"type": "stdin_stdout", "input": "10 11\n1 3\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\nYou are given an infinite checke...
[{"type": "stdin_stdout", "input": "999999999 1000000000 1000000000 -999999999 -1000000000 999999999\n", "output": "1\n"}, {"type": "stdin_stdout", "input": "101304499 148554333 -590787464 -890180401 -117457421 997140710\n", "output": "12\n"}, {"type": "stdin_stdout", "input": "1000000000 1000000000 871940474 991768763...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nAfter a successful year of milk ...
[{"type": "stdin_stdout", "input": "20 8\n7 4 9 6 4 10 5 12 6 13 20 16 11 1 12 10 11 2 3 18\n6 1\n20 4\n10 6\n2 9\n10 17\n13 19\n1 5\n3 1\n", "output": "2 3"}, {"type": "stdin_stdout", "input": "20 8\n7 4 9 6 4 10 5 12 6 13 20 2 11 1 12 10 11 2 3 18\n6 1\n20 4\n10 6\n2 9\n10 17\n13 19\n1 5\n3 1\n", "output": "2 3"}, {"...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nThere are N people, conveniently...
[{"type": "stdin_stdout", "input": "8\n7 5 1 1 7 3 5 3\n", "output": "16\n"}, {"type": "stdin_stdout", "input": "7\n-10 4 1 -2 3 -2 1", "output": "0\n"}, {"type": "stdin_stdout", "input": "7\n-10 4 1 -2 3 -2 0", "output": "0\n"}, {"type": "stdin_stdout", "input": "7\n-20 4 1 -2 3 -2 0", "output": "0\n"}, {"type": "stdi...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nChef loves research! Now he is l...
[{"type": "stdin_stdout", "input": "6\n1 0 2 3 0 4\n", "output": "2\n"}, {"type": "stdin_stdout", "input": "6\n-1 0 2 3 0 6", "output": "2\n"}, {"type": "stdin_stdout", "input": "6\n-1 0 4 3 0 6", "output": "2\n"}, {"type": "stdin_stdout", "input": "6\n-1 0 4 4 0 6", "output": "2\n"}, {"type": "stdin_stdout", "input": ...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nFormula One championship consist...
[{"type": "stdin_stdout", "input": "1\n50\nJamesHunt\nNakajima\nHakkinen\nScheckter\nJones\nHill\nHawthorn\nVettel\nHulkenberg\nSutil\nGlock\nWebber\nAlbertoAscari\nMensel\nBuemi\nKubica\ndiGrassi\nJimClark\nKovalainen\nTrulli\nBarichelo\nSurtees\nJackieStewert\nLauda\nRaikkonen\nVilleneuve\nFangio\nButton\nDeLaRosa\nP...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nShubham has a binary string $s$....
[{"type": "stdin_stdout", "input": "18\n010\n100100011010\n001\n010101\n101\n1100111101101110\n101100\n0001100101001100\n111110101100\n01100\n0110111100\n110101\n10000011001010010001\n0011\n00001010110100000101\n11011101110\n011000011101000010\n1001111110001000\n", "output": "1\n4\n0\n2\n1\n4\n1\n6\n2\n1\n2\n2\n6\n0\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\nYou are given a string $s$ consi...
[{"type": "stdin_stdout", "input": "9\n4 4\n0????1?0\n3 3\n??????\n1 0\n?\n2 2\n1001\n2 2\n01?0\n0 1\n0\n0 3\n?11\n2 2\n?00?\n4 3\n??010?0\n", "output": "00111100\n-1\n0\n1001\n0110\n-1\n111\n1001\n0101010\n"}, {"type": "stdin_stdout", "input": "9\n4 4\n0?????10\n3 3\n??????\n1 0\n?\n2 2\n0110\n2 2\n01?0\n0 1\n0\n0 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\nCucumber boy is fan of Kyubeat, ...
[{"type": "stdin_stdout", "input": "4\n15168\n..7.\n.7..\n7...\n", "output": "YES\n"}, {"type": "stdin_stdout", "input": "1\n.135\n1247\n3468\n5789\n", "output": "YES\n"}, {"type": "stdin_stdout", "input": "5\n..1.\n1111\n..1.\n..1.\n", "output": "YES\n"}, {"type": "stdin_stdout", "input": "1\n....\n....\n....\n....\n"...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nRead problems statements in Mand...
[{"type": "stdin_stdout", "input": "11 0 1\n3 4 1\n3 1 9\n0 15 0\n3 4 1", "output": "0 0 0 0 0 0 0 0 0 0 0\n"}, {"type": "stdin_stdout", "input": "10 0 0\n2 4 9\n6 1 1\n0 0 0\n-1 10 1", "output": "0 0 0 0 0 0 0 0 0 -1\n"}, {"type": "stdin_stdout", "input": "10 0 1\n4 4 9\n3 1 8\n0 8 0\n4 10 1", "output": "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\nThere are $n$ persons located on...
[{"type": "stdin_stdout", "input": "2\n2\n1000000000 1000000000 -1000000000 -1685444969\n-1000000000 -1073004450 1000010100 1000100000\n2\n1100000000 1000000000 -1000000000 -1742607922\n-1854126016 -1929941902 1000000000 1000000000\n", "output": "0\n0\n"}, {"type": "stdin_stdout", "input": "2\n2\n1000000000 1000000000 ...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nSelection of Participants of an ...
[{"type": "stdin_stdout", "input": "5\n10 0 1 10 14\n5\n1 5 25 9 11\n7\n10 20 83 43 143 31 62\n0", "output": "0\n2\n10\n"}, {"type": "stdin_stdout", "input": "5\n10 10 10 10 10\n5\n1 5 8 9 11\n7\n11 34 83 47 44 29 70\n0", "output": "0\n1\n3\n"}, {"type": "stdin_stdout", "input": "5\n10 10 10 1 10\n5\n1 5 8 13 11\n7\n11...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nTakahashi is a teacher responsib...
[{"type": "stdin_stdout", "input": "91\n13 42 58 64 76 15 46 37 62 71 25 14 3 61 2 75 44 45 65 74 79 48 41 72 1 10 73 8 63 83 47 36 40 33 87 7 23 38 54 28 60 29 35 57 80 5 11 43 66 50 30 21 12 20 19 51 27 82 69 70 4 68 89 78 17 18 67 26 91 56 9 53 49 32 6 39 84 22 88 59 55 86 24 34 81 85 52 77 31 90 16\n", "output": "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 an integer $n$.\n\...
[{"type": "stdin_stdout", "input": "7\n1\n14\n73\n30\n14\n39\n1000000000000000000\n", "output": "0\n-1\n-1\n6\n-1\n-1\n72\n"}, {"type": "stdin_stdout", "input": "7\n1\n7\n73\n52\n14\n39\n1000000000000000000\n", "output": "0\n-1\n-1\n-1\n-1\n-1\n72\n"}, {"type": "stdin_stdout", "input": "7\n1\n14\n73\n30\n14\n27\n100000...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nAfter a long day, Alice and Bob ...
[{"type": "stdin_stdout", "input": "40\n5 40 6 27 39 37 17 34 3 30 28 13 12 8 11 10 31 4 1 16 38 22 29 35 33 23 7 9 24 14 18 26 19 21 15 36 2 20 32 25\n", "output": "ABABBBABABAAAAAABAAABBBBBBAAAABABBABABBB\n"}, {"type": "stdin_stdout", "input": "40\n5 40 6 27 39 37 17 34 3 30 28 13 12 8 11 10 31 4 1 16 38 22 29 35 33 ...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nFactorize a given integer n.\n\n...
[{"type": "stdin_stdout", "input": "128", "output": "128: 2 2 2 2 2 2 2\n"}, {"type": "stdin_stdout", "input": "216", "output": "216: 2 2 2 3 3 3\n"}, {"type": "stdin_stdout", "input": "64", "output": "64: 2 2 2 2 2 2\n"}, {"type": "stdin_stdout", "input": "112", "output": "112: 2 2 2 2 7\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\nThere are n people taking part i...
[{"type": "stdin_stdout", "input": "5\n3 4\n1 14\n4 20\n3 22\n5 28\n31\n1 1\n1 2\n2 1 2\n1 3\n2 1 3\n2 2 3\n3 1 2 3\n1 4\n2 1 4\n2 2 4\n3 1 2 4\n2 3 4\n3 1 3 4\n3 2 3 4\n4 1 2 3 4\n1 5\n2 1 5\n2 2 5\n3 1 2 5\n2 3 5\n3 1 3 5\n3 2 3 5\n4 1 2 3 5\n2 4 5\n3 1 4 5\n3 2 4 5\n4 1 2 4 5\n3 3 4 5\n4 1 3 4 5\n4 2 3 4 5\n5 1 2 3 ...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nYou are given an array $a$ consi...
[{"type": "stdin_stdout", "input": "100\n74 88 64 8 9 27 63 64 79 97 92 38 26 1 4 4 2 64 53 62 24 82 76 40 48 58 40 59 3 56 35 37 0 30 93 71 14 97 49 37 96 59 56 55 70 88 77 99 51 55 71 25 10 31 26 50 61 18 35 55 49 33 86 25 65 74 89 99 5 27 2 9 67 29 76 68 66 22 68 59 63 16 62 25 35 57 63 35 41 68 86 22 91 67 61 3 92 ...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 schoolboy named Vasya loves re...
[{"type": "stdin_stdout", "input": "168\n0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 1 0 1 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 0 1 0 1 0 1...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nIn Arcady's garden there grows a...
[{"type": "stdin_stdout", "input": "100\n1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 ...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 Takahashi Kingdom, which once...
[{"type": "stdin_stdout", "input": "3\n0 1000000000 1000000000\n1000000000 0 1000000000\n1000000000 1000000000 0\n", "output": "3000000000\n"}, {"type": "stdin_stdout", "input": "3\n0 1000000000 1000000000\n1000000000 0 1000000000\n1000000000 1000000000 0", "output": "3000000000"}, {"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\nNow that Chef has finished bakin...
[{"type": "stdin_stdout", "input": "2\n2\n137", "output": "2\n69\n"}, {"type": "stdin_stdout", "input": "2\n14\n35", "output": "8\n18\n"}, {"type": "stdin_stdout", "input": "2\n16\n35", "output": "9\n18\n"}, {"type": "stdin_stdout", "input": "2\n12\n35", "output": "7\n18\n"}, {"type": "stdin_stdout", "input": "2\n7\n26...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nDisclaimer: there are lots of un...
[{"type": "stdin_stdout", "input": "228\n1 3 1 7 1 3 1 15 1 3 1 7 1 3 1 31 1 3 1 7 1 3 1 15 1 3 1 7 1 3 1 63 1 3 1 7 1 3 1 15 1 3 1 7 1 3 1 31 1 3 1 7 1 3 1 15 1 3 1 7 1 3 1 127 1 3 1 7 1 3 1 15 1 3 1 7 1 3 1 31 1 3 1 7 1 3 1 15 1 3 1 7 1 3 1 63 1 3 1 7 1 3 1 15 0 3 1 13 1 3 1 31 1 3 1 7 1 3 1 15 1 3 1 7 1 3 1 255 1 3 ...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nA frog is about to return to the...
[{"type": "stdin_stdout", "input": "115 172", "output": "115\n"}, {"type": "stdin_stdout", "input": "135 191", "output": "135\n"}, {"type": "stdin_stdout", "input": "170 176", "output": "170\n"}, {"type": "stdin_stdout", "input": "208 133", "output": "76\n"}, {"type": "stdin_stdout", "input": "194 102", "output": "93\n...
code_stdio