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\nA popular game in a certain coun...
[{"type": "stdin_stdout", "input": "6 6\nS.1..4\n5..3..\n..4.1.\n4....5\n.2.32.\n5.1..G\n3 2\n...\nS.G\n0 0", "output": "3 12\nNA\n"}, {"type": "stdin_stdout", "input": "6 6\nS.1..4\n3..5..\n..4.1.\n4...5.\n.2.32.\n5.1..G\n3 2\n...\nS.G\n0 0", "output": "2 10\nNA\n"}, {"type": "stdin_stdout", "input": "6 6\nS.1..4\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\nIgor is a post-graduate student ...
[{"type": "stdin_stdout", "input": "11\n1 1 1 1 1 1 1 1 1 1 1\n1 1000000001 1000000001 1000000001 1000000001 1000000001 1000000001 1000000001 1000000001 1000000001 1000000001\n1 1000000000\n1 1000000000\n1 1000000000\n1 1000000000\n1 1000000000\n1 1000000000\n1 1000000000\n1 1000000000\n1 1000000000\n1 1000000000\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\nHongcow is ruler of the world. A...
[{"type": "stdin_stdout", "input": "24 38 2\n4 13\n7 1\n24 1\n2 8\n17 2\n2 18\n22 2\n23 3\n5 9\n21 5\n6 7\n6 19\n6 20\n11 7\n7 20\n13 8\n16 8\n9 10\n14 9\n21 9\n12 10\n10 22\n23 10\n17 11\n11 24\n20 12\n13 16\n13 23\n15 14\n17 14\n14 20\n19 16\n17 20\n17 23\n18 22\n18 23\n22 19\n21 20\n23 24\n", "output": "215\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 already know that Valery's f...
[{"type": "stdin_stdout", "input": "20 20 2\nbaaaaaaaaaaaaaaaaaaa\nbfffffffacfffffffffa\nbgggggggaccgggggggga\nbhhhhhhhaccchhhhhhha\nbiiiiiiiacccciiiiiia\nbjjjjjjjacccccjjjjja\nbkkkkkkkacccccckkkka\nblllllllacccccccllla\nbbbbbbbbSccccccccmma\nbddddddddddcccccccna\nbodddddddcccccccccca\nbppddddddddTaaaaaaaa\nbqqqddddddd...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 taking exams on N s...
[{"type": "stdin_stdout", "input": "100 100 100\n100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nProblem\n\nIf you bring an empty...
[{"type": "stdin_stdout", "input": "560118409912468 316250877917599 1316995007040099", "output": "500636509\n"}, {"type": "stdin_stdout", "input": "316250877917604 316250877917599 672514164456590", "output": "265329493\n"}, {"type": "stdin_stdout", "input": "560118409912468 316250877917599 681260158257385", "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\nRick and Morty are playing their...
[{"type": "stdin_stdout", "input": "7000\n7 419 1631 1925 3861 6940 379 493\n29 5389 5925 2923 4696 972 6125 3779 6044 5477 1305 6488 5059 5515 3238 3863 248 6947 4023 6168 1915 6607 2991 2220 2023 200 4457 6398 1017 447\n", "output": "Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 Little Elephant loves playin...
[{"type": "stdin_stdout", "input": "6 6\n2 1 2 3 3 10\n1 2\n2 2\n1 3\n2 4\n3 6\n2 2\n", "output": "1\n1\n2\n1\n0\n1\n"}, {"type": "stdin_stdout", "input": "6 6\n1 2 2 3 3 3\n1 2\n2 2\n1 3\n2 4\n4 6\n1 6\n", "output": "1\n0\n2\n1\n1\n3\n"}, {"type": "stdin_stdout", "input": "6 6\n1 2 2 3 3 3\n1 2\n2 2\n1 3\n4 4\n4 6\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\nYour job is to write function la...
[{"input": "34625647867585\n10", "output": "[[5, 6, 4, 7, 8, 6, 7, 5, 8, 5]]", "fn_name": "solution"}, {"input": "123767\n4", "output": "[[3, 7, 6, 7]]", "fn_name": "solution"}, {"input": "1343\n5", "output": "[[1, 3, 4, 3]]", "fn_name": "solution"}, {"input": "24134\n-4", "output": "[[]]", "fn_name": "solution"}, {"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\nArtist Shinagawa was asked to ex...
[{"type": "stdin_stdout", "input": "3\nCyan Yellow Red Magenta Green Blue\nCyan Yellow Red Magenta Green Blue\nRed Yellow Magenta Blue Green Cyan\n4\nRed Mahenta Blue Green Yellow Cyan\nRed Yellow Magenta Blue Green Cyan\nMagenta Green Red Cyan Yellow Blue\nCyan Green Yellow Blue Magenta Red\n0", "output": "1\n1\n"}, {...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nKalila and Dimna are two jackals...
[{"type": "stdin_stdout", "input": "6\n1 2 3 10 20 30\n6 5 4 3 2 0\n", "output": "138\n"}, {"type": "stdin_stdout", "input": "6\n2 2 3 10 20 30\n6 5 4 3 2 0\n", "output": "138\n"}, {"type": "stdin_stdout", "input": "6\n1 2 3 10 20 25\n6 5 4 3 2 0\n", "output": "118\n"}, {"type": "stdin_stdout", "input": "6\n1 1 2 10 20...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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#Unflatten a list (Easy)\n\nTher...
[{"input": "[1, 4, 5, 2, 1, 2, 4, 5, 2, 6, 2, 3, 3]", "output": "[[1, [4, 5, 2, 1], 2, [4, 5, 2, 6], 2, [3, 3]]]", "fn_name": "unflatten"}, {"input": "[3, 1, 1, 3, 1, 1]", "output": "[[[3, 1, 1], [3, 1, 1]]]", "fn_name": "unflatten"}, {"input": "[99, 1, 1, 1]", "output": "[[[99, 1, 1, 1]]]", "fn_name": "unflatten"}, {"...
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 equation: \n\nA...
[{"type": "stdin_stdout", "input": "-50000 110001 -1028\n", "output": "2\n0.009385408263686695\n2.1906345917363135\n"}, {"type": "stdin_stdout", "input": "50000 110001 10338\n", "output": "2\n-2.1016396721343673\n-0.09838032786563272\n"}, {"type": "stdin_stdout", "input": "-50000 100001 -50000\n", "output": "2\n0.99553...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 class/function, whic...
[{"input": "\"99:59:59\"", "output": "[359999]", "fn_name": "to_seconds"}, {"input": "\"00:00:00\\n\"", "output": "[null]", "fn_name": "to_seconds"}, {"input": "\"\\n00:00:00\"", "output": "[null]", "fn_name": "to_seconds"}, {"input": "\"100:59:59\"", "output": "[null]", "fn_name": "to_seconds"}, {"input": "\"09:059:59...
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\nPeople in Silverland use square ...
[{"type": "stdin_stdout", "input": "2\n19\n51\n0", "output": "1\n10\n107\n"}, {"type": "stdin_stdout", "input": "2\n19\n92\n0", "output": "1\n10\n804\n"}, {"type": "stdin_stdout", "input": "2\n173\n0\n-6", "output": "1\n13027\n"}, {"type": "stdin_stdout", "input": "2\n10\n51\n0", "output": "1\n4\n107\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\nGame \"Minesweeper 1D\" is playe...
[{"type": "stdin_stdout", "input": "?2*?2*??1*2**?2*1???*2???100?????*???*?*????0????2?*?*?1??1??*?01**2**1001??**??**??1*?*???00??**??*\n", "output": "147483634\n"}, {"type": "stdin_stdout", "input": "?2*?2*??1*2**?2*1???*2???100?????*???*?*????0????2?*?*?1??1??*?01**2**1001??**??**??1*?*???00??**??*\n", "output": "14...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nTrouble came from the overseas l...
[{"type": "stdin_stdout", "input": "-1000000000 1000000000\n-1000000000 -1000000000\n1000000000 -1000000000\n", "output": "LEFT\n"}, {"type": "stdin_stdout", "input": "-1000000000 1000001000\n-1000000000 -1000000000\n1000000000 -1000000000\n", "output": "LEFT\n"}, {"type": "stdin_stdout", "input": "-1000000000 10000000...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 is working on a new pro...
[{"type": "stdin_stdout", "input": "+qlHEc2AuYy\nqlHE02AuYy:YYRwDc edNZgpE nGfOguRWnMYpTpGUVM aXDKGWo1GL1tHv9\n0Upwze6PcQNBcUovrqmIcPsG3hvy:yYuA2cEHlq oaNiKV49p[KatlVAx\nqlHEc2AuYy:zuCO6Opey L eu7lTwysaSk00zjpv zrDfbt8l ufHph\n+pErDMxgVgh\nsiLF1I:yYu@1cEHlq mmQbZtd8Ui7y 2vcax6yZBMhVdRD6Ahlq7MNCw\nqlHEc2AuYy:lz MFUNJ...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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#It's show time!\nArchers have g...
[{"input": "[1, 2, 3, 4, 5, 6, 7, 8]", "output": "[false]", "fn_name": "archers_ready"}, {"input": "[1, 2, 3, 4]", "output": "[false]", "fn_name": "archers_ready"}, {"input": "[5, 6, 7, 4]", "output": "[false]", "fn_name": "archers_ready"}, {"input": "[5, 6, 7, 8]", "output": "[true]", "fn_name": "archers_ready"}, {"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\nFollowing from the previous kata...
[{"input": "21\n30", "output": "[448]", "fn_name": "psion_power_points"}, {"input": "1\n10", "output": "[0]", "fn_name": "psion_power_points"}, {"input": "1\n11", "output": "[2]", "fn_name": "psion_power_points"}, {"input": "0\n11", "output": "[0]", "fn_name": "psion_power_points"}, {"input": "1\n20", "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\nPolycarpus analyzes a string cal...
[{"type": "stdin_stdout", "input": "156642200 503020953 296806626 871864091\n", "output": "234585497\n"}, {"type": "stdin_stdout", "input": "462616550 929253987 199885647 365920450\n", "output": "166034804\n"}, {"type": "stdin_stdout", "input": "166724572 472113234 358126054 528083792\n", "output": "125430608\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\nFor the multiset of positive int...
[{"type": "stdin_stdout", "input": "10\n972 972 324 972 324 648 1944 243 324 474\n", "output": "162\n"}, {"type": "stdin_stdout", "input": "10\n972 972 324 972 324 648 1944 243 324 474\n", "output": "162\n"}, {"type": "stdin_stdout", "input": "10\n540 648 1116 648 720 540 594 864 972 648\n", "output": "36\n"}, {"type":...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nA sequence of positive integers ...
[{"type": "stdin_stdout", "input": "1\n11 100000\n310065408 310065408 310065408 310065408 89000 89000 89000 89000 10000000 5 69\n", "output": "11\n"}, {"type": "stdin_stdout", "input": "4\n4 4\n1 16 4 4\n6 2\n1 2 2 2 4 7\n5 3\n5 2 3 5 15\n9 10\n10 10 10 20 1 100 200 2000 3\n", "output": "0\n2\n3\n3\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\nYou are given two integers $n$ a...
[{"type": "stdin_stdout", "input": "25\n3 1000000000\n3 1000000000\n3 1000000000\n3 1000000000\n3 1000000000\n3 1000000000\n3 1000000000\n3 1000000000\n3 1000000000\n3 1000000000\n3 1000000000\n3 1000000000\n3 1000000000\n3 1000000000\n3 1000000000\n3 1000000000\n3 1000000000\n3 1000000000\n3 1000000000\n3 1000000000\n...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nA substring of some string is ca...
[{"type": "stdin_stdout", "input": "76\namnctposz\nmnctpos\nos\nu\ne\nam\namnc\neamnctpo\nl\nx\nq\nposzq\neamnc\nctposzq\nctpos\nmnc\ntpos\namnctposzql\ntposzq\nmnctposz\nnctpos\nctposzql\namnctpos\nmnct\np\nux\nposzql\ntpo\nmnctposzql\nmnctp\neamnctpos\namnct\ntposzql\nposz\nz\nct\namnctpo\noszq\neamnct\ntposz\ns\nmn\...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nVova had a pretty weird sleeping...
[{"type": "stdin_stdout", "input": "65 654 560 571\n83 511 615 263 171 146 241 511 582 216 352 632 506 538 536 217 627 213 324 579 172 241 363 584 450 144 447 536 241 523 162 21 437 291 191 111 567 502 170 570 231 493 169 360 107 114 322 160 574 611 460 558 616 361 284 58 41 345 450 560 543 520 105 416 38\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 dive into one of the most ...
[{"type": "stdin_stdout", "input": "# a \n # a \n\n # a \n\n\n # a \n \n # a \n \n\n # a \n\n \n # a\n \n \n # a \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\nComplete the solution so that it...
[{"input": "{\"b\": 1, \"c\": 2, \"e\": 3}", "output": "[\"b = 1,c = 2,e = 3\"]", "fn_name": "solution"}, {"input": "{\"a\": \"b\", \"b\": \"a\"}", "output": "[\"a = b,b = a\"]", "fn_name": "solution"}, {"input": "{\"0\": \"a\", \"b\": 2}", "output": "[\"0 = a,b = 2\"]", "fn_name": "solution"}, {"input": "{\"a\": 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\nFor every string, after every oc...
[{"input": "\"A fast-food resteraunt down the street was grumbling my tummy but I could not go.\"", "output": "[\"A fast-food resteraunt down the street was grumbling my tummy but apparently I could not go.\"]", "fn_name": "apparently"}, {"input": "\"but the bread and butter apparently brand apparently\"", "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\nCurry making\n\nAs the ACM-ICPC ...
[{"type": "stdin_stdout", "input": "10 5 3 4\n1 6 2 3\n150 13 7 62\n10 1 3 5\n20 100 3 20\n2 14 13 1\n0 0 0 0", "output": "2\n4\n0\n0\n14\n180\n"}, {"type": "stdin_stdout", "input": "10 5 3 4\n1 5 2 3\n150 13 12 62\n10 1 11 5\n20 100 3 20\n3 14 3 1\n0 0 0 0", "output": "2\n3\n1\n1\n14\n39\n"}, {"type": "stdin_stdout", ...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nA remote island chain contains n...
[{"type": "stdin_stdout", "input": "10\n2 4 8 3 6 1 15 0 5 14\n3 6 1 10 0 5 7 2 14 4\n", "output": "NO\n"}, {"type": "stdin_stdout", "input": "10\n2 4 8 3 6 1 15 0 5 7\n3 6 1 10 0 5 7 2 14 4\n", "output": "NO\n"}, {"type": "stdin_stdout", "input": "10\n2 4 8 3 6 1 15 0 5 7\n3 6 1 10 0 5 7 2 22 4\n", "output": "NO\n"}, ...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nYou are given set of n points in...
[{"type": "stdin_stdout", "input": "11\n358 -724 -232 53 -520\n486 -554 -328 53 -220\n358 -554 -232 -372 -520\n358 -554 -232 308 -520\n868 -554 448 53 -520\n478 -554 -322 53 -600\n358 296 -232 53 -520\n256 -554 -368 53 -520\n230 -554 -136 53 -820\n-182 -554 173 53 -160\n358 -554 -232 53 -520\n", "output": "1\n11\n"}, {...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\n# Task\n Dudka has `n` details. ...
[{"input": "10", "output": "[2]", "fn_name": "three_details"}, {"input": "15", "output": "[1]", "fn_name": "three_details"}, {"input": "3", "output": "[1]", "fn_name": "three_details"}, {"input": "6", "output": "[2]", "fn_name": "three_details"}, {"input": "4", "output": "[0]", "fn_name": "three_details"}]
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\nNick is interested in prime numb...
[{"type": "stdin_stdout", "input": "1000 1000\n", "output": "NO\n"}, {"type": "stdin_stdout", "input": "1000 1100\n", "output": "NO\n"}, {"type": "stdin_stdout", "input": "1000 44\n", "output": "YES\n"}, {"type": "stdin_stdout", "input": "428 23\n", "output": "YES\n"}, {"type": "stdin_stdout", "input": "332 20\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\nLet's define the sum of two perm...
[{"type": "stdin_stdout", "input": "84\n83 4 68 34 24 2 48 38 22 51 5 62 31 67 66 53 49 70 9 71 46 41 30 8 50 17 28 79 15 80 32 43 14 74 29 42 81 60 56 65 23 0 77 76 58 78 1 11 37 27 75 35 18 73 54 20 57 33 36 6 61 69 64 55 39 10 3 45 13 26 59 82 21 25 63 52 16 44 47 72 19 12 7 40\n63 41 80 52 36 45 17 69 22 66 37 21 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\nVasya came up with his own weath...
[{"type": "stdin_stdout", "input": "100\n-85 -80 -76 -72 -68 -64 -60 -56 -52 -48 -44 -40 -36 -32 -28 -24 -20 -16 -12 -8 -4 0 4 8 12 16 20 24 28 32 36 40 44 48 52 56 60 64 68 72 76 80 84 88 92 96 100 104 108 112 116 120 124 128 132 136 140 144 148 152 156 160 164 168 172 176 180 184 188 192 196 200 204 208 212 216 220 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\nLittle X and Little Z are good f...
[{"type": "stdin_stdout", "input": "13 42 292 733\n304 308\n362 365\n396 397\n686 688\n719 722\n815 816\n901 902\n904 905\n921 924\n929 933\n953 954\n977 980\n982 985\n28 30\n36 37\n108 112\n123 127\n134 135\n151 153\n160 162\n203 205\n208 212\n240 243\n261 264\n271 274\n294 297\n356 358\n383 385\n408 412\n415 418\n435...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 three strings $s$,...
[{"type": "stdin_stdout", "input": "1\naaaaaabbbbbbbbcccccccccccdddd\naaaaabbbbbbccccccccddddddddd\naaaaabbbbbbbbbcccccccccddddd\n", "output": "NO\n"}, {"type": "stdin_stdout", "input": "1\naaaaaabbbbbbbbcccccccccccdddd\naaaaabbbbbbccccccccddddddddd\naaaaabbbbbbbbbcccccccccddddd\n", "output": "No\n"}, {"type": "stdin_s...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nAlice got a new doll these days....
[{"type": "stdin_stdout", "input": "10 10 70\n10 4\n5 5\n6 10\n8 9\n3 8\n10 9\n10 10\n8 2\n2 10\n7 2\n7 3\n10 2\n8 3\n9 8\n2 9\n3 1\n6 5\n6 9\n2 8\n10 7\n8 4\n8 6\n7 6\n5 6\n9 10\n3 9\n5 8\n4 8\n3 10\n10 5\n5 2\n5 4\n8 8\n3 2\n3 6\n2 3\n1 9\n6 6\n2 4\n6 2\n5 3\n6 4\n7 9\n2 2\n5 9\n7 10\n7 8\n3 3\n2 6\n7 5\n8 10\n3 4\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\nVova plans to go to the conferen...
[{"type": "stdin_stdout", "input": "10\n10 1 1 1\n10 1 1 2\n10 1 1 3\n10 1 1 4\n10 1 1 5\n10 1 1 6\n10 1 1 7\n10 1 1 8\n10 1 1 9\n10 1 1 10\n", "output": "9\n8\n7\n6\n5\n4\n3\n2\n1\n0\n"}, {"type": "stdin_stdout", "input": "10\n10 2 1 1\n10 2 1 2\n10 2 1 3\n10 2 1 4\n10 2 1 5\n10 2 1 6\n10 2 1 7\n10 2 1 8\n10 2 1 9\n10...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nIahub got lost in a very big des...
[{"type": "stdin_stdout", "input": "999999989 38\n999999980 999999981\n10 8\n2 5\n999999978 999999981\n999999978 999999985\n7 9\n8 10\n9 10\n999999984 999999980\n6 6\n999999985 999999986\n999999982 999999978\n999999981 999999987\n8 5\n999999982 999999980\n999999989 999999980\n999999988 999999983\n999999982 999999984\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\nWrite a program to determine if ...
[{"input": "12\n39", "output": "[false]", "fn_name": "are_coprime"}, {"input": "17\n34", "output": "[false]", "fn_name": "are_coprime"}, {"input": "34\n17", "output": "[false]", "fn_name": "are_coprime"}, {"input": "35\n10", "output": "[false]", "fn_name": "are_coprime"}, {"input": "20\n27", "output": "[true]", "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\n**This Kata is intended as a sma...
[{"input": "[\"super\", \"guacamole\", \"super\", \"super\", \"hot\", \"guacamole\"]", "output": "[[\"super guacamole hot\", \"super hot guacamole\", \"guacamole super hot\", \"guacamole hot super\", \"hot super guacamole\", \"hot guacamole super\"]]", "fn_name": "slogan_maker"}, {"input": "[\"super\", \"hot\", \"guaca...
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\nThree poles stand evenly spaced ...
[{"type": "stdin_stdout", "input": "-1 -1 -1", "output": "YES\n"}, {"type": "stdin_stdout", "input": "-2 -3 -4", "output": "YES\n"}, {"type": "stdin_stdout", "input": "-1 -2 -1", "output": "NO\n"}, {"type": "stdin_stdout", "input": "-1 -3 -1", "output": "NO\n"}, {"type": "stdin_stdout", "input": "-2 -4 -1", "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\n# Task\n Let's call `product(x)`...
[{"input": "[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20]", "output": "[10]", "fn_name": "unique_digit_products"}, {"input": "[100, 23, 42, 239, 22339, 9999999, 456, 78, 228, 1488]", "output": "[10]", "fn_name": "unique_digit_products"}, {"input": "[2, 8, 121, 42, 222, 23]", "output": "[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\nGiven a lowercase string that ha...
[{"input": "\"mischtschenkoana\"", "output": "[80]", "fn_name": "solve"}, {"input": "\"twelfthstreet\"", "output": "[103]", "fn_name": "solve"}, {"input": "\"chruschtschov\"", "output": "[80]", "fn_name": "solve"}, {"input": "\"catchphrase\"", "output": "[73]", "fn_name": "solve"}, {"input": "\"khrushchev\"", "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\nYou are given two integers $x$ a...
[{"type": "stdin_stdout", "input": "3\n1 3\n391 555\n129 8437\n9 4\n321 654\n3 4\n", "output": "1337\n75288\n2283\n"}, {"type": "stdin_stdout", "input": "3\n1 3\n391 555\n129 8437\n9 4\n321 654\n3 4\n", "output": "1337\n75288\n2283\n"}, {"type": "stdin_stdout", "input": "3\n1 6\n391 555\n129 8437\n9 4\n321 654\n3 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\nVasya came up with a password to...
[{"type": "stdin_stdout", "input": "6\n11b\n4bh\nBeh\nTuY\n1YJ\nP28\n", "output": "A1b\n4Ah\nB1h\n1uY\n1aJ\nPa8\n"}, {"type": "stdin_stdout", "input": "6\n11b\n4bh\nBeh\nTvY\n1YJ\nP28\n", "output": "A1b\n4Ah\nB1h\n1vY\n1aJ\nPa8\n"}, {"type": "stdin_stdout", "input": "6\n11b\n4bh\nBeh\nvTY\n1YJ\nP28\n", "output": "A1b\n...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nWe start with a string $s$ consi...
[{"type": "stdin_stdout", "input": "9\n1500\n1212\n1500\n1221\n1500\n122\n1500\n12121\n1500\n22\n1500\n1111112111111112\n1500\n1111111111221111111\n1500\n111111122\n1500\n11111121111121111111\n", "output": "1504\n1599\n1502\n1598\n1502\n1510\n1657\n1502\n1763\n"}, {"type": "stdin_stdout", "input": "9\n1500\n1212\n1500\...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 regex to validate a 24 h...
[{"input": "\"foo12:00bar\"", "output": "[false]", "fn_name": "validate_time"}, {"input": "\"12: 60\"", "output": "[false]", "fn_name": "validate_time"}, {"input": "\"24o:00\"", "output": "[false]", "fn_name": "validate_time"}, {"input": "\"24:000\"", "output": "[false]", "fn_name": "validate_time"}, {"input": "\"010:0...
code_functional
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nYou are given 2 numbers is `n` a...
[{"input": "10000000000000000000000\n21", "output": "[2407217760893271902598]", "fn_name": "almost_everywhere_zero"}, {"input": "10000000000000000000000\n3", "output": "[1122660]", "fn_name": "almost_everywhere_zero"}, {"input": "500309160\n2", "output": "[2604]", "fn_name": "almost_everywhere_zero"}, {"input": "100010...
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 write all the positive int...
[{"type": "stdin_stdout", "input": "1000000000000\n", "output": "1\n"}, {"type": "stdin_stdout", "input": "1000000000000\n", "output": "1\n"}, {"type": "stdin_stdout", "input": "1000000000000\n", "output": "1\n"}, {"type": "stdin_stdout", "input": "100000000000\n", "output": "0\n"}, {"type": "stdin_stdout", "input": "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\nSo you've found a meeting room -...
[{"input": "[[\"XXX\", 1], [\"XXXXXX\", 6], [\"X\", 2], [\"XXXXXX\", 8], [\"X\", 3], [\"XXX\", 1]]\n5", "output": "[[0, 0, 1, 2, 2]]", "fn_name": "meeting"}, {"input": "[[\"XX\", 2], [\"XXXX\", 6], [\"XXXXX\", 4]]\n8", "output": "[\"Not enough!\"]", "fn_name": "meeting"}, {"input": "[[\"XXX\", 3], [\"XXXXX\", 6], [\"XX...
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\nHarry Potter is on a mission to ...
[{"type": "stdin_stdout", "input": "9\nliyzmbjwnzryjokufuxcqtzwworjeoxkbaqrujrhdidqdvwdfzilwszgnzglnnbogaclckfnbqovtziuhwvyrqwmskx\nliyzmbjwnzryjokufuxcqtzwworjeoxkbaqrujrhdidqdvwdfzilwszgnzglnnbogaclckfnbqovtziuhwvyrqwmskx\nliyzmbjwnzryjokufuxcqtzwworjeoxkbaqrujrhdidqdvwdfzilwszgnzglnnbogaclckfnbqovtziuhwvyrqwmskx\nhr...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nStep up and down\n\nKazuki, comm...
[{"type": "stdin_stdout", "input": "4\nlu ru ld rd\n4\nlu ld lu ru\n1\nlu\n10\nru lu ld rd ru rd ru lu rd ld\n0", "output": "2\n1\n0\n4"}, {"type": "stdin_stdout", "input": "4\nlu ru ld rd\n4\nlu ld lu ru\n0\nlu\n10\nur lu ld rd ru rd ru lu rd ld\n-1", "output": "2\n1\n"}, {"type": "stdin_stdout", "input": "4\nlu ru ld...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nProfessor Tsukuba invented a mys...
[{"type": "stdin_stdout", "input": "19\n 1 +x 1 +y +z 3 +z\n 3 +y -z +x +y -z -x +z 2 +z\n 2 +y\n19\n 1 +x 1 +x +z 3 +y -z +x +y -z -x +z 2 +y\n 3 +z\n 2 +z\n19\n 1 +x 1 +y +z 3 +z\n 3 +y -z +x +y -z -x +z 2 +y\n 2 +z\n18\n 1 -y\n 1 +y -z +x\n 1 +z +y +x +z +y -x -y 1 -y\n 2 +z\n3 +x +y +z\n3 +y +z -x\n0",...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nA star is a figure of the follow...
[{"type": "stdin_stdout", "input": "100 3\n.*.\n***\n***\n***\n***\n***\n***\n***\n***\n***\n***\n***\n***\n***\n***\n***\n***\n***\n***\n***\n***\n***\n***\n***\n***\n***\n***\n***\n***\n***\n***\n***\n***\n***\n***\n***\n***\n***\n***\n***\n***\n***\n***\n***\n***\n***\n***\n***\n***\n***\n***\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\nYou are given a permutation of l...
[{"type": "stdin_stdout", "input": "4\n5\n5 4 1 3 2\n4\n1 2 4 3\n1\n1\n4\n4 3 2 1\n", "output": "1 5 2 4 3 \n1 2 3 4 \n1 \n1 4 3 2 \n"}, {"type": "stdin_stdout", "input": "4\n5\n5 4 1 3 2\n4\n1 2 4 3\n1\n1\n4\n4 3 2 1\n", "output": "1 5 2 4 3 \n1 2 3 4 \n1 \n1 4 3 2 \n"}, {"type": "stdin_stdout", "input": "4\n5\n5 4 1 ...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nThere are N men and N women, bot...
[{"type": "stdin_stdout", "input": "21\n0 0 0 0 0 0 0 1 1 0 1 1 1 1 0 0 0 1 0 0 1\n1 1 1 0 1 1 0 0 0 1 0 0 0 0 1 1 1 0 1 1 0\n0 0 1 1 1 1 0 1 1 0 0 1 0 0 1 1 0 0 0 1 1\n0 1 1 0 1 1 0 1 0 1 0 0 1 0 0 0 0 0 1 1 0\n1 1 0 0 1 0 1 0 0 1 1 1 1 0 0 0 0 0 0 0 0\n0 1 1 0 1 1 1 0 1 1 1 0 0 0 1 1 1 1 0 0 1\n0 1 0 0 0 1 0 1 0 0 0 ...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nTakahashi is a member of a progr...
[{"type": "stdin_stdout", "input": "100 4111\n", "output": "4111\n"}, {"type": "stdin_stdout", "input": "22 3051\n", "output": "3051\n"}, {"type": "stdin_stdout", "input": "10 3141\n", "output": "3141\n"}, {"type": "stdin_stdout", "input": "11 3141\n", "output": "3141\n"}, {"type": "stdin_stdout", "input": "2 2919\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\nProblem\n\nGPA is an abbreviatio...
[{"type": "stdin_stdout", "input": "3\n1.2162360718264462\n2.9346880694304285\n3.9759367558439593", "output": "0\n3\n6\n"}, {"type": "stdin_stdout", "input": "3\n1.3676423535538285\n2.5451927881659007\n3.4551403734048662", "output": "0\n3\n6\n"}, {"type": "stdin_stdout", "input": "3\n2.2132650658019095\n2.5451927881659...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 an integer sequence A of...
[{"type": "stdin_stdout", "input": "199903 -42042635 15996643\n", "output": "1331394274247808\n"}, {"type": "stdin_stdout", "input": "199937 46898475 97994148\n", "output": "1332073730358274\n"}, {"type": "stdin_stdout", "input": "199903 2748118 -84690464\n", "output": "1331394274247808\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\nThe only difference between the ...
[{"type": "stdin_stdout", "input": "3\n3\n110\n2\n00\n4\n1010\n", "output": "\nALICE\nBOB\nALICE\n"}, {"type": "stdin_stdout", "input": "3\n3\n110\n2\n00\n4\n1010\n", "output": "ALICE\nBOB\nALICE\n"}, {"type": "stdin_stdout", "input": "3\n3\n110\n2\n00\n4\n1011\n", "output": "ALICE\nBOB\nALICE\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\n> If you've finished this kata, ...
[{"input": "\"RLRLRLRRLRLL\"", "output": "[[290, 179]]", "fn_name": "promenade"}, {"input": "\"LRRLLRLLRLRR\"", "output": "[[161, 229]]", "fn_name": "promenade"}, {"input": "\"LRRLRLLLLRLL\"", "output": "[[107, 149]]", "fn_name": "promenade"}, {"input": "\"LLRLRLLRLLRL\"", "output": "[[112, 295]]", "fn_name": "promenad...
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 this exercise, you will have ...
[{"input": "\"Hello WORLD!\"", "output": "[\"IronYardllYard IronIron YardIronIronIron!\"]", "fn_name": "tiy_fizz_buzz"}, {"input": "\"H6H4Na ./?U\"", "output": "[\"Iron6Iron4IronYard ./?Iron Yard\"]", "fn_name": "tiy_fizz_buzz"}, {"input": "\"A\"", "output": "[\"Iron Yard\"]", "fn_name": "tiy_fizz_buzz"}, {"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 are given a string $s=s_1s_2...
[{"type": "stdin_stdout", "input": "39\n263254663359864483324578786753512345165\n", "output": "327\n"}, {"type": "stdin_stdout", "input": "39\n263254663359864483324578786753512345165\n", "output": "327"}, {"type": "stdin_stdout", "input": "10\n9572683145\n", "output": "24\n"}, {"type": "stdin_stdout", "input": "10\n957...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 Jessie has a lot of recipes...
[{"type": "stdin_stdout", "input": "4\nflour-with-eggs 100\nchicken-ham -10\nflour-without-eggs 200\nfish-with-pepper 1100\n6\nf\nflour-with\nflour-with-\nc\nfl\nchik\n", "output": "fish-with-pepper\nflour-without-eggs\nflour-with-eggs\nchicken-ham\nflour-without-eggs\nNO\n"}, {"type": "stdin_stdout", "input": "4\nflou...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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# Hey You !\n\nSort these intege...
[{"input": "[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, 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, 7...
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\nAllen has a LOT of money. He has...
[{"type": "stdin_stdout", "input": "1000000000\n", "output": "10000000\n"}, {"type": "stdin_stdout", "input": "1230910855\n", "output": "12309112\n"}, {"type": "stdin_stdout", "input": "1199225057\n", "output": "11992256\n"}, {"type": "stdin_stdout", "input": "1100000000\n", "output": "11000000\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\nPetya studies in a school and he...
[{"type": "stdin_stdout", "input": "10\n10\n10\n", "output": "1000\n"}, {"type": "stdin_stdout", "input": "10\n10\n10\n", "output": "1000\n"}, {"type": "stdin_stdout", "input": "10\n5\n6\n", "output": "300\n"}, {"type": "stdin_stdout", "input": "10\n5\n6\n", "output": "300\n"}, {"type": "stdin_stdout", "input": "9\n14\...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nComplete the solution so that it...
[{"input": "\"ccddeeccddeecc\"\n\"cc\"", "output": "[3]", "fn_name": "solution"}, {"input": "\"abcdefdvbhibjkb\"\n\"b\"", "output": "[4]", "fn_name": "solution"}, {"input": "\"abccded\"\n\"cc\"", "output": "[1]", "fn_name": "solution"}, {"input": "\"abccded\"\n\"d\"", "output": "[2]", "fn_name": "solution"}, {"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\nManao works on a sports TV. He's...
[{"type": "stdin_stdout", "input": "30\n44 17\n44 17\n44 17\n17 44\n44 17\n44 17\n17 44\n17 44\n17 44\n44 17\n44 17\n44 17\n44 17\n44 17\n17 44\n17 44\n17 44\n44 17\n44 17\n17 44\n44 17\n44 17\n44 17\n17 44\n17 44\n44 17\n17 44\n44 17\n44 17\n44 17\n", "output": "418\n"}, {"type": "stdin_stdout", "input": "30\n67 21\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\nCirno has a DAG (Directed Acycli...
[{"type": "stdin_stdout", "input": "5\n3 2\n1 1 1\n1 2\n2 3\n5 5\n1 0 0 0 0\n1 2\n2 3\n3 4\n4 5\n1 5\n10 11\n998244353 0 0 0 998244353 0 0 0 0 0\n1 2\n2 3\n3 4\n4 5\n5 6\n6 7\n7 8\n8 9\n9 10\n1 3\n7 9\n5 6\n1293 1145 9961 9961 1919\n1 2\n2 3\n3 4\n5 4\n1 4\n2 4\n6 9\n10 10 10 10 10 10\n1 2\n1 3\n2 3\n4 3\n6 3\n3 5\n6 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\nAquaMoon has n friends. They sta...
[{"type": "stdin_stdout", "input": "10\n10\n6 2 1 1 1 10 10 2 10 5\n8\n1 3 1 1 4 5 4 4\n9\n9 6 9 9 2 8 7 2 2\n10\n9 4 3 3 5 4 3 10 4 5\n9\n7 5 1 7 5 5 5 5 6\n8\n8 8 4 4 7 6 2 8\n10\n6 8 1 6 8 8 5 6 8 4\n10\n5 5 5 8 3 4 3 3 10 10\n8\n1 1 3 6 6 7 1 2\n8\n4 1 3 5 3 1 3 3\n", "output": "NO\nYES\nYES\nYES\nYES\nYES\nYES\nYE...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nHere you have to do some mathema...
[{"input": "\"fsdfsd235???34.4554s4234df-sdfgf2g3h4j442\"", "output": "[\"-210908\"]", "fn_name": "calculate_string"}, {"input": "\";$%\\u00a7fsdfsd235??df/sdfgf5gh.000kk0000\"", "output": "[\"47\"]", "fn_name": "calculate_string"}, {"input": "\"fsdfsd234.4554s4234df+sf234442\"", "output": "[\"234676\"]", "fn_name": "c...
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\nYou are in charge of ...
[{"type": "stdin_stdout", "input": "2 2 8\n4\n1 1 1 0\n5 3 4 0\n1 4 0 0\n1 3 0 0\n0 0 0", "output": "2\n2\n2\n2\n2\n2\n2\n2\n2\n2\n2\n2\n"}, {"type": "stdin_stdout", "input": "1 2 8\n4\n4 1 1 0\n5 0 5 0\n-1 4 0 0\n1 3 2 0\n0 0 0", "output": "2\n2\n2\n2\n2\n2\n2\n2\n2\n2\n2\n"}, {"type": "stdin_stdout", "input": "4 2 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\nn people are standing on a coord...
[{"type": "stdin_stdout", "input": "26 10\n495492 7 1\n256604 5 2\n511773 3 2\n590712 4 1\n206826 7 2\n817878 4 2\n843915 1 1\n349160 3 1\n351298 4 1\n782251 8 2\n910928 4 1\n662354 4 2\n468621 2 2\n466991 7 2\n787303 6 2\n221623 8 2\n343518 6 1\n141123 7 1\n24725 6 1\n896603 3 2\n918129 8 2\n706071 6 2\n512369 2 2\n60...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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\n2\n1 3\n2 4\n3\n2 7 9\n1 4 8\n3 6 5", "output": "4\n13\n"}, {"type": "stdin_stdout", "input": "2\n2\n1 3\n2 4\n3\n1 7 9\n3 4 8\n2 6 5", "output": "4\n12\n"}, {"type": "stdin_stdout", "input": "2\n2\n1 3\n2 4\n3\n1 7 9\n2 4 8\n6 3 5", "output": "4\n14\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\nThis is the easy version of the ...
[{"type": "stdin_stdout", "input": "10\n74 66 762901908\n543 237 181918820\n455 298 213830486\n54 35 373479158\n85 72 98863599\n85 72 351650459\n106 18 450755091\n344 26 748825922\n65 48 594595004\n189 52 282125334\n", "output": "271485562\n845881147\n625043331\n624104397\n478865056\n346406768\n733766402\n149326158\n29...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 consisting o...
[{"type": "stdin_stdout", "input": "17363411548681837295128261415319567339781353176864449667411811151437528238242154453591258857339631698313648443916861223514163135267434612598561425414167173299132999132912477426521378378857571251998814421613836117444161875651252375139311654156139512913688822685276844411124583145973751...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nAshish has two strings $a$ and $...
[{"type": "stdin_stdout", "input": "4\n3 3\nabc\nbcd\n4 2\nabba\nazza\n2 1\nzz\naa\n6 2\naaabba\nddddcc\n", "output": "\nNo\nYes\nNo\nYes\n"}, {"type": "stdin_stdout", "input": "4\n3 3\nabc\nbcd\n4 2\nabba\nazza\n2 1\nzz\naa\n6 2\naaabba\nddddcc\n", "output": "No\nYes\nNo\nYes\n"}, {"type": "stdin_stdout", "input": "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\nproblem\n\nSoccer is popular in ...
[{"type": "stdin_stdout", "input": "4\n1 1 0 21\n1 4 2 0\n1 -1 12 2\n4 3 1 3\n4 16 6 1\n-1 1 1 12", "output": "1\n4\n2\n2\n"}, {"type": "stdin_stdout", "input": "4\n1 2 0 19\n2 3 2 2\n1 0 22 1\n3 3 3 -1\n3 16 6 0\n0 1 -1 8", "output": "2\n3\n1\n4\n"}, {"type": "stdin_stdout", "input": "4\n1 2 0 19\n2 3 8 1\n2 0 22 1\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\nSergey Semyonovich is a mayor of...
[{"type": "stdin_stdout", "input": "10\n2 3\n3 9\n6 3\n9 8\n9 10\n4 10\n3 1\n2 5\n7 2\n", "output": "70\n"}, {"type": "stdin_stdout", "input": "10\n2 3\n2 9\n6 3\n9 8\n9 10\n4 10\n3 1\n2 5\n7 2\n", "output": "70\n"}, {"type": "stdin_stdout", "input": "10\n2 3\n3 9\n6 4\n10 8\n9 10\n4 2\n3 1\n3 5\n7 1\n", "output": "75\...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nThe Cereal Guy's friend Serial G...
[{"type": "stdin_stdout", "input": "4 10 10\n\n..........\n..........\n..........\n..........\n..........\n..........\n..........\n..........\n..........\n..........\n\n..........\n..........\n..........\n..........\n..........\n..........\n..........\n..........\n..........\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\nGiven an array $a$, consisting o...
[{"type": "stdin_stdout", "input": "174\n28 44 12 32 9 27 23 5 23 47 14 49 39 5 10 5 20 9 4 34 18 40 16 4 45 30 32 44 44 30 29 23 21 27 35 13 23 46 5 32 47 45 44 23 12 2 9 28 47 23 22 27 45 27 40 41 22 39 50 14 40 44 20 40 49 23 14 29 27 23 16 40 45 44 15 18 28 9 23 15 21 10 46 29 18 6 15 3 11 34 1 15 35 27 46 36 4 20 ...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 multiset $S$ ini...
[{"type": "stdin_stdout", "input": "7\n5 1000000000\n4 2 3 0 1\n4 0\n5 2 0 1\n3 0\n100 0 1\n6 1234567\n1 2 3 4 5 0\n3 114514\n8 0 4\n1 1000000\n0\n1 10000000\n1\n", "output": "1000000005\n4\n3\n1234573\n4\n1000001\n1\n"}, {"type": "stdin_stdout", "input": "7\n5 1000000000\n4 2 3 0 1\n4 0\n5 2 0 1\n3 0\n100 0 1\n6 12345...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 H rows and W columns o...
[{"type": "stdin_stdout", "input": "21 -1\n-5 -5", "output": "104\n"}, {"type": "stdin_stdout", "input": "39 -1\n-5 -5", "output": "176\n"}, {"type": "stdin_stdout", "input": "13 13\n8 10\n", "output": "15\n"}, {"type": "stdin_stdout", "input": "20 20\n19 19\n", "output": "1\n"}, {"type": "stdin_stdout", "input": "19 1...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nYou've purchased a ready-meal fr...
[{"input": "\"600W\"\n4\n20\n\"800W\"", "output": "[\"3 minutes 15 seconds\"]", "fn_name": "cooking_time"}, {"input": "\"100W\"\n8\n45\n\"50W\"", "output": "[\"17 minutes 30 seconds\"]", "fn_name": "cooking_time"}, {"input": "\"450W\"\n3\n25\n\"950W\"", "output": "[\"1 minutes 38 seconds\"]", "fn_name": "cooking_time"}...
code_functional
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nThe main street of Berland is a ...
[{"type": "stdin_stdout", "input": "100000 99999\n", "output": "50000\n"}, {"type": "stdin_stdout", "input": "100000 23458\n", "output": "38272\n"}, {"type": "stdin_stdout", "input": "100000 23457\n", "output": "11729\n"}, {"type": "stdin_stdout", "input": "92480 43074\n", "output": "24704\n"}, {"type": "stdin_stdout",...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nA permutation of length n is an ...
[{"type": "stdin_stdout", "input": "100\n94 22 24 99 58 97 20 29 67 30 38 64 77 50 15 44 92 88 39 42 25 70 2 76 84 6 37 49 17 71 31 19 26 79 10 35 65 63 32 95 5 8 52 27 83 18 53 93 13 81 48 68 54 82 34 60 87 23 16 86 55 40 61 45 28 7 74 41 14 91 3 72 33 11 98 89 90 69 78 36 80 59 56 21 43 1 75 46 47 12 96 73 57 51 4 85...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nAnya has bought a new smartphone...
[{"type": "stdin_stdout", "input": "71 96 75634\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\n27 26 27 26 27 26 27 26 27 26 27 26 27 26 27 26 27 26 27 26 27 26 ...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nExample\n\nInput\n\n4 3\n1000 1\...
[{"type": "stdin_stdout", "input": "25 1\n1010 1\n3784 7\n3000 6", "output": "2 2 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1\n"}, {"type": "stdin_stdout", "input": "25 2\n1011 2\n2889 1\n308 2", "output": "3 3 2 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1\n"}, {"type": "stdin_stdout", "input": "20 3\n0010 1\n4107 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 is a data which provides h...
[{"type": "stdin_stdout", "input": "1819\n2003\n1094\n2489\n1723\n492\n4419\n2848\n2834\n1724", "output": "4419\n2848\n2834\n"}, {"type": "stdin_stdout", "input": "1819\n2003\n1094\n2489\n1142\n492\n4419\n4289\n2834\n1724", "output": "4419\n4289\n2834\n"}, {"type": "stdin_stdout", "input": "1819\n2003\n876\n2840\n1723\...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nRemove the parentheses\n=\nIn th...
[{"input": "\"hello example (words(more words) here) something\"", "output": "[\"hello example something\"]", "fn_name": "remove_parentheses"}, {"input": "\"example (unwanted thing) example\"", "output": "[\"example example\"]", "fn_name": "remove_parentheses"}, {"input": "\"example(unwanted thing)example\"", "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\nGiven a string s, write a method...
[{"input": "\"3 4 \"", "output": "[false]", "fn_name": "isDigit"}, {"input": "\"s2324\"", "output": "[false]", "fn_name": "isDigit"}, {"input": "\"-234.4\"", "output": "[true]", "fn_name": "isDigit"}, {"input": "\"34.65\"", "output": "[true]", "fn_name": "isDigit"}, {"input": "\"3 4\"", "output": "[false]", "fn_name"...
code_functional
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nATMs of a well-known bank of a s...
[{"type": "stdin_stdout", "input": "58 5\n1 6 9 18 34 41 82 99 164 179 183 204 240 396 636 1224 2023 2856 4488 4705 5712 9180 9266 18360 18850 20270 23086 60810 190701 197064 211140 214200 222970 243240 263510 314442 425670 486480 708288 789888 1009800 1025349 1054040 1094580 1325184 1579776 1748076 2050698 2635100 289...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 aim of this Kata is to write...
[{"input": "\"parallel universe\"", "output": "[\"paraLLel universe\"]", "fn_name": "reverse"}, {"input": "\"hello world\"", "output": "[\"heLLo world\"]", "fn_name": "reverse"}, {"input": "\"HELLO WORLD\"", "output": "[\"HEllO WORLD\"]", "fn_name": "reverse"}, {"input": "\"HeLlo World\"", "output": "[\"HeLlo World\"]"...
code_functional
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nWrite a simple parser that will ...
[{"input": "\"isoisoiso\"", "output": "[[1, 4, 25]]", "fn_name": "parse"}, {"input": "\"ioioio\"", "output": "[[1, 2, 3]]", "fn_name": "parse"}, {"input": "\"idoiido\"", "output": "[[0, 1]]", "fn_name": "parse"}, {"input": "\"ooo\"", "output": "[[0, 0, 0]]", "fn_name": "parse"}, {"input": "\"codewars\"", "output": "[[0...
code_functional
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nThere are n types of coins in By...
[{"type": "stdin_stdout", "input": "100\n4 1 5 3 2 1 1 1 4 1 1 2 1 1 1 4 1 1 3 1 3 1 1 1 1 4 5 1 5 2 5 3 1 1 1 1 1 1 1 3 2 1 1 3 1 1 3 4 3 2 4 1 1 4 1 1 2 2 4 1 4 1 2 5 1 2 2 1 5 3 1 5 4 2 1 1 2 5 5 1 4 4 2 3 1 4 1 3 2 1 1 1 4 1 3 1 1 5 1\n0 18 10 2 1 9 9 0 9 5 6 8 11 6 28 11 29 50 25 15 9 4 3 51 13 4 68 31 4 6 2 5 26 ...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nNew Year is just around the corn...
[{"type": "stdin_stdout", "input": "30\n3 1 3 2 3 1 1 3 2 1 1 3 3 3 3 3 2 1 2 1 3 2 2 1 3 1 3 1 2 3\n", "output": "0 1 1 1 1 2 3 3 3 4 5 5 5 6 6 6 6 7 7 8 8 8 9 10 10 11 11 12 12 12 "}, {"type": "stdin_stdout", "input": "7\n2 12 4 8 18 3 6\n", "output": "0 1 1 1 2 2 2 "}, {"type": "stdin_stdout", "input": "3\n1 1000000...
code_stdio