messages
listlengths
1
1
ground_truth
stringlengths
88
726k
dataset
stringclasses
2 values
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nLet's define the cost of a strin...
[{"type": "stdin_stdout", "input": "97849 7\n", "output": "aabacadaeafagbbcbdbebfbgccdcecfcgddedfdgeefegffggaabacadaeafagbbcbdbebfbgccdcecfcgddedfdgeefegffggaabacadaeafagbbcbdbebfbgccdcecfcgddedfdgeefegffggaabacadaeafagbbcbdbebfbgccdcecfcgddedfdgeefegffggaabacadaeafagbbcbdbebfbgccdcecfcgddedfdgeefegffggaabacadaeafagbbc...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nMarina loves strings of the same...
[{"type": "stdin_stdout", "input": "100 85\njknccpmanwhxqnxivdgguahjcuyhdrazmbfwoptatlgytakxsfvdzzcsglhmswfxafxyregdbeiwpawrjgwcqrkbhmrfcscgoszf\nhknccpmanwhxjnxivdggeahjcuyhdrazmbfwoqtatlgytdkxsfvdztcsglhmssfxsfxyrngdbeiwpawrjgwcqrkbhmrfcsckoskf\n", "output": "aaaaaaabaaaaaaaaaaaaabaaaaaaaabaaaaaaaabaaaaabaaaaaaaaaaaa...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nIt's a Pokemon battle! Your task...
[{"input": "\"electric\"\n\"fire\"\n100\n100", "output": "[50]", "fn_name": "calculate_damage"}, {"input": "\"grass\"\n\"electric\"\n57\n19", "output": "[150]", "fn_name": "calculate_damage"}, {"input": "\"grass\"\n\"water\"\n100\n100", "output": "[100]", "fn_name": "calculate_damage"}, {"input": "\"fire\"\n\"electric\...
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\nIgor the analyst fell asleep on ...
[{"type": "stdin_stdout", "input": "4\n17501 63318 51967 74514\n1305 84026 135736 -78504\n41159 81000 -44104 -42722\n31063 65435 25578 33487\n18330 79949 83467 -74531\n", "output": "0.15181873510135294\n"}, {"type": "stdin_stdout", "input": "4\n17501 63318 51967 74514\n1305 84026 135736 -78504\n41159 81000 -44104 -4272...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nHeidi has finally found the myth...
[{"type": "stdin_stdout", "input": "10\n5 1\n1 2\n9 1\n10 8\n6 3\n8 5\n2 7\n2 3\n10 4\n", "output": "10\n"}, {"type": "stdin_stdout", "input": "10\n5 1\n1 2\n9 5\n10 5\n6 3\n8 10\n2 7\n2 3\n1 4\n", "output": "11\n"}, {"type": "stdin_stdout", "input": "10\n5 1\n1 2\n9 5\n10 5\n6 3\n8 10\n2 7\n1 3\n1 4\n", "output": "12\...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 popular reality show is recrui...
[{"type": "stdin_stdout", "input": "34 5\n2 2 5 4 3 1 3 5 3 1 3 1 3 5 5 2 1 3 3 3 1 1 1 4 5 1 3 2 5 5 2 1 2 2\n1357 797 4642 4072 3953 4020 207 344 1412 4061 400 214 708 389 567 3294 1336 3746 1513 3539 4220 4720 329 4516 1741 1744 2537 3963 4941 664 1169 4512 3358 4144\n-4668 -1085 109 -899 769 -1132 -2587 1503 760 -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\nPolycarp plays a computer game (...
[{"type": "stdin_stdout", "input": "6\n1 5\n0 10\n1 -5\n1 14\n1 11\n0 -10\n", "output": "5\n25\n10\n34\n59\n39\n"}, {"type": "stdin_stdout", "input": "6\n1 5\n0 10\n1 -5\n0 14\n1 11\n0 -10\n", "output": "5\n25\n10\n24\n49\n39\n"}, {"type": "stdin_stdout", "input": "6\n1 5\n0 10\n1 -5\n1 14\n1 16\n0 -10\n", "output": "5...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nLet's call an array good if ther...
[{"type": "stdin_stdout", "input": "4\n500000 500000 1000000 1000000\n", "output": "2\n3 4 \n"}, {"type": "stdin_stdout", "input": "4\n500000 500000 1000000 1000000\n", "output": "2\n3 4\n"}, {"type": "stdin_stdout", "input": "4\n500000 251993 1000000 1000000\n", "output": "0\n\n"}, {"type": "stdin_stdout", "input": "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\nIn Aizuwakamatsu Village, which ...
[{"type": "stdin_stdout", "input": "3\n125 -1 15\n108 12 25\n149 10 50\n3\n32 -1 10\n70 10 41\n22 67 84\n0", "output": "NG\nOK\n"}, {"type": "stdin_stdout", "input": "3\n125 -1 15\n108 8 25\n246 10 42\n3\n32 -1 10\n70 10 41\n22 67 129\n0", "output": "NG\nOK\n"}, {"type": "stdin_stdout", "input": "3\n125 -1 15\n108 7 25...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nValera loves to participate in c...
[{"type": "stdin_stdout", "input": "1000 1000 1 1000 1000000 1000000\n", "output": "1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 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\nAssume we take a number `x` and ...
[{"input": "[558, 744, 1488, 279, 2232, 1116]", "output": "[[279, 558, 1116, 2232, 744, 1488]]", "fn_name": "solve"}, {"input": "[12, 3, 9, 4, 6, 8]", "output": "[[9, 3, 6, 12, 4, 8]]", "fn_name": "solve"}, {"input": "[4, 8, 6, 3, 12, 9]", "output": "[[9, 3, 6, 12, 4, 8]]", "fn_name": "solve"}, {"input": "[3000, 9000]"...
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\nWe have weather records at AtCod...
[{"type": "stdin_stdout", "input": "RRS\n", "output": "2\n"}, {"type": "stdin_stdout", "input": "SSS\n", "output": "0\n"}, {"type": "stdin_stdout", "input": "RSR\n", "output": "1\n"}, {"type": "stdin_stdout", "input": "SRS\n", "output": "1\n"}, {"type": "stdin_stdout", "input": "SSR\n", "output": "1\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\nVova again tries to play some co...
[{"type": "stdin_stdout", "input": "100 72\n8 8 7 9 6 1 4 5 3 7 5 10 5 4 1 3 4 1 3 1 6 6 4 5 4 5 6 1 10 7 9 1 6 10 6 6 9 3 3 4 5 9 4 9 8 1 5 9 3 7 1 8 5 2 1 1 7 7 7 6 6 4 2 9 10 2 8 3 1 1 4 8 5 9 7 10 9 4 2 3 7 7 6 7 8 5 1 3 8 5 1 8 9 10 3 7 1 8 10 5\n", "output": "4549\n"}, {"type": "stdin_stdout", "input": "100 72\n8...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nOn a circle lie $2n$ distinct po...
[{"type": "stdin_stdout", "input": "4\n6 2\n8 2\n1 4\n1 1\n2 1\n2 0\n10 2\n14 12\n4 20\n9 10\n13 18\n30 18\n11 7\n", "output": "12\n0\n1\n32\n"}, {"type": "stdin_stdout", "input": "4\n5 2\n8 2\n1 4\n1 1\n2 1\n2 0\n15 1\n13 12\n4 20\n9 10\n13 18\n30 18\n13 12\n", "output": "7\n0\n1\n91\n"}, {"type": "stdin_stdout", "inp...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nThere is a square matrix n × n, ...
[{"type": "stdin_stdout", "input": "10\n10 8 6 5 9 8 2 5 3 2\n3 1 8 10 8 10 5 10 7 8\n5 9 7 7 4 9 7 2 5 2\n5 9 9 5 4 2 6 6 8 1\n10 6 9 9 10 5 6 3 5 9\n6 7 10 3 1 4 3 6 7 6\n10 10 4 7 4 4 8 2 7 4\n10 5 8 2 2 7 4 4 1 4\n8 4 6 10 10 6 1 3 3 1\n9 9 7 2 11 5 1 8 6 3\n", "output": "1\nDRDDDRRDDDRRDRDRRR\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\nPavel made a photo of his favour...
[{"type": "stdin_stdout", "input": "2\n282238675 111160538 526707498 169652181\n", "output": "14299383119546189\n"}, {"type": "stdin_stdout", "input": "2\n229872385 40870434 715428884 160550871\n", "output": "46761413035493300\n"}, {"type": "stdin_stdout", "input": "2\n186213023 111160538 526707498 169652181\n", "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\nIn fact, the problems E1 and E2 ...
[{"type": "stdin_stdout", "input": "6\n4\n2 11 8 -1\n3\n10 2 1\n3\n3 10 2\n4\n1 2 1 -1\n4\n4 0 1 6\n5\n1 5 1 -1 0\n", "output": "1\n0\n0\n0\n1\n1\n"}, {"type": "stdin_stdout", "input": "6\n4\n2 11 8 -1\n3\n10 2 1\n3\n5 10 2\n4\n1 2 1 -1\n4\n1 0 1 6\n5\n1 5 1 -1 0\n", "output": "1\n0\n0\n0\n0\n1\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\nLet’s try a dice puzzle. The rul...
[{"type": "stdin_stdout", "input": "4\n0 0 1\n0 1 0\n0 2 2\n0 2 2\n1 2 2\n6 -1 0\n0 7 4\n0 4 1\n4 1 0\n6 1 0\n12 -1 0\n4 1 -2\n1 -1 0\n1 2 0\n0 -1 -1\n5 1 2\n10 0 2\n-2 1 -2\n3 -1 -1\n-1 6 -2\n0 0 -1\n0 1 0\n-2 1 0\n3 0 0", "output": "0\n0\n0\n0\n"}, {"type": "stdin_stdout", "input": "4\n0 0 1\n0 1 0\n0 2 2\n0 2 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\nImplement a function to calculat...
[{"input": "[[[[], [], [[[[[[[[[[]]]]]]]]]]], [], [], [[[], [[]]]]], []]", "output": "[0]", "fn_name": "sum_nested"}, {"input": "[1, [1], [1, [1]], [1, [1], [1, [1]]]]", "output": "[8]", "fn_name": "sum_nested"}, {"input": "[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10]", "output": "[55]", "fn_name": "sum_nested"}, {"input": "[1, ...
code_functional
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nConsider the numbers `6969` and ...
[{"input": "60000\n130000", "output": "[55]", "fn_name": "solve"}, {"input": "60000\n70000", "output": "[15]", "fn_name": "solve"}, {"input": "1000\n10000", "output": "[20]", "fn_name": "solve"}, {"input": "10000\n15000", "output": "[6]", "fn_name": "solve"}, {"input": "15000\n20000", "output": "[9]", "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\nPolycarp has spent the entire da...
[{"type": "stdin_stdout", "input": "7\n10 3 6 4\n11 3 6 4\n5 9 4 10\n6 5 2 3\n1 1 1 1\n3947465 47342 338129 123123\n234123843 13 361451236 361451000\n", "output": "27\n27\n9\n-1\n1\n6471793\n358578060125049\n"}, {"type": "stdin_stdout", "input": "7\n10 3 6 4\n11 3 6 0\n5 9 4 10\n6 5 2 3\n1 1 1 1\n3947465 47342 338129 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 Finite Encyclopedia of Intege...
[{"type": "stdin_stdout", "input": "0 39", "output": "0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0\n"}, {"type": "stdin_stdout", "input": "0 28", "output": "0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0\n"}, {"type": "stdin_stdout", "input": "13 27", "output": "7 7 7 7 7 7 7 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\nWilliam has a favorite bracket s...
[{"type": "stdin_stdout", "input": "50\n980145241 167620437 937571657 683888733 687342940 596264451 470954757 312707590 782743417 441517678 539214535 498906886 521201165 581866343 987986939 770597138 136540061 812371324 567649512 704604401 873600670 364129557 600605741 459396557 173915633 607977424 480952533 834953681 ...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 recently found Ancient Prophes...
[{"type": "stdin_stdout", "input": "12-12-201312-12-201312-12-201313--12-201313--12-201313--12-201313--12-201313--12-201313--12-201313--12-201313--12-2013\n", "output": "12-12-2013\n"}, {"type": "stdin_stdout", "input": "12-12-211312-12-201312-12-201313--12-201313--02-201313--12-201313--12-201313--12-201313--12-201313-...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 game by Playrix it takes...
[{"type": "stdin_stdout", "input": "1000 1000 1000 1000\n", "output": "NO\n"}, {"type": "stdin_stdout", "input": "1000 1000 1000 1000\n", "output": "NO\n"}, {"type": "stdin_stdout", "input": "1000 1000 1001 1000\n", "output": "NO\n"}, {"type": "stdin_stdout", "input": "1000 1000 1 1000\n", "output": "YES\n"}, {"type": ...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nTakahashi and Aoki are playing a...
[{"type": "stdin_stdout", "input": "200\n48018902 1000000000\n671608134 1000000000\n821230959 1000000000\n839046240 1000000000\n871451860 1000000000\n201326387 1000000000\n95653264 1000000000\n118998199 1000000000\n661381768 1000000000\n265950246 1000000000\n443323091 1000000000\n621558889 1000000000\n486583499 1000000...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nJohn Doe has an n × m table. Joh...
[{"type": "stdin_stdout", "input": "100 1000000000000000000 10000\n", "output": " 1\n"}, {"type": "stdin_stdout", "input": "1 1000000000000000000 0\n", "output": " 1\n"}, {"type": "stdin_stdout", ...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nThe research center Q has develo...
[{"type": "stdin_stdout", "input": "100 1 100\n59\n37\n53\n72\n37\n15\n8\n93\n92\n74\n11\n11\n68\n16\n92\n40\n76\n20\n10\n86\n76\n5\n9\n95\n5\n81\n44\n57\n10\n24\n22\n2\n57\n6\n26\n67\n48\n95\n34\n97\n55\n33\n70\n66\n51\n70\n74\n65\n35\n85\n37\n9\n27\n43\n65\n6\n5\n57\n54\n27\n22\n41\n8\n29\n10\n50\n9\n68\n78\n9\n92\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\nRead problems statements in Mand...
[{"type": "stdin_stdout", "input": "2\n1 18\n76 209", "output": "139\n15682\n"}, {"type": "stdin_stdout", "input": "2\n1 16\n76 209", "output": "108\n15682\n"}, {"type": "stdin_stdout", "input": "2\n1 7\n114 127", "output": "25\n1447\n"}, {"type": "stdin_stdout", "input": "2\n1 7\n76 209", "output": "25\n15682\n"}, {"t...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nYou are given a string S of leng...
[{"type": "stdin_stdout", "input": "50 27\nACBCABCCCAACACCBBBACCBCBBBCCBAAAABAACACAAACCACCCCA\n", "output": "ACBCABCCCAACACCBBBACCBCBBBcCBAAAABAACACAAACCACCCCA\n"}, {"type": "stdin_stdout", "input": "50 50\nCABABCBBCBABCAACBCBBAAAACBCBCBBABBABBBCCBAACCAACAB\n", "output": "CABABCBBCBABCAACBCBBAAAACBCBCBBABBABBBCCBAACCAA...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 you want to get the square ...
[{"input": "10", "output": "[[1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 2047]]", "fn_name": "f"}, {"input": "6", "output": "[[1, 2, 4, 8, 16, 32, 64, 127]]", "fn_name": "f"}, {"input": "3", "output": "[[1, 2, 4, 8, 15]]", "fn_name": "f"}, {"input": "2", "output": "[[1, 2, 4, 7]]", "fn_name": "f"}, {"input": "1", "ou...
code_functional
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nproblem\n\nIn the area where Kaz...
[{"type": "stdin_stdout", "input": "3 5\n10\n25\n15\n50\n30\n15\n12\n30", "output": "855\n"}, {"type": "stdin_stdout", "input": "3 5\n10\n38\n18\n50\n30\n6\n40\n30", "output": "1068\n"}, {"type": "stdin_stdout", "input": "3 5\n10\n38\n18\n50\n30\n6\n40\n34", "output": "1140\n"}, {"type": "stdin_stdout", "input": "3 5\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 was a big bank robbery in ...
[{"type": "stdin_stdout", "input": "\u0412 \u044d\u0442\u043e\u0439 \u0437\u0430\u0434\u0430\u0447\u0435 \u043d\u0435\u0442 \u043f\u0440\u0438\u043c\u0435\u0440\u043e\u0432 \u0432\u0432\u043e\u0434\u0430-\u0432\u044b\u0432\u043e\u0434\u0430.\nThis problem doesn't have sample inout and output.", "output": "2000\n1 1 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\nDora loves adventures quite a lo...
[{"type": "stdin_stdout", "input": "1 100\n855 316 601 28 311 798 783 276 504 1230 521 358 377 467 623 767 481 645 855 608 157 95 273 261 110 713 948 897 872 476 855 337 147 377 648 441 215 1231 505 69 858 99 877 187 237 115 824 98 955 192 773 99 538 385 861 849 772 993 470 249 582 635 986 515 84 7 476 831 903 74 79 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\nNote that the memory limit is un...
[{"type": "stdin_stdout", "input": "20\n27 6 6 60 47 97 62 25 67 28 41 93 65 32 16 56 57 53 66 61\n84392 -11227 -93200 -52089 4854 -99982 -81560 95957 -35579 -91088 31023 -68447 -41338 -27132 43558 23876 35055 -36267 77633 -94930\n", "output": "294839\n"}, {"type": "stdin_stdout", "input": "20\n27 6 6 60 47 97 62 25 67...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nYou are given a colored permutat...
[{"type": "stdin_stdout", "input": "3\n4\n1 3 4 2\n1 1 2 3\n5\n2 3 4 5 1\n1 2 5 10 3\n8\n7 4 5 6 1 8 3 2\n5 3 4 4 12 5 8 9\n", "output": "1\n5\n4\n"}, {"type": "stdin_stdout", "input": "3\n4\n1 3 4 2\n1 2 2 3\n5\n2 3 4 5 1\n1 2 10 4 5\n8\n7 4 5 6 1 8 3 2\n5 3 6 4 7 5 8 4\n", "output": "1\n5\n2\n"}, {"type": "stdin_stdo...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nIchihime is the current priestes...
[{"type": "stdin_stdout", "input": "14\n2374453 2374454 8591131 23094546\n5813291 5813292 9709163 35032815\n4280399 23049698 23049701 34728360\n15184184 18688462 22400847 22400849\n24397371 31462070 33936330 33936331\n21376685 28241116 38909200 38909202\n29491847 31628480 31628482 45225214\n15144763 15414479 36902879 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\nJAG mock qualifying practice ses...
[{"type": "stdin_stdout", "input": "5 3\n1 1\n2 3\n3 2\n3 17\n2 1\n4 2\n1 7\n2 1\n1 3\n2 5\n6 1\n1 3\n1 2\n1 8\n1 2\n1 7\n1 6\n20 9\n4 10\n2 6\n8 3\n1 6\n6 3\n7 4\n8 10\n4 12\n7 5\n1 8\n5 7\n1 5\n4 6\n9 9\n5 8\n6 7\n1 4\n6 4\n7 10\n3 5\n19 6\n4 2\n6 5\n5 10\n1 10\n3 10\n3 6\n2 3\n1 4\n2 10\n1 8\n3 4\n3 1\n5 4\n1 10\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\nCreate a function that takes any...
[{"input": "\"oranges, apples, melon, pineapple\"", "output": "[\"or ang es appl esm el onp in e appl e\"]", "fn_name": "vowel_start"}, {"input": "\"It is beautiful weather today!\"", "output": "[\"it isb e a ut if ulw e ath ert od ay\"]", "fn_name": "vowel_start"}, {"input": "\"my number is 0208-533-2325\"", "output":...
code_functional
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nVasya wants to turn on Christmas...
[{"type": "stdin_stdout", "input": "1 100\n100 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 ...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nBerkomnadzor — Federal Service f...
[{"type": "stdin_stdout", "input": "35\n-0.0.0.47\n+0.0.0.39/32\n+0.0.0.23\n+0.0.0.6/31\n-0.0.0.2\n+0.0.0.8/32\n+0.0.0.54/32\n-0.0.0.43\n-0.0.0.31/32\n-0.0.0.0\n+0.0.0.26/32\n-0.0.0.42\n+0.0.0.52\n-0.0.0.10/31\n+0.0.0.53\n+0.0.0.28/32\n-0.0.0.19/32\n-0.0.0.12\n-0.0.0.16/31\n-0.0.0.35/32\n+0.0.0.51\n+0.0.0.24/31\n-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\nRingo is giving a present to Snu...
[{"type": "stdin_stdout", "input": "UKINIKAY", "output": "No\n"}, {"type": "stdin_stdout", "input": "UAKOYAKI", "output": "No\n"}, {"type": "stdin_stdout", "input": "NKIUIKAY", "output": "No\n"}, {"type": "stdin_stdout", "input": "IKAYOKAU", "output": "No\n"}, {"type": "stdin_stdout", "input": "NKIUAKIY", "output": "No...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 two ...
[{"type": "stdin_stdout", "input": "3 0\n-1 2\n15 3\n0 0", "output": "0 3\n-1 2\n3 15\n"}, {"type": "stdin_stdout", "input": "3 -1\n0 2\n27 3\n0 0", "output": "-1 3\n0 2\n3 27\n"}, {"type": "stdin_stdout", "input": "4 -1\n0 2\n27 3\n0 0", "output": "-1 4\n0 2\n3 27\n"}, {"type": "stdin_stdout", "input": "4 -1\n0 2\n18 ...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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, Yasser and Adel are at th...
[{"type": "stdin_stdout", "input": "12\n3\n7 -4 5\n3\n7 -5 4\n3\n4 -5 7\n3\n5 -4 7\n4\n5 -5 -6 6\n5\n100 100 100 -50 50\n10\n11 5 -12 7 -10 20 30 -10 50 60\n10\n10 5 -14 7 -7 20 30 -50 50 60\n2\n1 1\n2\n-1 -1\n3\n1000000000 1010000000 1000000000\n3\n-1000000000 -1000000000 -1000000000\n", "output": "YES\nNO\nNO\nYES\nN...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nGildong was hiking a mountain, w...
[{"type": "stdin_stdout", "input": "14\n4 9\n3 7\n4 1\n3 2\n14 9\n7 6\n10 13\n8 7\n5 7\n7 10\n1 3\n12 3\n7 11\n20\n13 6 14 9 1\n6 4 3 7 9\n9 3 6 13 7\n6 11 11 5 9\n14 5 2 3 4\n13 12 4 2 7\n13 14 7 3 2\n9 5 13 13 6\n8 9 7 3 7\n14 10 11 12 7\n6 12 13 1 1\n8 13 8 10 8\n1 5 13 10 7\n1 4 13 2 6\n1 5 6 4 10\n6 9 11 8 5\n9 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\nImagine a city with n horizontal...
[{"type": "stdin_stdout", "input": "20 20\n><<><<<<<<<>>><>>><<\n^^^^^^^^vvvv^vv^vvvv\n", "output": "YES\n"}, {"type": "stdin_stdout", "input": "20 20\n<>>>>>>>><>>><>><<<>\nvv^^vv^^^^v^vv^v^^^^\n", "output": "YES\n"}, {"type": "stdin_stdout", "input": "20 20\n>>><<<<<>>><><><<><<\n^^^vvv^^^v^^v^^v^vvv\n", "output": "Y...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 l is an odd number, the med...
[{"type": "stdin_stdout", "input": "6\n5 -1 -1 -1 13 -1", "output": "-1\n-1\n-1\n-1\n-1\n-1\n"}, {"type": "stdin_stdout", "input": "6\n5 -1 -1 -1 13 0", "output": "-1\n0\n0\n0\n-1\n-1\n"}, {"type": "stdin_stdout", "input": "6\n5 -2 -1 0 15 -2", "output": "-1\n0\n0\n-1\n-1\n0\n"}, {"type": "stdin_stdout", "input": "6\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\nAn NBA game runs 48 minutes (Fou...
[{"input": "16\n27", "output": "[28.4]", "fn_name": "nba_extrap"}, {"input": "11\n19", "output": "[27.8]", "fn_name": "nba_extrap"}, {"input": "14\n33", "output": "[20.4]", "fn_name": "nba_extrap"}, {"input": "1\n7.5", "output": "[6.4]", "fn_name": "nba_extrap"}, {"input": "6\n13", "output": "[22.2]", "fn_name": "nba_e...
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\nChildan is making up a legendary...
[{"type": "stdin_stdout", "input": "12 1 1\n0 1 2 3 2 5 6 11 0 10 10 17\n001010001000\n001010001000 100\n", "output": "1\n"}, {"type": "stdin_stdout", "input": "12 1 1\n0 1 2 3 2 6 6 11 0 10 10 17\n001010001000\n001010001000 100\n", "output": "1\n"}, {"type": "stdin_stdout", "input": "12 1 1\n0 1 2 3 2 2 6 11 0 10 10 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\nLet's denote that some array $b$...
[{"type": "stdin_stdout", "input": "10 11\n-1 11 -1 -1 -1 -1 10 -1 -1 -1\n", "output": "100000000\n"}, {"type": "stdin_stdout", "input": "10 11\n-1 11 -1 -1 -1 -1 10 -1 -1 -1\n", "output": "100000000\n"}, {"type": "stdin_stdout", "input": "10 17\n-1 11 -1 -1 -1 -1 10 -1 -1 -1\n", "output": "301989884\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\nIn the 17th century, Fermat wrot...
[{"type": "stdin_stdout", "input": "6\n3\n13\n0", "output": "27\n11\n126\n"}, {"type": "stdin_stdout", "input": "6\n25\n12\n0", "output": "27\n64\n54\n"}, {"type": "stdin_stdout", "input": "6\n6\n15\n0", "output": "27\n27\n119\n"}, {"type": "stdin_stdout", "input": "6\n15\n2\n0", "output": "27\n119\n6\n"}, {"type": "st...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nSig has built his own keyboard. ...
[{"type": "stdin_stdout", "input": "01B0\n", "output": "00\n"}, {"type": "stdin_stdout", "input": "B010", "output": "010\n"}, {"type": "stdin_stdout", "input": "B110", "output": "110\n"}, {"type": "stdin_stdout", "input": "B011", "output": "011\n"}, {"type": "stdin_stdout", "input": "B101", "output": "101\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\nKolya Gerasimov loves kefir very...
[{"type": "stdin_stdout", "input": "1000000000000000000\n999999998000000000\n999999999000000000\n999999998000000000\n", "output": " 3\n"}, {"type": "stdin_stdout", "input": "1\n1000000000000000000\n1000000000\n999999999\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 this Kata you are a game deve...
[{"input": "769832696988485\n170", "output": "[\"You have already reached level 170.\"]", "fn_name": "xp_to_target_lvl"}, {"input": "10396\n11", "output": "[\"You have already reached level 11.\"]", "fn_name": "xp_to_target_lvl"}, {"input": "2017\n4", "output": "[\"You have already reached level 4.\"]", "fn_name": "xp_...
code_functional
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\n## Task\n\nGiven a positive inte...
[{"input": "127", "output": "[247]", "fn_name": "halving_sum"}, {"input": "320", "output": "[638]", "fn_name": "halving_sum"}, {"input": "101", "output": "[198]", "fn_name": "halving_sum"}, {"input": "257", "output": "[512]", "fn_name": "halving_sum"}, {"input": "25", "output": "[47]", "fn_name": "halving_sum"}, {"inpu...
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 bad weather continues and veg...
[{"type": "stdin_stdout", "input": "4 2\n50 40 100 80\n7 3\n400 139 100 700 200 600 500\n0 0", "output": "150\n2000\n"}, {"type": "stdin_stdout", "input": "4 2\n50 40 100 80\n7 3\n400 300 100 700 116 600 500\n0 0", "output": "150\n2100\n"}, {"type": "stdin_stdout", "input": "4 3\n50 40 100 80\n7 3\n400 290 000 1162 352...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nTwo neighboring kingdoms decided...
[{"type": "stdin_stdout", "input": "100\nRUURUURRUURUUUUURRUUURRRRUURRURRURRRRUUUUUURRUURRRRURUUURUURURRRRRURUURRUURUURRUUURUUUUUURRUUUURUUUR\n", "output": "3\n"}, {"type": "stdin_stdout", "input": "100\nRUURUURRUURUUUUURRUUURRRRUURRURRURRRRUUUUUURRUURRRRURUUURUURURRRRRURUURRUURUURRUUURUUUUUURRUUUURUUUR\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\nLittle boy Gerald studies at sch...
[{"type": "stdin_stdout", "input": "68 74\n51 54\n3 22\n12 24\n3 27\n32 42\n36 55\n60 64\n1 4\n4 23\n11 64\n54 62\n50 56\n21 34\n27 63\n15 54\n28 61\n13 57\n39 53\n12 32\n32 40\n33 67\n55 61\n33 67\n30 37\n15 49\n27 45\n21 41\n8 42\n24 63\n40 48\n28 41\n30 67\n0 4\n7 15\n27 59\n60 62\n25 65\n30 31\n38 67\n24 43\n14 64\...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nCyael is a teacher at a very fam...
[{"type": "stdin_stdout", "input": "2\n17 0\n100 1", "output": "0 17\n100 0\n"}, {"type": "stdin_stdout", "input": "2\n17 0\n101 0", "output": "0 17\n0 101\n"}, {"type": "stdin_stdout", "input": "2\n17 0\n101 1", "output": "0 17\n101 0\n"}, {"type": "stdin_stdout", "input": "2\n10 2\n100 3\n", "output": "5 0\n33 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\nGiven a string made up of letter...
[{"input": "\"abababababababab\"", "output": "[\"babababababababa\"]", "fn_name": "switcheroo"}, {"input": "\"aaabcccbaaa\"", "output": "[\"bbbacccabbb\"]", "fn_name": "switcheroo"}, {"input": "\"ccccc\"", "output": "[\"ccccc\"]", "fn_name": "switcheroo"}, {"input": "\"aaaaa\"", "output": "[\"bbbbb\"]", "fn_name": "swi...
code_functional
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nLet's define a good tree:It is a...
[{"type": "stdin_stdout", "input": "11 11", "output": "459104785\n"}, {"type": "stdin_stdout", "input": "11 14", "output": "737454094\n"}, {"type": "stdin_stdout", "input": "11 28", "output": "685943622\n"}, {"type": "stdin_stdout", "input": "4 10", "output": "994788518\n"}, {"type": "stdin_stdout", "input": "6 10", "o...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\n# Task\n Given a sorted array of...
[{"input": "[-10, -10, -10, -10, -10, -9, -9, -9, -8, -8, -7, -6, -5, -4, -3, -2, -1, 0, 0, 0, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50]", "output": "[15]", "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\nAt the first holiday in spring, ...
[{"type": "stdin_stdout", "input": "100 15 6 10\n6 9 1 7 6 4 1 9 3 2 4 6 2 5 3 10 9 2 9 1 6 5 6 2 3 10 7 10 7 4 5 4 4 4 4 7 1 10 8 4 8 3 10 10 7 4 4 10 6 1 8 5 4 6 2 3 10 3 2 5 7 5 6 10 10 3 4 5 4 3 3 1 7 8 10 10 10 10 8 3 7 4 2 1 8 6 5 6 5 8 7 9 2 1 5 2 4 6 10 8\n6 9 7 8 7 1 4 3 5 8\n", "output": "2\n76 77 \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\nYour task is to sort a given str...
[{"input": "\"d4o dru7nken sh2all w5ith s8ailor wha1t 3we a6\"", "output": "[\"wha1t sh2all 3we d4o w5ith a6 dru7nken s8ailor\"]", "fn_name": "order"}, {"input": "\"4of Fo1r pe6ople g3ood th5e the2\"", "output": "[\"Fo1r the2 g3ood 4of th5e pe6ople\"]", "fn_name": "order"}, {"input": "\"is2 Thi1s T4est 3a\"", "output":...
code_functional
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nSnuke has decided to construct a...
[{"type": "stdin_stdout", "input": "HASFJGHOGAKZZFEGA\n", "output": "12\n"}, {"type": "stdin_stdout", "input": "HASFJGHOGAK[ZFEGA", "output": "12\n"}, {"type": "stdin_stdout", "input": "IBAG[IHNGFKKZSFGB", "output": "11\n"}, {"type": "stdin_stdout", "input": "AIEFZGKAFOFGJZSAH", "output": "14\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\nGiven is a positive even number ...
[{"type": "stdin_stdout", "input": "1100000", "output": "298228697\n"}, {"type": "stdin_stdout", "input": "0110000", "output": "784164463\n"}, {"type": "stdin_stdout", "input": "0110010", "output": "189920713\n"}, {"type": "stdin_stdout", "input": "1100010", "output": "865187132\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 number is self-descriptive whe...
[{"input": "6210001000", "output": "[true]", "fn_name": "self_descriptive"}, {"input": "51120111", "output": "[false]", "fn_name": "self_descriptive"}, {"input": "42101000", "output": "[true]", "fn_name": "self_descriptive"}, {"input": "3211000", "output": "[true]", "fn_name": "self_descriptive"}, {"input": "21230", "o...
code_functional
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nThis version of the problem diff...
[{"type": "stdin_stdout", "input": "162685 187160003\n", "output": "175888140\n"}, {"type": "stdin_stdout", "input": "200000 316925344\n", "output": "253547906\n"}, {"type": "stdin_stdout", "input": "140750 887458748\n", "output": "669831877\n"}, {"type": "stdin_stdout", "input": "197426 364348492\n", "output": "289708...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nLimak and Radewoosh are going to...
[{"type": "stdin_stdout", "input": "50 1\n6 17 44 82 94 127 134 156 187 211 212 252 256 292 294 303 352 355 379 380 398 409 424 434 480 524 584 594 631 714 745 756 777 778 789 793 799 821 841 849 859 878 879 895 925 932 944 952 958 990\n15 16 40 42 45 71 143 100 117 120 174 181 186 318 221 268 289 332 376 394 403 409 4...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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# Background\n\nMy pet bridge-ma...
[{"input": "\"JIHGFEDCBA\"\n\"--........------.-........-........---....-----\"", "output": "[\"GFEDCBAJIH\"]", "fn_name": "ant_bridge"}, {"input": "\"JIHGFEDCBA\"\n\"-.....------........-.......-.......----\"", "output": "[\"CBAJIHGFED\"]", "fn_name": "ant_bridge"}, {"input": "\"JIHGFEDCBA\"\n\"-------.......-.......-...
code_functional
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nThere is an N-car train.\nYou ar...
[{"type": "stdin_stdout", "input": "-108 -1", "output": "-106\n"}, {"type": "stdin_stdout", "input": "-108 71", "output": "-178\n"}, {"type": "stdin_stdout", "input": "-159 71", "output": "-229\n"}, {"type": "stdin_stdout", "input": "-116 71", "output": "-186\n"}, {"type": "stdin_stdout", "input": "-74 36", "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\nAs you know, majority of student...
[{"type": "stdin_stdout", "input": "10 10\n7 29\n10 31\n9 40\n5 17\n5 30\n6 85\n2 53\n7 23\n4 57\n10 9\n", "output": "49\n"}, {"type": "stdin_stdout", "input": "10 10\n5 81\n7 68\n7 48\n1 10\n5 37\n7 97\n8 54\n7 41\n7 56\n5 21\n", "output": "110\n"}, {"type": "stdin_stdout", "input": "10 10\n5 81\n7 68\n7 48\n1 10\n5 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 triangular number is the numbe...
[{"type": "stdin_stdout", "input": "300\n", "output": "YES\n"}, {"type": "stdin_stdout", "input": "406\n", "output": "YES\n"}, {"type": "stdin_stdout", "input": "253\n", "output": "YES\n"}, {"type": "stdin_stdout", "input": "276\n", "output": "YES\n"}, {"type": "stdin_stdout", "input": "496\n", "output": "YES\n"}, {"ty...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nRead problems statements in Mand...
[{"type": "stdin_stdout", "input": "3\n6\n6\n6", "output": "14.7\n14.7\n14.7\n"}, {"type": "stdin_stdout", "input": "3\n1\n6\n6", "output": "1.0\n14.7\n14.7\n"}, {"type": "stdin_stdout", "input": "3\n2\n6\n6", "output": "3.0\n14.7\n14.7\n"}, {"type": "stdin_stdout", "input": "3\n6\n1\n6", "output": "14.7\n1.0\n14.7\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\nDevu and his brother love each o...
[{"type": "stdin_stdout", "input": "10 10\n23 101 38 38 73 54 59 69 44 150\n100 100 100 100 100 100 100 100 100 100\n", "output": "402\n"}, {"type": "stdin_stdout", "input": "10 10\n23 101 38 38 73 54 59 69 44 150\n100 100 100 100 100 100 100 101 100 100\n", "output": "403\n"}, {"type": "stdin_stdout", "input": "10 10\...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nVK news recommendation system da...
[{"type": "stdin_stdout", "input": "40\n19 20 8 13 13 17 1 14 15 20 14 17 2 9 9 10 19 16 6 12 9 7 20 5 12 2 4 4 12 5 4 11 8 1 2 8 11 19 18 4\n52258 5648 46847 9200 63940 79328 118413 54479 1788 60107 8234 64215 15419 84411 50307 78075 92548 17867 43456 7970 1390 99373 97297 90662 82950 678 79356 51351 2794 82477 16508 ...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nTokitsukaze is playing a game de...
[{"type": "stdin_stdout", "input": "1s 2s 3s\n", "output": "0\n"}, {"type": "stdin_stdout", "input": "9m 9m 9m\n", "output": "0\n"}, {"type": "stdin_stdout", "input": "3p 9m 2p\n", "output": "1\n"}, {"type": "stdin_stdout", "input": "8p 2s 9m\n", "output": "2\n"}, {"type": "stdin_stdout", "input": "5s 8m 5s\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're given an array $a$ of len...
[{"type": "stdin_stdout", "input": "36\n398353608 662365068 456456182 594572278 958026500 524977116 903404403 382220192 142092809 137516115 522872496 527845939 116437661 423289717 907151540 961740613 981968938 143206666 773454188 691188206 95402302 602570397 986508327 617421132 46091276 866348540 485487643 843511039 76...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 children in Jzzhu's ...
[{"type": "stdin_stdout", "input": "100 20\n21 19 61 70 54 97 98 14 61 72 25 94 24 56 55 25 12 80 76 11 35 17 80 26 11 94 52 47 84 61 10 2 74 25 10 21 2 79 55 50 30 75 10 64 44 5 60 96 52 16 74 41 20 77 20 44 8 86 74 36 49 61 99 13 54 64 19 99 50 43 12 73 48 48 83 55 72 73 63 81 30 27 95 9 97 82 24 3 89 90 33 14 47 88 ...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nCreate a function that transform...
[{"input": "888887", "output": "[\"eight hundred eighty-eight thousand eight hundred eighty-seven\"]", "fn_name": "number2words"}, {"input": "99997", "output": "[\"ninety-nine thousand nine hundred ninety-seven\"]", "fn_name": "number2words"}, {"input": "7217", "output": "[\"seven thousand two hundred seventeen\"]", "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\nVasya follows a basketball game ...
[{"type": "stdin_stdout", "input": "18\n450 3726 12063 42865 29689 35320 33937 4067 45951 80313 53004 59541 75551 75836 151186 81297 93876 96211\n47\n3393 11375 6494 7645 9549 8499 11145 13121 14801 15578 24104 24125 25871 31280 35036 38969 29966 41342 42708 46033 47491 25404 49152 51905 55002 9827 56565 57901 104645 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\nAdilbek was assigned to a specia...
[{"type": "stdin_stdout", "input": "50\n1000000000 1000000000\n999999999 1000000000\n999999998 1000000000\n999999997 1000000000\n999999996 1000000000\n999999995 1000000000\n999999994 1000000000\n999999900 1000000000\n1 11\n2 11\n3 11\n4 11\n5 11\n6 11\n7 11\n8 11\n9 11\n10 11\n11 11\n4 18\n4 20\n3 19\n3 18\n3 167\n3 15...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nYou are given a string S of leng...
[{"type": "stdin_stdout", "input": "100 26\njysrixyptvsesnapfljeqkytlpeepjopspmkviqdqbdkylvfiawhdjjdvqqvcjmmsgfdmpjwahuwhgsyfcgnefzmqlvtvqqfbfsf\n", "output": "237400\n"}, {"type": "stdin_stdout", "input": "100 26\njysrixyptvsesnapfljeqkytlpeepjopspmkviqdqbdkylvfiawhdjjdvqqvcjmmsgfdmpjwahuwhgsyfcgnefzmqlvtvqqfbfsf\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 cryptography, Caesar cipher i...
[{"type": "stdin_stdout", "input": "xlmw mw xli tmgxyvi xlex m xsso mr ilx xvmt.", "output": "this is the picture that i took in eht trip.\n"}, {"type": "stdin_stdout", "input": "xlmw mw xli tmgxyvi xlex m ossx mr ilx xvmt.", "output": "this is the picture that i koot in eht trip.\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\nOne day, early in the morning, y...
[{"type": "stdin_stdout", "input": "4\n1\n1337\n3\n31 7 1\n5\n0 2 2 6 10\n3\n9 143 1515\n", "output": "446\n11\n4\n506\n"}, {"type": "stdin_stdout", "input": "4\n1\n1337\n3\n10 2 1\n5\n2 2 3 4 5\n3\n10 115 1546\n", "output": "446\n5\n3\n516\n"}, {"type": "stdin_stdout", "input": "4\n1\n1337\n3\n31 7 1\n5\n0 2 2 6 10\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\nYou are given an array $a$ of le...
[{"type": "stdin_stdout", "input": "16\n998244362 998244362 1545401713 998244362 998244362 998244362 998244362 998244362 1483557929 998244362 998244362 356870606 998244362 998244362 998244362 998244362 998244363 998244363 998244363 998244363 998244363 998244363 998244363 998244363 998244363 998244363 998244363 99824436...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nVasiliy lives at point (a, b) of...
[{"type": "stdin_stdout", "input": "66 -82\n43\n27 -21 70\n-64 46 58\n-7 -20 41\n-42 60 57\n-93 -7 95\n26 -61 26\n-10 -72 25\n-78 -18 55\n-62 -64 69\n-33 95 50\n24 59 45\n4 72 37\n66 57 61\n16 -60 5\n17 -78 36\n-75 56 59\n-60 98 77\n-94 37 28\n76 6 63\n99 -35 75\n69 -40 1\n9 -48 56\n-94 -11 19\n69 1 63\n43 42 80\n-28 -...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nIs there anything better than go...
[{"type": "stdin_stdout", "input": "wwwbbwbbbwbwbwwbwwbbbwbwbwwbbbwbwwwbwwbwbbbbwwbwwwwwbwwwwwwwwbbwwwwbbbbbwbwbbwwbbbbbwbwbbwbwwwbbwwbbbwwwbbwwbwwbbbbwwbwbbwbwwbbwbwbwbbwwbwwwbwbwbbbwwwwwwbwwbbbwwbwwbwbwwwbbwwwwwwwwwbwwbwbbbwbwwwwbwwbbwbbwbwwbwwbwwbbwbbwwwwbwwwbwwwbwbwwwbbwwbbwwbwbwwwwwwbwbwwwwbbwwwbwbwwwbbwwwwwbwwbwb...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nYou're creating a game level for...
[{"type": "stdin_stdout", "input": "16\n2 2 1\n10\n11 1\n2 1 2\n01\n5 6\n2 2 2\n11\n9 11\n2 2 2\n00\n8 3\n2 2 2\n10\n9 10\n2 1 2\n11\n7 2\n2 2 1\n01\n3 1\n2 1 2\n00\n5 4\n2 2 2\n01\n2 7\n2 1 1\n11\n6 3\n2 1 2\n10\n7 1\n2 1 1\n01\n9 10\n2 2 1\n00\n11 3\n2 1 1\n00\n4 10\n2 2 1\n11\n7 8\n2 1 1\n10\n10 4\n", "output": "11\...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nYour task is to return the sum o...
[{"input": "943", "output": "[140205240]", "fn_name": "sum_triangular_numbers"}, {"input": "34", "output": "[7140]", "fn_name": "sum_triangular_numbers"}, {"input": "-291", "output": "[0]", "fn_name": "sum_triangular_numbers"}, {"input": "-971", "output": "[0]", "fn_name": "sum_triangular_numbers"}, {"input": "6", "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\nAlice and Bob are controlling a ...
[{"type": "stdin_stdout", "input": "56 100 33 100\n", "output": "44\n"}, {"type": "stdin_stdout", "input": "0 100 0 100\n", "output": "100\n"}, {"type": "stdin_stdout", "input": "0 75 25 100\n", "output": "50\n"}, {"type": "stdin_stdout", "input": "10 90 20 80\n", "output": "60\n"}, {"type": "stdin_stdout", "input": "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\nThere's a new security company i...
[{"input": "\"Bernard-Henry-Levy\"", "output": "[true]", "fn_name": "show_me"}, {"input": "\"Jean-Luc-Picard-\"", "output": "[false]", "fn_name": "show_me"}, {"input": "\"A-a-a-a----a-a\"", "output": "[false]", "fn_name": "show_me"}, {"input": "\"Z-------------\"", "output": "[false]", "fn_name": "show_me"}, {"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\nYou a captain of a ship. Initial...
[{"type": "stdin_stdout", "input": "0 0\n1000000000 1000000000\n2\nDR\n", "output": "2000000000\n"}, {"type": "stdin_stdout", "input": "0 0\n1000000000 1000000000\n2\nDR\n", "output": "2000000000\n"}, {"type": "stdin_stdout", "input": "0 0\n1000000010 1000000000\n2\nDR\n", "output": "2000000010\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\nGennady is one of the best child...
[{"type": "stdin_stdout", "input": "10\n9 8 8\n2 9 33\n10 7 42\n7 2 18\n3 5 82\n9 9 25\n3 2 86\n1 5 49\n5 3 72\n4 4 71\n", "output": "10\n1 2 3 4 5 6 7 8 9 10 "}, {"type": "stdin_stdout", "input": "10\n9 8 8\n2 9 33\n10 7 42\n7 2 18\n3 4 82\n9 9 25\n3 2 86\n1 5 49\n5 3 72\n4 4 71\n", "output": "10\n1 2 3 4 5 6 7 8 9 10...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nLuke Skywalker gave Chewbacca an...
[{"type": "stdin_stdout", "input": "1000000000000000000\n", "output": "1000000000000000000\n"}, {"type": "stdin_stdout", "input": "1000000000000000000\n", "output": "1000000000000000000\n"}, {"type": "stdin_stdout", "input": "1000001000000000000\n", "output": "1000001000000000000\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\nThe cities of Byteland and Berla...
[{"type": "stdin_stdout", "input": "15\n-9518 R\n-6858 P\n-6726 B\n-6486 R\n-4496 P\n-4191 P\n-772 B\n-258 R\n-194 P\n1035 R\n2297 P\n4816 B\n5779 R\n9342 B\n9713 B\n", "output": "25088\n"}, {"type": "stdin_stdout", "input": "15\n-9518 R\n-6858 P\n-6726 B\n-6486 R\n-4496 P\n-4191 P\n-772 B\n-258 R\n-194 P\n1035 R\n2297...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nMy friend wants a new band name ...
[{"input": "\"sandles\"", "output": "[\"Sandlesandles\"]", "fn_name": "band_name_generator"}, {"input": "\"knife\"", "output": "[\"The Knife\"]", "fn_name": "band_name_generator"}, {"input": "\"tart\"", "output": "[\"Tartart\"]", "fn_name": "band_name_generator"}, {"input": "\"bed\"", "output": "[\"The Bed\"]", "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\nPetya loves lucky numbers. Every...
[{"type": "stdin_stdout", "input": "1000\n", "output": "YES\n"}, {"type": "stdin_stdout", "input": "477\n", "output": "YES\n"}, {"type": "stdin_stdout", "input": "124\n", "output": "YES\n"}, {"type": "stdin_stdout", "input": "480\n", "output": "YES\n"}, {"type": "stdin_stdout", "input": "141\n", "output": "YES\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\nLet's introduce the designation ...
[{"type": "stdin_stdout", "input": "10000000 10000000\naaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\naaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\n", "output": "1\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\nYour task is to create a new imp...
[{"input": "31\n902938423012\n1023", "output": "[961]", "fn_name": "power_mod"}, {"input": "29\n1013293125\n492", "output": "[161]", "fn_name": "power_mod"}, {"input": "13\n81230123\n22", "output": "[19]", "fn_name": "power_mod"}, {"input": "5\n100000000\n19", "output": "[5]", "fn_name": "power_mod"}, {"input": "11\n10...
code_functional