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\nIn late autumn evening n robots ...
[{"type": "stdin_stdout", "input": "4 6\n5 1000000000 1790978867 12\n", "output": "1790978867\n"}, {"type": "stdin_stdout", "input": "4 9\n5 1000000000 1766326397 19\n", "output": "1766326397\n"}, {"type": "stdin_stdout", "input": "4 9\n5 1000000000 1204240164 12\n", "output": "1204240164\n"}, {"type": "stdin_stdout", ...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\n# Task\n\nGiven the birthdates o...
[{"input": "\"1990-12-06\"\n\"2000-02-29\"", "output": "[\"2009-05-24\"]", "fn_name": "half_life"}, {"input": "\"2012-03-31\"\n\"1990-06-09\"", "output": "[\"2034-01-21\"]", "fn_name": "half_life"}, {"input": "\"1984-08-14\"\n\"1990-04-17\"", "output": "[\"1995-12-19\"]", "fn_name": "half_life"}, {"input": "\"2000-06-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\nCheck if given chord is minor or...
[{"input": "\"D F A C#\"", "output": "[\"Not a chord\"]", "fn_name": "minor_or_major"}, {"input": "\"Bb Gb Eb\"", "output": "[\"Not a chord\"]", "fn_name": "minor_or_major"}, {"input": "\"A C# D#\"", "output": "[\"Not a chord\"]", "fn_name": "minor_or_major"}, {"input": "\"D F A G\"", "output": "[\"Not a chord\"]", "fn...
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 n dice d_1, d_2, .....
[{"type": "stdin_stdout", "input": "10 20\n1 1 1 1 5 100 1 1 1 1\n", "output": "0 0 0 0 0 95 0 0 0 0 "}, {"type": "stdin_stdout", "input": "10 20\n1 1 1 1 5 100 1 1 1 1\n", "output": "0 0 0 0 0 95 0 0 0 0\n"}, {"type": "stdin_stdout", "input": "10 20\n1 1 1 1 10 100 1 1 1 1\n", "output": "0 0 0 0 0 90 0 0 0 0"}, {"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\nAyrat has number n, represented ...
[{"type": "stdin_stdout", "input": "67\n98929 19079 160079 181891 17599 91807 19079 98929 182233 92647 77477 98929 98639 182233 181891 182233 160079 98929 19079 98639 114941 98929 161341 91807 160079 22777 132361 92647 98929 77477 182233 103913 160079 77477 55711 77477 77477 182233 114941 91807 98929 19079 104393 18223...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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, liouzhou_101 got a chat...
[{"type": "stdin_stdout", "input": "10\nmiao.vyscfysAtWcPkpFHdwZqAQ,UPPcjhKQTlala.\nmiao.KESqus DybUuYFoWVpo..LWZh.UqEdUsTHFlKfzqkThAUPklala.\nUNoE vfZIAdxkiWKhsHPfsqRPTNQoHgAxooVLYxRzugHjo jaEHWQFF\nCCmdIwr.UkoiYWK.Z,,ZesMpISTXNgnpYnJaWquCyL,gO\n.JvOayhXK_bgoYbfAtnXg\nbvdSzRrXoGxVgWvdXnsjEnEfxDzIQo_aZVGDGrzwuAMtzVAHio...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 A and...
[{"type": "stdin_stdout", "input": "-17 -10", "output": "170\n"}, {"type": "stdin_stdout", "input": "-10 -10", "output": "100\n"}, {"type": "stdin_stdout", "input": "-156 -1", "output": "156\n"}, {"type": "stdin_stdout", "input": "-156 -2", "output": "312\n"}, {"type": "stdin_stdout", "input": "-156 -3", "output": "468...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 number line there are n bal...
[{"type": "stdin_stdout", "input": "10 88\n-100 -86 12\n-88 -62 9\n-96 -73 1\n-89 -100 34\n-80 -57 18\n-81 -91 2\n-84 -100 7\n-77 -84 3\n-97 -96 10\n-52 -60 3\n", "output": "-9488.033285728\n-7931.120096426\n-8406.936891019\n-8261.349896254\n-5320.095238095\n-5795.666666667\n-6961.166666667\n-5303.428571429\n-8788.1186...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nInnokentiy likes tea very much a...
[{"type": "stdin_stdout", "input": "70000 2748 31589 38411\n", "output": "BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 of intege...
[{"type": "stdin_stdout", "input": "6\n300000000 200000000 300000000 200000000 1000000000 300000000\n", "output": "3\n"}, {"type": "stdin_stdout", "input": "6\n300000000 200000000 173776099 200000000 1000000000 300000000\n", "output": "4\n"}, {"type": "stdin_stdout", "input": "6\n300000000 200000000 173776099 200000000...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 program that reads the ...
[{"type": "stdin_stdout", "input": "02,001\n50,10\n8,531", "output": "4750\n181\n"}, {"type": "stdin_stdout", "input": "0,1000\n01,05\n134,8", "output": "1077\n338\n"}, {"type": "stdin_stdout", "input": "0,1000\n01,05\n134,9", "output": "1211\n338\n"}, {"type": "stdin_stdout", "input": "0,1000\n11,05\n134,9", "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\nGiven a positive integer `n`, re...
[{"input": "100", "output": "[\"0110100110010110100101100110100110010110011010010110100110010110100101100110100101101001100101100110\"]", "fn_name": "thue_morse"}, {"input": "10", "output": "[\"0110100110\"]", "fn_name": "thue_morse"}, {"input": "5", "output": "[\"01101\"]", "fn_name": "thue_morse"}, {"input": "2", "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\nGiven an array A of N numbers, f...
[{"type": "stdin_stdout", "input": "10\n807\n935399 145100 -386862 856283 628359 256963 -461034 935399 776945 -759500 -759500 935399 -967263 649644 -24686 -452785 -352467 688773 908612 -386862 -479957 -146506 439811 -506538 -146506 145100 -461034 935399 -352307 -181185 740341 740341 439811 742466 -854789 700140 -740255...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 tree T with N vertice...
[{"type": "stdin_stdout", "input": "7\n4 7\n3 1\n2 6\n5 2\n7 1\n2 7\n", "output": "570312505\n"}, {"type": "stdin_stdout", "input": "7\n4 7\n3 1\n2 6\n5 4\n7 1\n2 7", "output": "835937507\n"}, {"type": "stdin_stdout", "input": "7\n4 7\n3 1\n3 6\n5 4\n7 1\n2 7", "output": "679687506\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\nLast summer Peter was at his gra...
[{"type": "stdin_stdout", "input": "1000000\n", "output": "958220352\n"}, {"type": "stdin_stdout", "input": "972408\n", "output": "377259665\n"}, {"type": "stdin_stdout", "input": "956022\n", "output": "864671299\n"}, {"type": "stdin_stdout", "input": "941322\n", "output": "359985814\n"}, {"type": "stdin_stdout", "inpu...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nAlex is transitioning from websi...
[{"input": "10\n120", "output": "[3]", "fn_name": "alex_mistakes"}, {"input": "11\n120", "output": "[3]", "fn_name": "alex_mistakes"}, {"input": "20\n120", "output": "[0]", "fn_name": "alex_mistakes"}, {"input": "20\n125", "output": "[1]", "fn_name": "alex_mistakes"}, {"input": "20\n130", "output": "[1]", "fn_name": "a...
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 problem you are to calcu...
[{"type": "stdin_stdout", "input": "60\n536870912\n536870911\n536870913\n1000000000\n999999999\n1\n2\n3\n4\n268435456\n268435455\n268435457\n536870912\n536870911\n536870913\n1000000000\n999999999\n1\n2\n3\n4\n268435456\n268435455\n268435457\n536870912\n536870911\n536870913\n1000000000\n999999999\n1\n2\n3\n4\n268435456\...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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# Introduction and Warm-up (High...
[{"input": "[-54, 37, 0, 64, -15, 640, 0]", "output": "[576]", "fn_name": "max_gap"}, {"input": "[24, 299, 131, 14, 26, 25]", "output": "[168]", "fn_name": "max_gap"}, {"input": "[-7, -42, -809, -14, -12]", "output": "[767]", "fn_name": "max_gap"}, {"input": "[12, -5, -7, 0, 290]", "output": "[278]", "fn_name": "max_ga...
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\nLeo has developed a new programm...
[{"type": "stdin_stdout", "input": "16\n1 1 1\n3 4 6\n4 5 16\n456 123 7890123\n1 1 1000000000\n45 12 782595420\n1 1000000000 1001000000\n1 999999999 1000000100\n1 99999 676497416\n5 6 1409378894\n8 9 1376775908\n500000000 500000000 1000000000\n1000000000 1000000000 1000000000\n999999999 1000000000 1000000000\n1066 1487...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 infinite set generat...
[{"type": "stdin_stdout", "input": "5\n24 3 5\n10 5 11\n2097 1 4\n19260817 394 623\n19260817 233 264\n", "output": "YES\nNO\nYES\nNO\nYES\n"}, {"type": "stdin_stdout", "input": "5\n24 3 5\n10 5 11\n2097 1 4\n19260817 394 227\n19260817 233 264\n", "output": "YES\nNO\nYES\nNO\nYES\n"}, {"type": "stdin_stdout", "input": "...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nYou are given a sorted array $a_...
[{"type": "stdin_stdout", "input": "7 6\n-3 0 -1 -2 -2 -4 -1\n", "output": "-2\n"}, {"type": "stdin_stdout", "input": "8 1\n1 1 2 3 5 8 13 21\n", "output": "20\n"}, {"type": "stdin_stdout", "input": "5 3\n99 101 103 105 107\n", "output": "4\n"}, {"type": "stdin_stdout", "input": "5 3\n99 101 103 105 107\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\nAlice is playing a game with her...
[{"type": "stdin_stdout", "input": "8000 100\n7990 4432 5901 5019 423 1200 7760 5752 7422 4337 4802 2570 7354 4912 2185 2344 6538 2783 1473 5311 3987 4739 7159 1677 3438 502 2800 1318 5223 4518 4448 6451 3455 5012 1588 814 4971 5847 3849 6248 6420 3607 2610 6852 1045 3730 757 6905 5248 3738 2382 7251 1305 7380 2476 734...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 Ancient Berland there were n ...
[{"type": "stdin_stdout", "input": "4 4 4\n1 2\n2 3\n3 4\n1 3\n1 2 3\n1 3 4\n1 2 4\n1 3 2\n", "output": "-1\n"}, {"type": "stdin_stdout", "input": "4 4 2\n1 2\n2 3\n3 4\n1 3\n1 2 3\n1 3 4\n", "output": "4\n1 3 2 3 4\n"}, {"type": "stdin_stdout", "input": "4 4 1\n1 2\n2 3\n3 4\n1 3\n1 3 4\n", "output": "3\n1 2 3 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\nYou have initially a string of N...
[{"type": "stdin_stdout", "input": "2\nabc\naba\n", "output": "3\n2\n"}, {"type": "stdin_stdout", "input": "2\nabd\naba", "output": "3\n2\n"}, {"type": "stdin_stdout", "input": "2\nabc\naaa", "output": "3\n1\n"}, {"type": "stdin_stdout", "input": "2\ncca\naaa", "output": "2\n1\n"}, {"type": "stdin_stdout", "input": "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\nIn this kata, you've to count lo...
[{"input": "\"arithmetics\"", "output": "[{\"a\": 1, \"c\": 1, \"e\": 1, \"h\": 1, \"i\": 2, \"m\": 1, \"r\": 1, \"s\": 1, \"t\": 2}]", "fn_name": "letter_count"}, {"input": "\"codewars\"", "output": "[{\"a\": 1, \"c\": 1, \"d\": 1, \"e\": 1, \"o\": 1, \"r\": 1, \"s\": 1, \"w\": 1}]", "fn_name": "letter_count"}, {"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\nYou talked to Polycarp and asked...
[{"type": "stdin_stdout", "input": "12\nYES\nesYes\ncodeforces\nes\nse\nYesY\nesYesYesYesYesYesYe\nseY\nYess\nsY\no\nYes\n", "output": "NO\nYES\nNO\nYES\nNO\nYES\nYES\nNO\nNO\nYES\nNO\nYES\n"}, {"type": "stdin_stdout", "input": "1\nsYesYesYesYesYesYesYesYesYesYesYesYesYesYesYesYesY\n", "output": "YES\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\n# Introduction\n\nThere is a war...
[{"input": "\"zdqmwpbs\"", "output": "[\"Let's fight again!\"]", "fn_name": "alphabet_war"}, {"input": "\"zzzzs\"", "output": "[\"Right side wins!\"]", "fn_name": "alphabet_war"}, {"input": "\"wwwwww\"", "output": "[\"Left side wins!\"]", "fn_name": "alphabet_war"}, {"input": "\"z\"", "output": "[\"Right side wins!\"]"...
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\nMr. Matsudaira is always careful...
[{"type": "stdin_stdout", "input": "29\n104\n0\n-1", "output": "620\n-11360\n3130\n"}, {"type": "stdin_stdout", "input": "29\n112\n0\n-1", "output": "620\n-12640\n3130\n"}, {"type": "stdin_stdout", "input": "29\n130\n1\n-1", "output": "620\n-15520\n3130\n"}, {"type": "stdin_stdout", "input": "29\n97\n0\n-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\nYou are given n k-digit integers...
[{"type": "stdin_stdout", "input": "8 8\n83239439\n62184887\n58968944\n39808261\n68740623\n38480328\n81965504\n52600488\n", "output": "44481119\n"}, {"type": "stdin_stdout", "input": "8 8\n96805230\n73119021\n06552907\n86283347\n88650846\n19155689\n37032451\n19310120\n", "output": "53604668\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\nLet's consider all integers in t...
[{"type": "stdin_stdout", "input": "100\n2\n3\n4\n6\n6\n9\n8\n9\n10\n11\n12\n23\n14\n15\n5\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n29\n30\n31\n32\n11\n20\n35\n36\n37\n38\n65\n40\n41\n42\n43\n44\n70\n46\n47\n48\n49\n50\n51\n52\n53\n54\n55\n56\n57\n58\n59\n60\n61\n62\n63\n64\n65\n66\n67\n68\n69\n70\n71\n72\n73\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\nAnshal and his friends love watc...
[{"type": "stdin_stdout", "input": "MDSZWKDLGUIISYZKOGMGXOZKMTWHNCMZHGADQFOYZZITXHDNNRTNGSZULYBACPBJVBMNGDLICTBBDHQSAJFGDHCQFETHVUSRYEEGHSOLNSMQBCJBNQKSXMJCSCLOYDHWKNDTFTFTNTLQYUSLNCEKQPNJTAZREGOOTTJBOOUEKHUICMVPQBBJQQUJRTDXBTNWOWXCLTIXBDFFRAWKCZTUQNGHIJGLETHSPHWCCFZFIEMZHKJLKEFARNJBYPMCIWWZDTCHYDNIIBJRMVCWZJYTZHUXYJCG...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nFinding your seat on a plane is ...
[{"input": "\"60D\"", "output": "[\"Back-Middle\"]", "fn_name": "plane_seat"}, {"input": "\"17K\"", "output": "[\"Front-Right\"]", "fn_name": "plane_seat"}, {"input": "\"20B\"", "output": "[\"Front-Left\"]", "fn_name": "plane_seat"}, {"input": "\"2B\"", "output": "[\"Front-Left\"]", "fn_name": "plane_seat"}, {"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\nBamboo Blossoms\n\nThe bamboos l...
[{"type": "stdin_stdout", "input": "3 2\n2 6\n10 10\n110 181\n2 371896\n0 0", "output": "5\n17\n21\n379\n5361757\n"}, {"type": "stdin_stdout", "input": "12 1\n3 1\n10 20\n100 50\n3 202868\n0 0", "output": "13\n4\n47\n150\n2792771\n"}, {"type": "stdin_stdout", "input": "2 4\n3 1\n13 35\n100 47\n4 346519\n0 0", "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\nAlas, finding one's true love is...
[{"type": "stdin_stdout", "input": "17601120900014764776764048700928872725171605903217\n", "output": "10428170619\n"}, {"type": "stdin_stdout", "input": "78767765544454334445445555455676565433343455432332\n", "output": "11031574582\n"}, {"type": "stdin_stdout", "input": "676765666545656543321110112122111112234332221100...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nI am a craftsman specialized in ...
[{"type": "stdin_stdout", "input": "1 -11", "output": "-10\n"}, {"type": "stdin_stdout", "input": "171 2", "output": "173\n"}, {"type": "stdin_stdout", "input": "120 3", "output": "121\n"}, {"type": "stdin_stdout", "input": "109 1", "output": "110\n"}, {"type": "stdin_stdout", "input": "119 1", "output": "120\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\nA rabbit who came to the fair fo...
[{"type": "stdin_stdout", "input": "4 6 1\n......\n...Y..\n/..Z..\nYRRRYY", "output": "YES\n"}, {"type": "stdin_stdout", "input": "4 6 1\n......\n...Y..\n..Z../\nYRRRYY", "output": "YES\n"}, {"type": "stdin_stdout", "input": "4 6 1\n......\n...Y./\n/..Z..\nYRRRYY", "output": "YES\n"}, {"type": "stdin_stdout", "input": ...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nGiven an array, return the diffe...
[{"input": "[5, 15, 16, 10, 6, 4, 16, \"t\", 13, \"n\", 14, \"k\", \"n\", 0, \"q\", \"d\", 7, 9]", "output": "[2]", "fn_name": "solve"}, {"input": "[0, 15, \"z\", 16, \"m\", 13, 14, \"c\", 9, 10, 13, \"u\", 4, 3]", "output": "[0]", "fn_name": "solve"}, {"input": "[1, \"a\", 17, 8, \"e\", 3, \"i\", 12, 1]", "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\n_This kata is based on [Project ...
[{"input": "3\n50000", "output": "[80887845303700596855]", "fn_name": "f"}, {"input": "100\n500000", "output": "[21469002551]", "fn_name": "f"}, {"input": "2\n1000", "output": "[264830889564]", "fn_name": "f"}, {"input": "97\n100000", "output": "[209497156]", "fn_name": "f"}, {"input": "2\n200", "output": "[7389572]", ...
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 a string S consisting of the...
[{"type": "stdin_stdout", "input": "PDPD???", "output": "PDPDDDD\n"}, {"type": "stdin_stdout", "input": "DDPP???", "output": "DDPPDDD\n"}, {"type": "stdin_stdout", "input": "DDPO???", "output": "DDPODDD\n"}, {"type": "stdin_stdout", "input": "DDPO?>?", "output": "DDPOD>D\n"}, {"type": "stdin_stdout", "input": "?>?OPDD"...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nSummer is coming! It's time for ...
[{"type": "stdin_stdout", "input": "4 5\n87882 40786 3691 85313 46694\n28884 16067 3242 97367 78518\n4250 35501 9780 14435 19004\n64673 65438 56977 64495 27280\n", "output": "747898\n"}, {"type": "stdin_stdout", "input": "4 5\n2274 40786 3691 98933 46694\n28884 16067 3242 97367 73338\n8377 57682 9780 14435 19004\n64673...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 regex to validate...
[{"input": "\"Hasd_12assssssasasasasasaasasasasas\"", "output": "[false]", "fn_name": "validate_usr"}, {"input": "\"asd43 34\"", "output": "[false]", "fn_name": "validate_usr"}, {"input": "\"asd43_34\"", "output": "[true]", "fn_name": "validate_usr"}, {"input": "\"asddsa\"", "output": "[true]", "fn_name": "validate_usr...
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\nOranges on Cans\n\nsquare1001 Yo...
[{"type": "stdin_stdout", "input": "-17 16", "output": "-272\n"}, {"type": "stdin_stdout", "input": "-17 30", "output": "-510\n"}, {"type": "stdin_stdout", "input": "-17 44", "output": "-748\n"}, {"type": "stdin_stdout", "input": "-2 125", "output": "-250\n"}, {"type": "stdin_stdout", "input": "-1 111", "output": "-111...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nGoal\nGiven a list of elements [...
[{"input": "[\"A\", \"A\", \"A\", \"BBBBBBBB\"]", "output": "[\"A\"]", "fn_name": "majority"}, {"input": "[\"A\", \"B\", \"B\", \"A\"]", "output": "[null]", "fn_name": "majority"}, {"input": "[\"A\", \"A\", \"A\", \"A\"]", "output": "[\"A\"]", "fn_name": "majority"}, {"input": "[\"A\", \"B\", \"C\", \"C\"]", "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\nHappy new year! The year 2020 is...
[{"type": "stdin_stdout", "input": "10 12\nsin im gye gap eul bynoeg jeong mu gj gyeong\nyu sul hae jb chuk in myo jin as o li sin\n14\n1\n1\n3\n4\n17\n17\n12\n13\n73\n2016\n32\n2018\n2019\n2020\n", "output": "sinyu\nsinyu\ngyehae\ngapjb\njeongchuk\njeongchuk\nimsin\ngyeyu\ngyeyu\nbynoegsin\nimjin\nmusul\ngjhae\ngyeong...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nRecently personal training sessi...
[{"type": "stdin_stdout", "input": "7\n4 19 14 8 21 16 2 18 1 15 3 17 13 5 6 10 9 7 12 11 20\n4 19 10\n14 8 3\n21 17 9\n16 6 12\n2 13 20\n18 1 7\n15 5 11\n21\n", "output": "3 4 8 9 10 14 17 1 2 5 6 7 11 12 13 15 16 18 19 20\n"}, {"type": "stdin_stdout", "input": "6\n6 4 10 16 14 11 13 1 7 17 18 15 5 3 9 12 2 8\n6 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\nAccording to ISO 8601, the first...
[{"input": "\"2017-01-01\"", "output": "[52]", "fn_name": "get_calendar_week"}, {"input": "\"2018-12-24\"", "output": "[52]", "fn_name": "get_calendar_week"}, {"input": "\"2015-12-29\"", "output": "[53]", "fn_name": "get_calendar_week"}, {"input": "\"1995-12-31\"", "output": "[52]", "fn_name": "get_calendar_week"}, {"i...
code_functional
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nYou are given an array $a_1, a_2...
[{"type": "stdin_stdout", "input": "4\n1\n8\n6\n4 4 6 6 2 9\n4\n4 5 6 10\n5\n10 10 2 2 4\n", "output": "YES\nYES\nYES\nYES\n"}, {"type": "stdin_stdout", "input": "4\n1\n8\n6\n4 4 6 6 2 9\n4\n4 5 6 7\n5\n10 10 2 2 4\n", "output": "YES\nYES\nYES\nYES\n"}, {"type": "stdin_stdout", "input": "4\n1\n8\n6\n4 4 6 6 2 15\n4\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\nThe circle line of the Berland s...
[{"type": "stdin_stdout", "input": "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 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\nYou are playing a popular video ...
[{"type": "stdin_stdout", "input": "...\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\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\nSo, the Berland is at war with i...
[{"type": "stdin_stdout", "input": "1003 -5005 3399\n-10705 -1729 4365\n", "output": "2196.845285084989\n"}, {"type": "stdin_stdout", "input": "-9577 9051 5276\n-4315 -1295 3517\n", "output": "1407.1273140166404\n"}, {"type": "stdin_stdout", "input": "-9445 -9860 5513\n6291 -855 9034\n", "output": "1791.7043689042112\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 sequence of $n$ ...
[{"type": "stdin_stdout", "input": "20\n5\n6711 19885 -3098 -16272 -10076\n4\n86522 29647 -12464 -9627\n4\n-82555 -5215 -15221 -63129\n4\n-18147 4 5 -5\n5\n-17427 -19079 17427 15043 19079\n5\n15148 5942 361 9206 21087\n3\n-1 -55 1\n5\n47214 53109 39369 11561 -22908\n4\n-74790 54187 -2 30242\n2\n-68120 94070\n3\n-27228 ...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nIn this problem you have to simu...
[{"type": "stdin_stdout", "input": "4 3\n999999996 1000000000\n999999997 1000000000\n999999998 1000000000\n999999999 1000000000\n", "output": "1999999996 2999999996 3999999996 4999999996 \n"}, {"type": "stdin_stdout", "input": "4 3\n999999996 1000000000\n999999997 1000000000\n999999998 1000000000\n999999999 1000000000\...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nYou play a strategic video game ...
[{"type": "stdin_stdout", "input": "10 10 2\n2 1 1615\n2 1 1326\n0 0 3880\n2 0 1596\n1 2 4118\n0 0 4795\n0 1 814\n0 0 4555\n0 1 3284\n2 2 1910\n10 6\n2 1\n8 3\n8 7\n6 3\n4 1\n7 4\n6 4\n7 2\n10 9\n", "output": "27079\n"}, {"type": "stdin_stdout", "input": "10 10 0\n0 2 1413\n0 0 4466\n0 0 2681\n0 0 2959\n0 2 1182\n0 0 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\nYou drew lottery N times. In the...
[{"type": "stdin_stdout", "input": "5\ngrape\ngrape\ngrape\ngrape\ngrape\n", "output": "1\n"}, {"type": "stdin_stdout", "input": "5\ngrape\ngrape\ngraoe\ngrape\ngrape", "output": "2\n"}, {"type": "stdin_stdout", "input": "5\negapr\ngrape\ngraoe\ngr`pe\nepaqg", "output": "5\n"}, {"type": "stdin_stdout", "input": "5\ngra...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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, Wet Shark is given n inte...
[{"type": "stdin_stdout", "input": "5\n999999999 503514429 850382710 999999999 1620498919\n", "output": "4974396056\n"}, {"type": "stdin_stdout", "input": "5\n999999999 503514429 850382710 999999999 1246839866\n", "output": "4097222574\n"}, {"type": "stdin_stdout", "input": "5\n999999999 999999999 850382710 999999999 9...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nRecently, Petya learned about a ...
[{"type": "stdin_stdout", "input": "4\n3 0 2 3\n5\n6 12\n2 22\n2 14\n1 7\n14 17\n", "output": "10\n16\n8\n1\n23\n"}, {"type": "stdin_stdout", "input": "4\n3 5 2 3\n5\n6 12\n2 22\n2 14\n1 7\n14 17\n", "output": "5\n11\n3\n0\n18\n"}, {"type": "stdin_stdout", "input": "4\n3 5 2 3\n5\n6 4\n2 22\n2 14\n2 14\n14 17\n", "outp...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nYou have a given picture with si...
[{"type": "stdin_stdout", "input": "10 10\n..........\n..........\n....*.....\n....*.....\n.*******..\n....*.....\n....*.....\n..........\n....*.....\n..........\n", "output": "NO\n"}, {"type": "stdin_stdout", "input": "10 10\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 three strings A, B...
[{"type": "stdin_stdout", "input": "9\ncjfferent\ndifferent\ntnereffid", "output": "10\n"}, {"type": "stdin_stdout", "input": "9\ntneredfic\nciffeernt\ndifferent", "output": "11\n"}, {"type": "stdin_stdout", "input": "9\ntnedergia\ncifreefnt\ndifsnfeet", "output": "14\n"}, {"type": "stdin_stdout", "input": "9\ntnedergi...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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, determine if it'...
[{"input": "\"1ok0okay\"", "output": "[false]", "fn_name": "is_valid"}, {"input": "\"okay_ok1\"", "output": "[true]", "fn_name": "is_valid"}, {"input": "\"myIdentf\"", "output": "[true]", "fn_name": "is_valid"}, {"input": "\"str-str\"", "output": "[false]", "fn_name": "is_valid"}, {"input": "\"str_STR\"", "output": "[t...
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\n```python\nfunction repea...
[{"input": "18018018\n80000000000", "output": "[\"0.(0)(2)5(2)5(2)5\"]", "fn_name": "repeating_fractions"}, {"input": "1554\n70", "output": "[\"22.2\"]", "fn_name": "repeating_fractions"}, {"input": "1\n3", "output": "[\"0.(3)\"]", "fn_name": "repeating_fractions"}, {"input": "0\n1", "output": "[\"0.0\"]", "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\nA traveler is planning a water h...
[{"type": "stdin_stdout", "input": "19 2\n1 73\n2 96\n3 24\n5 96\n11 13\n14 96\n16 31\n17 60\n34 69\n39 41\n60 40\n61 96\n66 7\n67 56\n70 28\n73 12\n74 81\n78 77\n95 99\n", "output": "2 3 4 6 7 8 11 12 14 15 17 18 19\n"}, {"type": "stdin_stdout", "input": "20 8\n2 37\n9 28\n13 63\n14 85\n27 27\n29 90\n34 96\n36 60\n41 ...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 is a simplified version of pr...
[{"type": "stdin_stdout", "input": "4\n1 1\n221 2\n177890 2\n998244353 1\n", "output": "1\n221\n181111\n999999999\n"}, {"type": "stdin_stdout", "input": "4\n1 1\n221 2\n177890 1\n998244353 1\n", "output": "1\n221\n222222\n999999999\n"}, {"type": "stdin_stdout", "input": "4\n1 1\n221 2\n108810 1\n998244353 1\n", "output...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nYou are given an undirected grap...
[{"type": "stdin_stdout", "input": "4 7\n0 0 1\n-1 1 1\n-1 2 3\n1 0 1\n1 2 2\n-1 0 3\n-1 1 1", "output": "1\n0\n1\n1\n0\n1\n"}, {"type": "stdin_stdout", "input": "4 7\n0 0 1\n-1 2 1\n-1 2 3\n1 0 1\n1 2 2\n-1 0 3\n-1 1 1", "output": "0\n0\n1\n1\n0\n1\n"}, {"type": "stdin_stdout", "input": "9 7\n1 1 1\n-1 0 1\n-1 2 3\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 task is to write function w...
[{"input": "\"Solve_this|kata-very\\\\quickly!\"\n[\"!\", \"|\", \"\\\\\", \"_\", \"-\"]", "output": "[[\"Solve\", \"this\", \"kata\", \"very\", \"quickly\"]]", "fn_name": "multiple_split"}, {"input": "\"((1+2))*(6-3)^9\"\n[\"+\", \"-\", \"(\", \")\", \"^\", \"*\"]", "output": "[[\"1\", \"2\", \"6\", \"3\", \"9\"]]", "...
code_functional
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nExample\n\nInput\n\n3 2\nR1\n\n\...
[{"type": "stdin_stdout", "input": "73 2\nR2", "output": "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\n146 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 islands and M bridge...
[{"type": "stdin_stdout", "input": "29 45\n1 3\n2 3\n2 14\n2 19\n2 29\n3 26\n4 5\n4 6\n4 13\n4 17\n5 10\n5 19\n5 24\n6 18\n6 19\n6 24\n6 25\n6 28\n6 29\n8 9\n9 18\n9 25\n10 29\n11 16\n11 22\n12 14\n12 15\n12 26\n12 29\n13 14\n14 20\n14 27\n14 29\n15 16\n15 22\n15 25\n15 29\n16 29\n17 27\n19 26\n20 29\n24 26\n15 23\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\nBarbara was late for her math cl...
[{"type": "stdin_stdout", "input": "100\n1 2 2 2 1 1 2 2 0 2 2 0 1 0 0 0 0 1 0 0 0 1 1 2 1 1 2 2 0 2 0 2 1 1 0 2 1 0 1 2 1 2 2 1 1 1 2 1 1 1 0 1 1 0 0 2 2 1 2 2 1 0 1 0 0 2 1 2 1 1 0 2 1 0 2 0 2 1 2 0 0 0 1 1 2 0 1 0 2 2 2 1 1 1 0 2 2 1 1 1\n*-+\n", "output": "1+2*2*2*1*1*2*2+0+2*2+0+1+0+0+0+0+1+0+0+0+1+1+2*1*1*2*2+0+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\nPetya is a math teacher. n of hi...
[{"type": "stdin_stdout", "input": "3\n4 3\n5 1 2 2\n110\n100\n101\n100\n4 4\n6 2 0 10\n1001\n0010\n0110\n0101\n3 6\n20 3 15\n010110\n000101\n111111\n", "output": "3 1 2 \n2 3 4 1 \n3 1 4 5 2 6 \n"}, {"type": "stdin_stdout", "input": "3\n4 3\n10 1 2 2\n110\n100\n101\n100\n4 4\n6 2 0 10\n1001\n0010\n0110\n0101\n3 6\n20 ...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nMike decided to teach programmin...
[{"type": "stdin_stdout", "input": "20\n43 48 38 34 23 18 8 22 12 7 47 1 13 20 3 15 49 6 10 26\n", "output": "5\n"}, {"type": "stdin_stdout", "input": "20\n43 48 38 34 23 18 8 22 12 7 47 1 13 20 3 15 49 6 10 26\n", "output": "5\n"}, {"type": "stdin_stdout", "input": "20\n43 48 38 34 41 18 8 22 12 7 47 1 13 20 3 15 49 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\nExample\n\nInput\n\n2\n1 2\n\n\n...
[{"type": "stdin_stdout", "input": "2\n-1 -12", "output": "12\n"}, {"type": "stdin_stdout", "input": "2\n-1 12", "output": "-1\n"}, {"type": "stdin_stdout", "input": "2\n-1 24", "output": "-1\n"}, {"type": "stdin_stdout", "input": "2\n-2 24", "output": "-1\n"}, {"type": "stdin_stdout", "input": "2\n-2 22", "output": "-...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nA chessboard n × m in size is gi...
[{"type": "stdin_stdout", "input": "5000 5000\n1000000000\n", "output": "0\n"}, {"type": "stdin_stdout", "input": "2085 5000\n1000000000\n", "output": "0\n"}, {"type": "stdin_stdout", "input": "3762 3914\n1073\n", "output": "3386\n"}, {"type": "stdin_stdout", "input": "4583 2774\n1206\n", "output": "2535\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\nAndrey's favourite number is n. ...
[{"type": "stdin_stdout", "input": "73552900025351606679224588872327647961330089042655630665222580520508672870102563487600132539752481214659858863022476410484266570139810532470714984092503934751571221521306943121997450187110428026190962582430971693370613087381790614697689671767000004095232276975952292053272119035138483...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nTakahashi has a tower which is d...
[{"type": "stdin_stdout", "input": "121980 33447 90629 11295524182", "output": "643972230\n"}, {"type": "stdin_stdout", "input": "111605 33447 77758 2284871002", "output": "762328834\n"}, {"type": "stdin_stdout", "input": "111605 33447 14069 2284871002", "output": "815838636\n"}, {"type": "stdin_stdout", "input": "4247...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 likes numbers that are ...
[{"type": "stdin_stdout", "input": "1000000000000000000000000000000000\n", "output": "33\n"}, {"type": "stdin_stdout", "input": "1000010000000000000000000000000000\n", "output": "32\n"}, {"type": "stdin_stdout", "input": "1000010000000001000000000000000000\n", "output": "31\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\nA prime number is a natural numb...
[{"type": "stdin_stdout", "input": "11\n13\n20\n9\n10\n11\n13\n33\n14\n16\n12\n17", "output": "4\n"}, {"type": "stdin_stdout", "input": "11\n25\n20\n9\n10\n11\n13\n33\n14\n16\n12\n17", "output": "3\n"}, {"type": "stdin_stdout", "input": "11\n7\n10\n9\n10\n11\n13\n17\n14\n15\n16\n17", "output": "5\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\nPolycarp likes arithmetic progre...
[{"type": "stdin_stdout", "input": "4\n1 1000000000 1000000000 1000000000\n", "output": "-1\n"}, {"type": "stdin_stdout", "input": "4\n1 1000000000 1000000000 1000000000\n", "output": "-1\n"}, {"type": "stdin_stdout", "input": "4\n1 1000000000 1010000000 1000000000\n", "output": "-1\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\nGennady owns a small hotel in th...
[{"type": "stdin_stdout", "input": "AS\n2H 4C TH JH AD\n", "output": "YES\n"}, {"type": "stdin_stdout", "input": "4D\nAS AC AD AH 5H\n", "output": "YES\n"}, {"type": "stdin_stdout", "input": "KH\n3C QD 9S KS 8D\n", "output": "YES\n"}, {"type": "stdin_stdout", "input": "4H\nJH QC 5H 9H KD\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\nYour friend won't stop texting h...
[{"input": "\"You u youville utube you youyouyou uuu raiyou united youuuu u you\"", "output": "[\"your sister your sister youville utube your sister youyouyou uuu raiyou united your sister your sister your sister\"]", "fn_name": "autocorrect"}, {"input": "\"I want to film the bayou with you and put it on youtube\"", "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\nA country has coins with denomin...
[{"input": "[1, 2, 5, 10, 20, 50, 100, 200]\n93", "output": "[5]", "fn_name": "loose_change"}, {"input": "[25, 5, 10, 1, 21]\n63", "output": "[3]", "fn_name": "loose_change"}, {"input": "[1, 5, 10, 25]\n37", "output": "[4]", "fn_name": "loose_change"}, {"input": "[1, 4, 5, 10]\n8", "output": "[2]", "fn_name": "loose_ch...
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 two buttons, one of si...
[{"type": "stdin_stdout", "input": "-134 -12", "output": "-25\n"}, {"type": "stdin_stdout", "input": "-134 -8", "output": "-17\n"}, {"type": "stdin_stdout", "input": "-13 -10", "output": "-21\n"}, {"type": "stdin_stdout", "input": "100 100", "output": "200\n"}, {"type": "stdin_stdout", "input": "111 111", "output": "22...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nBarney lives in country USC (Uni...
[{"type": "stdin_stdout", "input": "85\n1 1 2 2 4 6 1 3 6 3 3 11 9 14 12 5 8 11 16 19 12 17 2 19 1 24 6 2 6 6 24 3 20 1 1 1 17 8 4 25 31 32 39 12 35 23 31 26 46 9 37 7 5 23 41 41 39 9 11 54 36 54 28 15 25 58 56 18 23 70 68 18 3 48 57 70 15 65 22 35 25 13 49 34\n", "output": "1.000000 28.500000 27.000000 38.000000 38.50...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 `isAlt()` that...
[{"input": "\"orange\"", "output": "[false]", "fn_name": "is_alt"}, {"input": "\"helipad\"", "output": "[true]", "fn_name": "is_alt"}, {"input": "\"amazon\"", "output": "[true]", "fn_name": "is_alt"}, {"input": "\"apple\"", "output": "[false]", "fn_name": "is_alt"}, {"input": "\"banana\"", "output": "[true]", "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\nThere is a cube which consists o...
[{"type": "stdin_stdout", "input": "12 3\nxy 4 3\nxz 1 2\nyz 2 3\n7 5\nxy 1 1\nxy 3 3\nxz 3 2\nyz 2 1\nyz 3 3\n0 0", "output": "1692\n310\n"}, {"type": "stdin_stdout", "input": "12 3\nxy 4 3\nxz 1 2\nyz 2 3\n7 5\nxy 1 1\nyx 3 3\nxz 3 2\nyz 2 1\nyz 3 3\n0 0", "output": "1692\n315\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\nConstraints\n\n* 1 ≤ |V| ≤ 1000\...
[{"type": "stdin_stdout", "input": "42 0 1\n2 -1 3\n0 5 55\n1 0 -2\n-2 0 1\n2 4 -1", "output": "INF\n0\nINF\nINF\nINF\nINF\nINF\nINF\nINF\nINF\nINF\nINF\nINF\nINF\nINF\nINF\nINF\nINF\nINF\nINF\nINF\nINF\nINF\nINF\nINF\nINF\nINF\nINF\nINF\nINF\nINF\nINF\nINF\nINF\nINF\nINF\nINF\nINF\nINF\nINF\nINF\nINF\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\nB: Hokkaido University Hard\n\nN...
[{"type": "stdin_stdout", "input": "3 3\nB.B\nB..\n.BB", "output": "4\n"}, {"type": "stdin_stdout", "input": "2 3\nB.B\nB..\n.BB", "output": "3\n"}, {"type": "stdin_stdout", "input": "1 3\nB-B\n..B\n.BA", "output": "2\n"}, {"type": "stdin_stdout", "input": "1 1\nB-B\n..B\n.BA", "output": "0\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\nImplement `String#whitespace?(st...
[{"input": "\"\\t \\n\\r\\n \"", "output": "[true]", "fn_name": "whitespace"}, {"input": "\"\\n\\r\\n\\r 3\"", "output": "[false]", "fn_name": "whitespace"}, {"input": "\"\\n\\r\\n\\r \"", "output": "[true]", "fn_name": "whitespace"}, {"input": "\"\\n\\r\\n\\r\"", "output": "[true]", "fn_name": "whitespace"}, {"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\nProblem\n\nKND is a student prog...
[{"type": "stdin_stdout", "input": "3 2 3\n2 1 1\n2 1 1\n1 3 5", "output": "6.56688917825\n0.866025403784\n0.866025403784\n12.6033176764\n"}, {"type": "stdin_stdout", "input": "3 2 2\n2 1 1\n1 1 1\n1 3 16", "output": "5.44841509844\n0.866025403784\n1.29903810568\n29.6215145047\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\nTakahashi is solving quizzes. He...
[{"type": "stdin_stdout", "input": "3\n001", "output": "2\n"}, {"type": "stdin_stdout", "input": "3\n001", "output": "2\n"}, {"type": "stdin_stdout", "input": "3\n1\n", "output": "2\n"}, {"type": "stdin_stdout", "input": "1\n2\n", "output": "3\n"}, {"type": "stdin_stdout", "input": "1\n3\n", "output": "2\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\nYou are given an array $a[0 \\ld...
[{"type": "stdin_stdout", "input": "4\n4\n6 4 7 6\n3\n3 2 6\n1\n7\n3\n4 14 2 1 18 3 0\n", "output": "-1\n1\n-1\n-1\n"}, {"type": "stdin_stdout", "input": "4\n4\n3 2 0 6\n3\n6 4 4\n1\n7\n7\n7 7 2 1 18 1 2\n", "output": "-1\n-1\n-1\n-1\n"}, {"type": "stdin_stdout", "input": "4\n4\n3 2 7 8\n3\n6 2 8\n1\n7\n7\n6 13 2 1 19 ...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 postal code in Atcoder Kingd...
[{"type": "stdin_stdout", "input": "3 4\n269-6650\n", "output": "Yes\n"}, {"type": "stdin_stdout", "input": "6 4\n269-6650", "output": "No\n"}, {"type": "stdin_stdout", "input": "6 8\n269-6650", "output": "No\n"}, {"type": "stdin_stdout", "input": "6 1\n269-6650", "output": "No\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\nCQXYM found a rectangle A of siz...
[{"type": "stdin_stdout", "input": "1\n9 9\n001010001\n101110100\n000010011\n100000001\n101010101\n110001111\n000001111\n110100000\n000110000\n", "output": "5\n"}, {"type": "stdin_stdout", "input": "1\n8 9\n101110001\n101110100\n000010001\n001000001\n001011101\n110001111\n000001111\n110100010\n010110000\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\nNote that girls in Arpa’s land a...
[{"type": "stdin_stdout", "input": "26\n8 10\n52 21\n2 33\n18 34\n30 51\n5 19\n22 32\n36 28\n42 16\n13 49\n11 17\n31 39\n43 37\n50 15\n29 20\n35 46\n47 23\n3 1\n44 7\n9 27\n6 48\n40 24\n26 14\n45 4\n12 25\n41 38\n", "output": "2 1\n1 2\n2 1\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n2 1\n1 2\n1 2\n1 2\n2 1\n2 1\n2 1\n2 1\n2 1\n2 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\nMash 2 arrays together so that t...
[{"input": "[\"h\", \"l\", \"o\", \"o\", \"l\"]\n[\"e\", \"l\", \"w\", \"r\", \"d\"]", "output": "[[\"h\", \"e\", \"l\", \"l\", \"o\", \"w\", \"o\", \"r\", \"l\", \"d\"]]", "fn_name": "array_mash"}, {"input": "[1, 8, \"hello\", \"dog\"]\n[\"fish\", \"2\", 9, 10]", "output": "[[1, \"fish\", 8, \"2\", \"hello\", 9, \"dog...
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 wrote on the board a st...
[{"type": "stdin_stdout", "input": "10\nvzsxyuyy\n3\n1 0 3\nwwvutuxsuxywut\n2\n0 0\nsuzvsvutvvstuz\n3\n3 1 0\nstyuwsutv\n4\n6 3 0 1\nzsustytvzsyw\n6\n0 9 5 7 7 5\nsvwxwwwyxuvszx\n1\n0\nxuyyvuztxwuuvsxwz\n5\n5 7 0 0 7\nuxuztuwsxz\n5\n4 2 2 0 10\nxystzstwtzwsz\n2\n1 0\nuuzss\n1\n0\n", "output": "yzx\nxx\nuvz\nuvyw\nztwtv...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nJust to remind, girls in Arpa's ...
[{"type": "stdin_stdout", "input": "10 5 100\n64 109 3 94 96 97 52 54 82 26\n796554 444893 214351 43810 684158 1060686 686198 339093 383018 699152\n6 8\n8 3\n3 9\n2 3\n10 3\n", "output": "1495706\n"}, {"type": "stdin_stdout", "input": "10 5 100\n48 73 57 46 95 19 171 73 94 24\n501216 675859 843572 565104 879875 828759 ...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 an d...
[{"type": "stdin_stdout", "input": "4\n1 2 1 4\n2 -1 4\n0 -1\n4 1 0", "output": "1 0\n2 -1\n3 -1\n4 1\n"}, {"type": "stdin_stdout", "input": "4\n1 2 1 4\n2 0 4\n0 -1\n4 -1 0", "output": "1 0\n2 -1\n3 -1\n4 1\n"}, {"type": "stdin_stdout", "input": "4\n1 2 1 4\n3 0 4\n0 -1\n4 -1 0", "output": "1 0\n2 -1\n3 -1\n4 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\nA university student, Takahashi,...
[{"type": "stdin_stdout", "input": "12\n757232153 372327760 440075441 195848680 354974235 458054863 463477172 740174259 615762794 632963102 529866931 64991604\n102338863 98239366 465611891 362739947 147060907 118867039 63189252 78303147 501410831 110823640 122948912 572905212", "output": "5\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\nStephen Queen wants to write a s...
[{"type": "stdin_stdout", "input": "6\n3\nbac\naaada\ne\n3\naba\nabcde\naba\n2\nbaba\nbaba\n4\nab\nab\nc\nbc\n5\ncbdca\nd\na\nd\ne\n3\nb\nc\nca\n", "output": "3\n2\n0\n2\n3\n2\n"}, {"type": "stdin_stdout", "input": "6\n3\nbac\naaada\ne\n3\naba\nabcde\naba\n2\nbaba\nbaba\n4\nba\nab\nc\nbc\n5\ncbdca\nd\na\nd\ne\n3\nb\nc\...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nKevin has just recevied his disa...
[{"type": "stdin_stdout", "input": "93\n010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010\n", "output": "93\n"}, {"type": "stdin_stdout", "input": "93\n010101010101010101010101010101010101010101010101010101010101010101010101011101010101010101010\n", "output": "93\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\nKaren has just arrived at school...
[{"type": "stdin_stdout", "input": "19\n716981305 764655030 1148561420 914539062 853464027 317088317 653721289 239862203 605157354 943428394 261437390 821695238 312192823 432992892 547139308 121208111 1614663126 223751525 1084180198\n", "output": "399181927\n"}, {"type": "stdin_stdout", "input": "19\n469776209 76465503...
code_stdio