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\nPolycarpus loves hamburgers very...
[{"type": "stdin_stdout", "input": "SSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSS\n100 100 100\n100 100 100\n1000000000000\n", "output": "100000001\n"}, {"type": "stdin_stdout", "input": "SSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSS...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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$. Each...
[{"type": "stdin_stdout", "input": "7\n0\n0\n0\n0\n0\n0\n0\n", "output": "0\n0\n0\n0\n0\n0\n0\n"}, {"type": "stdin_stdout", "input": "7\n0\n0\n0\n0\n0\n0\n0\n", "output": "0\n0\n0\n0\n0\n0\n0\n"}, {"type": "stdin_stdout", "input": "7\n0\n0\n0\n0\n1\n0\n0\n", "output": "0\n0\n0\n0\n0\n0\n0\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\nComplete the function that calcu...
[{"input": "\"-1000x^7+200x^4+6x^2+x+1000\"", "output": "[\"-7000x^6+800x^3+12x+1\"]", "fn_name": "derivative"}, {"input": "\"100x^5+12x^3-3x-3\"", "output": "[\"500x^4+36x^2-3\"]", "fn_name": "derivative"}, {"input": "\"10x^9+10x^3+10x\"", "output": "[\"90x^8+30x^2+10\"]", "fn_name": "derivative"}, {"input": "\"-x^5-x...
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 telephone number is a sequence...
[{"type": "stdin_stdout", "input": "109\n8800880880088088880888808880888088800880888088088088888080880000080000800000808008008800080008000888000808880\n", "output": "YES\n"}, {"type": "stdin_stdout", "input": "109\n880088088008808888088880888088808880088088808808808888808088000008000080000080800800880008000800088800080...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 data that records the c...
[{"type": "stdin_stdout", "input": "123,10\n56,12\n35,14\n\n123,3\n56,4\n123,5", "output": "56 2\n123 3\n"}, {"type": "stdin_stdout", "input": "123,10\n56,12\n45,13\n\n113,4\n56,4\n123,5", "output": "56 2\n123 2\n"}, {"type": "stdin_stdout", "input": "123,10\n57,12\n35,14\n\n123,3\n57,4\n123,5", "output": "57 2\n123 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\nGiven is a string S consisting o...
[{"type": "stdin_stdout", "input": "11101111011111000000000110000001111100011111000000001101111110000000111111111", "output": "323558395\n"}, {"type": "stdin_stdout", "input": "11101111011101000000000110000001111100011111000000001101111110000000111111111", "output": "979142942\n"}, {"type": "stdin_stdout", "input": "11...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nTakahashi has decided to hold fa...
[{"type": "stdin_stdout", "input": "1000 993 1000\n176\n400\n733\n753\n822\n429\n929\n697\n176\n191\n80\n247\n40\n891\n773\n889\n453\n777\n451\n40\n120\n222\n697\n906\n441\n251\n324\n193\n970\n558\n824\n390\n824\n36\n209\n120\n849\n548\n393\n668\n561\n289\n560\n970\n575\n53\n154\n931\n750\n404\n478\n120\n542\n98\n551\n...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nIn a small town the population i...
[{"input": "1500000\n0.25\n-1000\n2000000", "output": "[151]", "fn_name": "nb_year"}, {"input": "1500000\n2.5\n10000\n2000000", "output": "[10]", "fn_name": "nb_year"}, {"input": "1500000\n0.25\n1000\n2000000", "output": "[94]", "fn_name": "nb_year"}, {"input": "1500000\n0.0\n10000\n2000000", "output": "[50]", "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\nSalve, mi amice.\n\nEt tu quidem...
[{"type": "stdin_stdout", "input": "100 100 100 100 100\n", "output": "14\n"}, {"type": "stdin_stdout", "input": "100 100 100 100 100\n", "output": "14\n"}, {"type": "stdin_stdout", "input": "100 110 100 100 100\n", "output": "14\n"}, {"type": "stdin_stdout", "input": "100 110 100 110 100\n", "output": "15\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\nThere is a given string S consis...
[{"type": "stdin_stdout", "input": "abcdefghijklmnopqrstuvwxyz0987654321abcdefghijklmnopqrstuvwxyz0987654321abcdefghijklmnopqrstuvwxyz0987654321\n", "output": "324\n"}, {"type": "stdin_stdout", "input": "1234567890zyxwvutsrqponmlkjihgfedcba1234567890zyxwvutsrqponmlkjihgfedcba1234567890zyxwvutsrqponmlkjihgfedcba\n", "ou...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 binary string $s...
[{"type": "stdin_stdout", "input": "40\n1111110111111111111111011111111111111110\n", "output": "40\n"}, {"type": "stdin_stdout", "input": "40\n0000000000100000100000000000000000000000\n", "output": "40\n"}, {"type": "stdin_stdout", "input": "40\n0000010010000000000001000110000001010100\n", "output": "40\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\nThe University of Aizu has a par...
[{"type": "stdin_stdout", "input": "10 1\n10\n2 6 6 3 1 2 -1 2 4 0 1 8 5 9 7 9 8 9 6 3\n6 1\n10\n10 2 5 3 1 2 0 12 4 6 1 4 9 9 11 12 8 6 14 0\n0 0", "output": "NA\nNA\n"}, {"type": "stdin_stdout", "input": "10 1\n10\n2 6 6 3 1 2 -1 2 4 0 1 8 5 9 7 9 8 9 6 3\n6 1\n10\n10 2 5 3 1 2 0 12 4 6 1 4 9 9 17 12 8 6 14 0\n0 0", ...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nAn array is defined to be `odd-h...
[{"input": "[0, 1, 2, 3, 4, 0, -2, -1, -4, -3]", "output": "[false]", "fn_name": "is_odd_heavy"}, {"input": "[-1, 1, -2, 2, -2, -2, -4, 4]", "output": "[false]", "fn_name": "is_odd_heavy"}, {"input": "[1, -1, 2, -2, 3, -3, 0]", "output": "[false]", "fn_name": "is_odd_heavy"}, {"input": "[-3, 2, 1, 3, -1, -2]", "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\nVus the Cossack has two binary s...
[{"type": "stdin_stdout", "input": "10010110100000101100\n11001\n", "output": "10\n"}, {"type": "stdin_stdout", "input": "10010110100000101100\n10011\n", "output": "10\n"}, {"type": "stdin_stdout", "input": "10010110100000101100\n00010\n", "output": "10\n"}, {"type": "stdin_stdout", "input": "10010110100000101100\n0101...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nThere are a total of A + B cats ...
[{"type": "stdin_stdout", "input": "-1 -1 10", "output": "NO\n"}, {"type": "stdin_stdout", "input": "-2 -1 10", "output": "NO\n"}, {"type": "stdin_stdout", "input": "-3 -1 10", "output": "NO\n"}, {"type": "stdin_stdout", "input": "-3 -1 17", "output": "NO\n"}, {"type": "stdin_stdout", "input": "-5 -1 11", "output": "NO...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nColonel has n badges. He wants t...
[{"type": "stdin_stdout", "input": "50\n50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50\n", "output": "1225\n"}, {"type": "stdin_stdout", "input": "50\n50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 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\nWater Country Water Deven has n ...
[{"type": "stdin_stdout", "input": "5 6\n0 2 0\n0 1 0\n2 3 16\n1 3 2\n3 4 5\n0 0 1\n3 3\n0 2 3\n2 0 3\n0 1 12\n0 0", "output": "7\n15\n"}, {"type": "stdin_stdout", "input": "5 6\n0 0 1\n2 2 3\n2 3 12\n0 3 0\n2 4 14\n1 3 4\n3 3\n0 2 3\n1 0 3\n0 1 1\n0 0", "output": "30\n4\n"}, {"type": "stdin_stdout", "input": "5 6\n0 0...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nThe problem set at CODE FESTIVAL...
[{"type": "stdin_stdout", "input": "740", "output": "2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n29\n30\n31\n32\n33\n34\n35\n36\n37\n38\n"}, {"type": "stdin_stdout", "input": "370", "output": "1\n2\n3\n4\n5\n6\n7\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 made it through the moat ...
[{"input": "11", "output": "[\"X X\\n X X\\n X X\\n X X\\n X X\\n X\\n X X\\n X X\\n X X\\n X X\\nX X\\n\"]", "fn_name": "mark_spot"}, {"input": "5", "output": "[\"X X\\n X...
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 kata, you have to define...
[{"input": "[1, 12, 123, 1234, 12345]", "output": "[[2743, \"101010110111\", \"5267\", \"ab7\"]]", "fn_name": "func"}, {"input": "[2, 31, 3, 56, 46, 3, 467, 33]", "output": "[[80, \"1010000\", \"120\", \"50\"]]", "fn_name": "func"}, {"input": "[9, 99, 999, 9999]", "output": "[[2776, \"101011011000\", \"5330\", \"ad8\"]...
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\nVasiliy likes to rest after a ha...
[{"type": "stdin_stdout", "input": "12\n35345 58181 32223 84621 35905 73863 99537 30666 67771 39229 36847 29038\n23\n55052824\n82504840\n35160556\n78141700\n73401989\n86305919\n39430705\n31939373\n23501765\n4406029\n61436920\n14295390\n34275309\n28028753\n91433780\n70158847\n2396455\n66994588\n84024224\n30175981\n34941...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 JOI Railways is the only rai...
[{"type": "stdin_stdout", "input": "10 3 1\n10 6 -1\n10\n-1\n1\n10", "output": "3\n"}, {"type": "stdin_stdout", "input": "10 3 5\n3 2 6\n79\n-1\n13\n10", "output": "11\n"}, {"type": "stdin_stdout", "input": "16 3 10\n10 3 6\n16\n2\n11\n11", "output": "2\n"}, {"type": "stdin_stdout", "input": "10 3 1\n10 6 -1\n51\n-1\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\nNikolay got a string $s$ of even...
[{"type": "stdin_stdout", "input": "8\nbbbabbba\n", "output": "2\nabbaabba\n"}, {"type": "stdin_stdout", "input": "8\nbbabbbaa\n", "output": "3\nabababba\n"}, {"type": "stdin_stdout", "input": "8\nbbbabbba\n", "output": "2\nabbaabba"}, {"type": "stdin_stdout", "input": "8\nbbabbbaa\n", "output": "3\nabababba"}, {"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\nThere are $n$ students and $m$ c...
[{"type": "stdin_stdout", "input": "20 20\n0 0 3 2 1 2 2 3 2 2 1 1 0 3 0 0 1 1 1 3\n15 1 20 13 6 12 16 8 3 14 10 5 18 17 4 9 2 11 7 19\n20\n2\n10\n7\n4\n6\n5\n14\n8\n9\n18\n13\n11\n19\n1\n16\n20\n17\n12\n15\n3\n", "output": "4\n4\n4\n4\n4\n4\n4\n4\n2\n2\n2\n2\n2\n2\n2\n2\n2\n1\n0\n0\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\n# Task\n You know the slogan `p`...
[{"input": "\"dhgusdlifons\"\n\"lifonsssdlifonsgusdlifonssnsdlifonsslifonsifonsdlifonsfonsifons\"", "output": "[13]", "fn_name": "slogans"}, {"input": "\"erjernhxvbqfjsj\"\n\"ernhxvbqfjsjjrnhxvbqfjsjjernhxvbqfjsj\"", "output": "[4]", "fn_name": "slogans"}, {"input": "\"mcoecqwmjdudc\"\n\"dcoecqwmjdudcdcudc\"", "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\nJamie is a programmer, and James...
[{"input": "3", "output": "[\" *\\n***\\n *\\n\"]", "fn_name": "diamond"}, {"input": "-1", "output": "[null]", "fn_name": "diamond"}, {"input": "-2", "output": "[null]", "fn_name": "diamond"}, {"input": "0", "output": "[null]", "fn_name": "diamond"}, {"input": "2", "output": "[null]", "fn_name": "diamond"}]
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 [Ones' Complement](https://e...
[{"input": "\"1101\"", "output": "[\"0010\"]", "fn_name": "ones_complement"}, {"input": "\"01\"", "output": "[\"10\"]", "fn_name": "ones_complement"}, {"input": "\"10\"", "output": "[\"01\"]", "fn_name": "ones_complement"}, {"input": "\"0\"", "output": "[\"1\"]", "fn_name": "ones_complement"}, {"input": "\"1\"", "outpu...
code_functional
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nAnn and Borya have n piles with ...
[{"type": "stdin_stdout", "input": "100\n444272562 25 25 0 49 73291074 64 100 638092144 756033694 0 700405846 16 25 25 100 36 25 269573395 288578186 366853675 36 81 49 4 0 25 49 9 64 0 4 36 36 49 0 64 64 532899768 1 64 9 549673690 25 64 4 817183855 25 146555318 36 495564252 100 49 9 36 100 49 100 4 100 9 64 9 432227412...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 system is transmitting message...
[{"input": "2\n3\n\"11111010001\"", "output": "[\"11111010001\"]", "fn_name": "correct"}, {"input": "2\n3\n\"11011010001\"", "output": "[\"11111010001\"]", "fn_name": "correct"}, {"input": "2\n3\n\"11111011001\"", "output": "[\"11111010001\"]", "fn_name": "correct"}, {"input": "2\n3\n\"11111010011\"", "output": "[\"111...
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 non-empty stri...
[{"type": "stdin_stdout", "input": "10\nakhvjuejwrazexjkmzfersbjnvdvdbrdvuexbdloltpllcnvqtdoooftuhphtdfcveomexsbn\ni\ndgkrbariruzn\njwa\nttbbvxlxjsksrziizcmhhxpntxvmkqvhtqqedhqprzdidcvgfgrbqyhlrpwpisajpwmbszyjntqgaoskvc\nmk\ntwakxsrktfktpkrmrxsruzjvivionieksdngxrhcifxcyzuqfaciojwifrusfrlvikfcqeextlfcudoahqqm\na\nb\nwr\...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 had record hot temperatu...
[{"type": "stdin_stdout", "input": "467 101 10577", "output": "2222\n"}, {"type": "stdin_stdout", "input": "467 100 16500", "output": "3300\n"}, {"type": "stdin_stdout", "input": "467 100 12758", "output": "2600\n"}, {"type": "stdin_stdout", "input": "467 101 12758", "output": "2626\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\nC*++ language is quite similar t...
[{"type": "stdin_stdout", "input": "399\n469*++a-935*++a-838*++a-468*++a+79*++a-89*++a-863*++a+531*a++-523*a++-583*++a-411*++a+301*++a+201*a++-108*a+++581*a+++938*++a-16*a++-632*a+++146*a++-230*++a+151*++a-618*a+++593*a+++320*++a+750*++a+185*a++-68*++a+839*a++-853*a+++761*a++-442*a++-385*a++-487*a++-573*a++-820*a++-123...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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$ warriors in a row....
[{"type": "stdin_stdout", "input": "23 5\n10 3 3\n2 1 4 11 8 10 5 6 7 9 12 3 14 13 16 18 21 15 17 19 20 23 22\n4 6 3 18 23\n", "output": "56\n"}, {"type": "stdin_stdout", "input": "23 5\n10 3 4\n2 1 4 11 8 10 5 6 7 9 12 3 14 13 16 18 21 15 17 19 20 23 22\n4 6 3 18 23\n", "output": "64\n"}, {"type": "stdin_stdout", "inp...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nAlice and Bob are studying for t...
[{"type": "stdin_stdout", "input": "4\n3 0 1\n2 12 2\n22 12 2\n2 20 1", "output": "-1\n3\n-5\n12\n"}, {"type": "stdin_stdout", "input": "4\n3 0 1\n2 19 2\n22 12 2\n2 20 1", "output": "-1\n6\n-5\n12\n"}, {"type": "stdin_stdout", "input": "4\n3 0 1\n2 12 4\n22 12 2\n2 20 1", "output": "-1\n0\n-5\n12\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 drop a ball from a given hei...
[{"input": "100\n0.1", "output": "[2]", "fn_name": "bouncing_ball"}, {"input": "10\n0.1", "output": "[1]", "fn_name": "bouncing_ball"}, {"input": "30\n0.3", "output": "[3]", "fn_name": "bouncing_ball"}, {"input": "2\n0.5", "output": "[1]", "fn_name": "bouncing_ball"}, {"input": "4\n0.5", "output": "[2]", "fn_name": "bo...
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\nCreate a function that returns t...
[{"input": "[5, 78, 52, 900, 1]", "output": "[207]", "fn_name": "average"}, {"input": "[1, 1, 1, 1, 9999]", "output": "[2001]", "fn_name": "average"}, {"input": "[5, 25, 50, 75]", "output": "[39]", "fn_name": "average"}, {"input": "[2]", "output": "[2]", "fn_name": "average"}, {"input": "[0]", "output": "[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\nÆsir - CHAOS Æsir - V.\n\n\"Ever...
[{"type": "stdin_stdout", "input": "87\n1120 1120 1120 872 1120 731 3583 2815 4019 1291 4568 973 1120 1705 1120 822 203 1120 1120 1120 1120 4196 3166 4589 3030 1120 1120 1120 711 1120 500 1120 1120 3551 1120 1120 1120 1700 1120 1120 2319 4554 1120 1312 1120 1120 4176 1120 1120 3661 1120 1120 1120 1120 142 63 4125 1120 ...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 integers written on ...
[{"type": "stdin_stdout", "input": "5\n1 12 6 0 5", "output": "1 0 6 12 5 "}, {"type": "stdin_stdout", "input": "5\n1 12 2 0 5", "output": "1 0 5 2 12 "}, {"type": "stdin_stdout", "input": "5\n1 12 3 0 5", "output": "1 0 5 3 12 "}, {"type": "stdin_stdout", "input": "5\n1 17 3 0 5", "output": "1 0 17 5 3 "}, {"type": "s...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nYou are given n positive integer...
[{"type": "stdin_stdout", "input": "100 4\n94 94 83 27 80 73 61 38 34 95 72 96 59 36 52 15 122 78 39 22 21 57 54 59 9 32 81 64 51 90 67 41 18 58 93 76 44 62 77 61 31 70 39 73 111 57 43 31 27 85 36 26 58 48 35 23 124 53 3 14 40 67 53 19 70 81 98 12 91 15 92 90 89 86 58 30 67 73 72 69 68 47 30 7 89 41 17 97 45 6 4 23 13 ...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 problem takes its name by a...
[{"input": "[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]\n11", "output": "[[11, 22, 33, 44, 5, 17, 29, 41, 3, 16, 30, 43, 7, 21, 36, 50, 15, 32, 48, 14, 34, 1, 20, 39, 9, 28...
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 strings $s$ an...
[{"type": "stdin_stdout", "input": "4\n4\nabcd\nabdc\n5\nababa\nbaaba\n4\nasdf\nasdg\n4\nabcd\nbadc\n", "output": "NO\nYES\nNO\nYES\n"}, {"type": "stdin_stdout", "input": "4\n4\nabcd\nabdc\n5\nababa\nabaab\n4\nasdf\nasdg\n4\nabcd\nbadc\n", "output": "NO\nYES\nNO\nYES\n"}, {"type": "stdin_stdout", "input": "4\n4\ndabb\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\nOnce Vasya played bricks. All th...
[{"type": "stdin_stdout", "input": "20\n-10 17 -4 11\n1 22 -15 6\n-5 12 -9 16\n-9 16 -5 12\n-2 19 -12 9\n-10 17 -4 11\n-8 13 -6 15\n-5 12 -9 16\n-3 18 -11 10\n-1 20 -13 8\n29 9 -12 50\n29 50 -11 10\n29 9 -12 50\n29 50 -10 11\n-14 50 29 7\n-9 12 29 50\n-14 7 29 50\n29 9 -12 50\n-11 10 29 50\n-11 50 29 10\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\nAt the annual family gathering, ...
[{"input": "[46, 86, 33, 29, 87, 47, 28, 12, 1, 4, 78, 92]", "output": "[[1, 92, 91]]", "fn_name": "difference_in_ages"}, {"input": "[12, 76, 49, 37, 29, 17, 3, 65, 84, 38]", "output": "[[3, 84, 81]]", "fn_name": "difference_in_ages"}, {"input": "[62, 0, 3, 77, 88, 102, 26, 44, 55]", "output": "[[0, 102, 102]]", "fn_na...
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 positive integer n let's d...
[{"type": "stdin_stdout", "input": "1000000000000000\n", "output": "500000000000000\n"}, {"type": "stdin_stdout", "input": "999999999999999\n", "output": "-500000000000000\n"}, {"type": "stdin_stdout", "input": "1000000000000000\n", "output": "500000000000000\n"}, {"type": "stdin_stdout", "input": "999999999999999\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\nYour friend who lives in undiscl...
[{"type": "stdin_stdout", "input": "291", "output": "158467928000\n"}, {"type": "stdin_stdout", "input": "188", "output": "1040975000\n"}, {"type": "stdin_stdout", "input": "214", "output": "3701387000\n"}, {"type": "stdin_stdout", "input": "190", "output": "1147676000\n"}, {"type": "stdin_stdout", "input": "143", "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\nPasha is participating in a cont...
[{"type": "stdin_stdout", "input": "44\n750 672 846 969 981 698 380 587 813 587 156 28 446 917 1550 449 142 764 226 1406 349 622 236 782 416 689 113 325 452 265 585 217 707 50 520 712 1869 275 423 123 175 160 415 528\n4\n869 1568\n1353 1354\n1683 1685\n2532 2540\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\nKaren has just arrived at school...
[{"type": "stdin_stdout", "input": "19\n519879446 764655030 680293934 914539062 744988123 317088317 653721289 239862203 605157354 943428394 261437390 821695238 312192823 432992892 547139308 408916833 829654733 223751525 672158759\n", "output": "\n265109293\n"}, {"type": "stdin_stdout", "input": "19\n519879446 764655030...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 rival donut shops....
[{"type": "stdin_stdout", "input": "20\n2 1000000000 1000000000\n2 1000000000 1000000000\n2 1000000000 1000000000\n2 1000000000 1000000000\n2 1000000000 1000000000\n2 1000000000 1000000000\n2 1000000000 1000000000\n2 1000000000 1000000000\n2 1000000000 1000000000\n2 1000000000 1000000000\n2 1000000000 1000000000\n2 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\nThe Smart Beaver from ABBYY got ...
[{"type": "stdin_stdout", "input": "15\n0 2 1 2 1 0 2 0 2 2 2 2 2 0 2\n2 0 1 0 1 1 2 2 0 2 2 0 3 0 1\n3 3 2 2 2 1 2 3 2 3 1 2 3 3 2\n0 3 0 3 3 3 2 1 0 2 3 2 3 3 2\n3 0 0 2 1 2 3 1 1 1 2 2 2 1 0\n1 3 2 3 3 0 3 2 0 3 1 2 3 0 3\n2 2 3 2 0 0 2 3 0 1 2 1 1 2 1\n2 1 3 2 3 3 2 2 2 0 3 3 1 1 3\n0 2 1 3 1 2 0 0 1 0 0 2 0 0 0\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\nLet S(n) denote the number that ...
[{"type": "stdin_stdout", "input": "44649014054971081213608137817466046254652492627741860478258558206397113198232823859870363821007188476405951611069347299689170240023979048198711745011542774268179055311013054073075176122755643483380248999657649211459997766221072399103579977409770898200358240970169892326442892826731631...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 Luba bought a very inte...
[{"type": "stdin_stdout", "input": "100 1000000\n0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 -1 0 -1 0 0 1 0 0 1 -1 -1 0 0 0 0 0 0 0 1 0 0 0 0 0 -1 -1 0 0 1 0 0 0 0 0 0 1 0 0 0 0 0 1 -1 0 0 0 0 0 0 0 0 0 1 1 0 1 1 0 0 1 0 0 0 0 -1 0 0 0\n", "output": "12\n"}, {"type": "stdin_stdout", "input": "100 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\n## Welcome to my (amazing) kata!...
[{"input": "10910111310211511810510411911510910111310711510911410712011512012511610511810111410411511311210512012010511811998100000010010101001010101010101981021121011081011121191041101111061011121041191111061101011191041081071011191121041081071011191211121091041071089810001010010119810111910411110810711210411210111111...
code_functional
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nOne day Alice was cleaning up he...
[{"type": "stdin_stdout", "input": "21\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\nRJ Freight, a Japanese railroad ...
[{"type": "stdin_stdout", "input": "4\n_e\na`ba\nebbf\neddea", "output": "2\n12\n12\n13\n"}, {"type": "stdin_stdout", "input": "4\ne]\na`ba\nebbf\needea", "output": "2\n12\n12\n14\n"}, {"type": "stdin_stdout", "input": "4\n_f\n`db_\nfecf\nhaefg", "output": "2\n12\n12\n18\n"}, {"type": "stdin_stdout", "input": "4\naa\nd...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nValera is a little boy. Yesterda...
[{"type": "stdin_stdout", "input": "15\nrxeeeeeeeeeeeer\nereeeeeeeeeeere\needeeeeeeeeeoee\neeereeeeeeeewee\neeeereeeeebeeee\nqeeeereeejedyee\neeeeeerereeeeee\neeeeeeereeeeeee\neeeeeerereeeeze\neeeeereeereeeee\neeeereeeeegeeee\neeereeeeeeereee\neereeeeeeqeeved\ncreeeeeeceeeere\nreeerneeeeeeeer\n", "output": "NO\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\nVasya and Kolya play a game with...
[{"type": "stdin_stdout", "input": "jkeaagakbifeaechkifkdghcjcgighidcgdccgbdbcackfgaebkddabgijkhjkaffkabacekdkjekeccegbecbkecbgbgcacgdackcdfjefaifgbigahkbedidfhjbikejdhejcgideaeejdcefeeccaefbddejkbdkfagfcdjbikbidfggkidcdcic\n", "output": "0.44919786096256686\n"}, {"type": "stdin_stdout", "input": "jkeaagakbifeaechkifkd...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nConsider the following experimen...
[{"type": "stdin_stdout", "input": "569716410 849619604 5000\n", "output": "122094144\n"}, {"type": "stdin_stdout", "input": "232213466 585535513 4789\n", "output": "454306758\n"}, {"type": "stdin_stdout", "input": "251134010 189925189 5000\n", "output": "103457138\n"}, {"type": "stdin_stdout", "input": "588636954 7308...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 has recently learnt some ne...
[{"type": "stdin_stdout", "input": "3\n3\n6\n82", "output": "3.141\n3.141592\n3.1415926530119026040722614947737296840070086399613316415926530119026040722614947737\n"}, {"type": "stdin_stdout", "input": "3\n3\n5\n82", "output": "3.141\n3.14159\n3.14159265301190260407226149477372968400700863996133164159265301190260407226...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nAlthough Inzane successfully fou...
[{"type": "stdin_stdout", "input": "10\n-1000000000 -1000000000 -1000000000 -1000000000 -1000000000 -1000000000 -1000000000 -1000000000 -1000000000 -1000000000\n10 3\n7 4\n2 6\n9 2\n5 10\n1 8\n7 8\n7 2\n10 6\n", "output": "-999999998\n"}, {"type": "stdin_stdout", "input": "10\n-1000000000 -1000000000 -1000000000 -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\nIn this kata you must take an in...
[{"input": "\"a small lOan OF 1,000,000 $!\"", "output": "[\"$ 000,000,1 FO naOl llams a!\"]", "fn_name": "esrever"}, {"input": "\"b3tTer p4ss thIS 0ne.\"", "output": "[\"en0 SIht ss4p reTt3b.\"]", "fn_name": "esrever"}, {"input": "\"an Easy one?\"", "output": "[\"eno ysaE na?\"]", "fn_name": "esrever"}, {"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\nIn the beginning of the new year...
[{"type": "stdin_stdout", "input": "89946\n", "output": "aabbaabbaabbaabbaabbaabbaabbaabbaabbaabbaabbaabbaabbaabbaabbaabbaabbaabbaabbaabbaabbaabbaabbaabbaabbaabbaabbaabbaabbaabbaabbaabbaabbaabbaabbaabbaabbaabbaabbaabbaabbaabbaabbaabbaabbaabbaabbaabbaabbaabbaabbaabbaabbaabbaabbaabbaabbaabbaabbaabbaabbaabbaabbaabbaabbaab...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 some perfect squares w...
[{"input": "100000\n4", "output": "[298116]", "fn_name": "next_perfectsq_perm"}, {"input": "100\n4", "output": "[81796]", "fn_name": "next_perfectsq_perm"}, {"input": "1000\n3", "output": "[9216]", "fn_name": "next_perfectsq_perm"}, {"input": "100\n2", "output": "[441]", "fn_name": "next_perfectsq_perm"}, {"input": "10...
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 AtCoder Kingdom, Gregorian ca...
[{"type": "stdin_stdout", "input": "-13 438", "output": "-13\n"}, {"type": "stdin_stdout", "input": "-18 766", "output": "-18\n"}, {"type": "stdin_stdout", "input": "-143 0", "output": "-143\n"}, {"type": "stdin_stdout", "input": "-212 0", "output": "-212\n"}, {"type": "stdin_stdout", "input": "-106 5", "output": "-106...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 set of strings S...
[{"type": "stdin_stdout", "input": "10\n0 i\n1 q\n2 g\n0 k\n1 e\n5 r\n4 m\n5 h\n3 o\n3 e\n5\n8 9 1 10 6\n", "output": "2 4 1 3 3\n"}, {"type": "stdin_stdout", "input": "10\n0 i\n1 q\n2 g\n0 k\n1 e\n5 r\n4 m\n4 g\n3 o\n3 e\n5\n8 9 1 10 6\n", "output": "2 4 1 3 2\n"}, {"type": "stdin_stdout", "input": "10\n0 i\n1 q\n2 g\...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 Susie, thanks to her olde...
[{"type": "stdin_stdout", "input": "4\n-1 3 3 3\n6 -1 3 -1\n2 3 -1 3\n3 3 3 -1\n", "output": "0\n\n"}, {"type": "stdin_stdout", "input": "4\n-1 3 3 3\n6 -1 3 -1\n2 1 -1 3\n3 3 3 -1\n", "output": "0\n\n"}, {"type": "stdin_stdout", "input": "4\n-1 3 3 3\n6 -1 3 -1\n2 3 -1 2\n3 3 3 -1\n", "output": "0\n\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\nYou are given a string and a num...
[{"type": "stdin_stdout", "input": "pckoshien\n16", "output": "cehikposn\n"}, {"type": "stdin_stdout", "input": "pckoshien\n30", "output": "cehiknops\n"}, {"type": "stdin_stdout", "input": "pckosiien\n26", "output": "ceiiknops\n"}, {"type": "stdin_stdout", "input": "pckoshien\n14", "output": "cehkopisn\n"}, {"type": "s...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nAfter having drifted about in a ...
[{"type": "stdin_stdout", "input": "2 1 1\n1 1 nn\n2 1 np\n3 2 1\n1 1 yes\n2 2 yes\n3 1 yes\n2 4 1\n1 2 yes\n2 3 no\n5 4 3\n1 2 yes\n1 3 no\n4 5 yes\n5 6 yes\n6 7 no\n0 0 0", "output": "no\n1\n3\nend\n1\n2\n4\n5\nend\n3\n4\n5\n6\nend\n"}, {"type": "stdin_stdout", "input": "2 1 1\n1 1 nn\n2 1 np\n3 2 1\n1 1 yes\n2 2 yes...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nArtem has an array of n positive...
[{"type": "stdin_stdout", "input": "10\n96 106 8 18 36 48 34 11 37 42\n", "output": "305\n"}, {"type": "stdin_stdout", "input": "10\n96 106 8 18 58 48 34 11 37 42\n", "output": "337\n"}, {"type": "stdin_stdout", "input": "10\n96 66 8 18 30 48 34 11 37 42\n", "output": "299\n"}, {"type": "stdin_stdout", "input": "10\n96...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nIn this kata you will create a f...
[{"input": "573", "output": "[false]", "fn_name": "is_prime"}, {"input": "12", "output": "[false]", "fn_name": "is_prime"}, {"input": "571", "output": "[true]", "fn_name": "is_prime"}, {"input": "25", "output": "[false]", "fn_name": "is_prime"}, {"input": "0", "output": "[false]", "fn_name": "is_prime"}, {"input": "1",...
code_functional
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nThe statement of this problem sh...
[{"type": "stdin_stdout", "input": "10\n44317 2 42112 2 19660 2 49\n48930 2 47499 1 27225 2 43\n48392 2 28544 2 34152 2 97\n43473 2 185 2 4950 1 94\n41685 2 38469 1 6333 1 18\n45137 2 29286 1 28293 2 34\n43584 2 41743 1 28092 2 83\n47658 2 33552 2 8862 1 27\n46379 2 4528 2 2818 2 58\n46926 2 14781 1 7952 1 59\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\na is an array of n positive inte...
[{"type": "stdin_stdout", "input": "50\n49 21 50 31 3 19 10 40 20 5 47 12 12 30 5 4 5 2 11 23 5 39 3 30 19 3 23 40 4 14 39 50 45 14 33 37 1 15 43 30 45 23 32 3 9 17 9 5 14 12\n50\n36 29\n44 24\n38 22\n30 43\n15 19\n39 2\n13 8\n29 50\n37 18\n32 19\n42 39\n20 41\n14 11\n4 25\n14 35\n17 23\n1 29\n3 19\n8 6\n26 31\n9 46\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\nJOI has a stove in your room. JO...
[{"type": "stdin_stdout", "input": "2 1\n-10\n31\n0", "output": "42\n"}, {"type": "stdin_stdout", "input": "3 1\n-1\n4\n11", "output": "13\n"}, {"type": "stdin_stdout", "input": "3 1\n-1\n0\n23", "output": "25\n"}, {"type": "stdin_stdout", "input": "3 2\n-2\n6\n21", "output": "10\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\nOri and Sein have overcome many ...
[{"type": "stdin_stdout", "input": "20 7\n18525 35038\n15816 31586\n18641 46864\n35863 38632\n13563 35915\n41614 98684\n13573 35863\n25851 35985\n41687 55831\n31583 80871\n18525 35038\n15816 31586\n18641 46864\n35863 38632\n13563 35915\n41614 98684\n13573 35863\n25851 35985\n41687 55831\n31583 80871\n", "output": "4112...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 the easy version of the pr...
[{"type": "stdin_stdout", "input": "010\n", "output": "153616455\n"}, {"type": "stdin_stdout", "input": "011\n", "output": "217549120\n"}, {"type": "stdin_stdout", "input": "60\n", "output": "937481864\n"}, {"type": "stdin_stdout", "input": "50\n", "output": "902552662\n"}, {"type": "stdin_stdout", "input": "59\n", "ou...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nWhat are you doing at the end of...
[{"type": "stdin_stdout", "input": "10\n100000 873326525630182716\n100000 620513733919162415\n100000 482953375281256917\n100000 485328193417229962\n100000 353549227094721271\n100000 367447590857326107\n100000 627193846053528323\n100000 243833127760837417\n100000 287297493528203749\n100000 70867563577617188\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\nThis is an interactive problem.\...
[{"type": "stdin_stdout", "input": "100\n103\n130\n138\n126\n157\n164\n185\n120\n109\n137\n123\n147\n124\n178\n183\n155\n146\n169\n156\n153\n196\n152\n145\n110\n184\n168\n170\n177\n190\n128\n108\n182\n102\n101\n159\n150\n117\n106\n187\n194\n167\n151\n171\n195\n127\n115\n192\n114\n125\n165\n118\n113\n189\n199\n180\n139\...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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[Generala](https://en.wikipedia....
[{"input": "\"55555\"", "output": "[50]", "fn_name": "points"}, {"input": "\"44444\"", "output": "[50]", "fn_name": "points"}, {"input": "\"44441\"", "output": "[40]", "fn_name": "points"}, {"input": "\"33233\"", "output": "[40]", "fn_name": "points"}, {"input": "\"22262\"", "output": "[40]", "fn_name": "points"}, {"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\nArtem has an array of n positive...
[{"type": "stdin_stdout", "input": "10\n96 66 8 18 30 48 34 11 37 42\n", "output": " 299\n"}, {"type": "stdin_stdout", "input": "9\n72 49 39 50 68 35 75 94 56\n", "output": " 435\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\nAlice and Brown are brothers in ...
[{"type": "stdin_stdout", "input": "1001 20263", "output": "10632\n"}, {"type": "stdin_stdout", "input": "1011 20263", "output": "10637\n"}, {"type": "stdin_stdout", "input": "0010 12073", "output": "6041\n"}, {"type": "stdin_stdout", "input": "0000 12073", "output": "6036\n"}, {"type": "stdin_stdout", "input": "0001 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\n# Task\n You are given a car odo...
[{"input": "165826622", "output": "[69517865]", "fn_name": "faulty_odometer"}, {"input": "999999", "output": "[531440]", "fn_name": "faulty_odometer"}, {"input": "2005", "output": "[1462]", "fn_name": "faulty_odometer"}, {"input": "1500", "output": "[1053]", "fn_name": "faulty_odometer"}, {"input": "13", "output": "[12...
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\nIt's one more school day now. Sa...
[{"type": "stdin_stdout", "input": "251656215122324104 164397544865601257\n", "output": "YES\n"}, {"type": "stdin_stdout", "input": "669038685745448997 501718093668307460\n", "output": "YES\n"}, {"type": "stdin_stdout", "input": "255787422422806632 146884995820359999\n", "output": "YES\n"}, {"type": "stdin_stdout", "in...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nGrigory has $n$ magic stones, co...
[{"type": "stdin_stdout", "input": "10\n62159435 282618243 791521863 214307200 976959598 590907019 166397456 708291256 85377387 569889619\n296371399 546807332 272720717 689420404 273026579 74510326 749070707 104458586 450770185 466655231\n", "output": "No\n"}, {"type": "stdin_stdout", "input": "10\n62159435 282618243 7...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nIn this Kata, you will be given ...
[{"input": "\"acefacefacef\"", "output": "[\"a\"]", "fn_name": "solve"}, {"input": "\"efghijefghi\"", "output": "[\"e\"]", "fn_name": "solve"}, {"input": "\"dcbadcba\"", "output": "[\"a\"]", "fn_name": "solve"}, {"input": "\"acefacef\"", "output": "[\"a\"]", "fn_name": "solve"}, {"input": "\"axyzxyz\"", "output": "[\"x...
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 likes giving presents...
[{"type": "stdin_stdout", "input": "7 1\n1 7\n", "output": " 0\n 7 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\nHow many hours do we have until ...
[{"type": "stdin_stdout", "input": "182", "output": "-134\n"}, {"type": "stdin_stdout", "input": "339", "output": "-291\n"}, {"type": "stdin_stdout", "input": "-117", "output": "165\n"}, {"type": "stdin_stdout", "input": "467", "output": "-419\n"}, {"type": "stdin_stdout", "input": "-155", "output": "203\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\nProgrammers' kids solve this rid...
[{"type": "stdin_stdout", "input": "1215860145\n", "output": "10\n"}, {"type": "stdin_stdout", "input": "2000000000\n", "output": "4\n"}, {"type": "stdin_stdout", "input": "143165576\n", "output": "14\n"}, {"type": "stdin_stdout", "input": "1919020031\n", "output": "3\n"}, {"type": "stdin_stdout", "input": "1795248373\...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 tree consisting ...
[{"type": "stdin_stdout", "input": "15\n10 34 69 39 82 49 57 22 50 25 82 37 33 62 69\n35 14 68 31 26 8 33 98 33 95 19 22 89 18 67\n80 24 10 5 26 85 69 21 29 38 89 24 78 68 88\n13 1\n6 12\n8 4\n11 9\n14 11\n15 5\n3 15\n1 10\n13 9\n7 12\n14 6\n3 2\n2 7\n4 5\n", "output": "620\n2 3 2 2 3 3 1 1 3 3 2 2 1 1 1 \n"}, {"type":...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nTakahashi and Aoki will play a g...
[{"type": "stdin_stdout", "input": "10 10 14\n4 3\n2 2\n9 4\n9 10\n7 7\n10 2\n10 10\n5 4\n3 4\n2 8\n6 4\n5 4\n5 8\n9 0", "output": "8\n"}, {"type": "stdin_stdout", "input": "10 10 14\n4 3\n2 1\n7 3\n9 10\n7 7\n8 1\n10 10\n5 4\n2 4\n2 8\n6 4\n4 4\n9 6\n9 -1", "output": "1\n"}, {"type": "stdin_stdout", "input": "10 10 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\nWhile swimming at the beach, Mik...
[{"type": "stdin_stdout", "input": "9\n123456789\n", "output": "YES\n"}, {"type": "stdin_stdout", "input": "9\n103481226\n", "output": "YES\n"}, {"type": "stdin_stdout", "input": "9\n246112056\n", "output": "YES\n"}, {"type": "stdin_stdout", "input": "9\n289887167\n", "output": "YES\n"}, {"type": "stdin_stdout", "input...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nGerald got a very curious hexago...
[{"type": "stdin_stdout", "input": "1000 1000 1000 1000 1000 1000\n", "output": "6000000\n"}, {"type": "stdin_stdout", "input": "718 466 729 470 714 481\n", "output": "2102808\n"}, {"type": "stdin_stdout", "input": "677 303 685 288 692 296\n", "output": "1365807\n"}, {"type": "stdin_stdout", "input": "1000 1000 1 1000 ...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nLimak is a little polar bear. He...
[{"type": "stdin_stdout", "input": "1000000000000000\n", "output": "18 999999993541753\n"}, {"type": "stdin_stdout", "input": "1000000000000000\n", "output": "18 999999993541753\n"}, {"type": "stdin_stdout", "input": "1000000000000000\n", "output": "18 999999993541753\n"}, {"type": "stdin_stdout", "input": "99999999370...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nThe only difference between easy...
[{"type": "stdin_stdout", "input": "6\n8\n1 1 2 10 3 2 1 1\n3\n2 4 3\n4\n2 10 11 1\n1\n26\n2\n1 1\n3\n2 1 1\n", "output": "6\n1\n1\n1\n2\n2\n"}, {"type": "stdin_stdout", "input": "6\n8\n1 1 2 2 3 2 1 1\n3\n1 3 3\n4\n1 10 10 1\n1\n26\n2\n2 1\n3\n1 1 1\n", "output": "7\n2\n4\n1\n1\n3\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\nRead problems statements in Mand...
[{"type": "stdin_stdout", "input": "6\n24 60\n34 50\n10 11\n10 12\n11 11\n1 2", "output": "19\n20\n10\n11\n10\n1\n"}, {"type": "stdin_stdout", "input": "6\n24 60\n34 50\n10 11\n10 12\n13 11\n1 2", "output": "19\n20\n10\n11\n11\n1\n"}, {"type": "stdin_stdout", "input": "6\n24 60\n34 50\n10 11\n15 12\n11 11\n1 1", "outpu...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\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\nLittle Elephant likes lemonade.\...
[{"type": "stdin_stdout", "input": "2\n3 3\n0 2 0\n3 1 2 3\n1 11\n2 4 13\n4 7\n0 2 2 0 1 0 0\n1 14\n3 9 4 5\n7 1 2 3 4 5 6 7\n1 2", "output": "18\n36\n"}, {"type": "stdin_stdout", "input": "2\n3 3\n0 2 0\n3 1 2 3\n1 11\n2 4 13\n4 7\n0 2 2 0 1 0 0\n1 19\n3 9 4 5\n7 1 2 3 4 5 6 7\n1 2", "output": "18\n41\n"}, {"type": "s...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nProfessor Phunsuk Wangdu has per...
[{"type": "stdin_stdout", "input": "45\n45 44 40 43 27 29 41 39 30 34 28 26 25 42 38 19 32 24 9 37 23 21 20 18 33 36 16 22 35 17 7 4 15 31 13 11 2 3 10 12 14 6 8 5 1\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\n", "output": "22\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\nYou are given two integers $n$ a...
[{"type": "stdin_stdout", "input": "1000 10\n", "output": "414070642\n"}, {"type": "stdin_stdout", "input": "1000 10\n", "output": "414070642\n"}, {"type": "stdin_stdout", "input": "1000 2\n", "output": "917124963\n"}, {"type": "stdin_stdout", "input": "1000 2\n", "output": "917124963\n"}, {"type": "stdin_stdout", "inp...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nThere are $n$ points on the plan...
[{"type": "stdin_stdout", "input": "10\n100 34\n27 17\n17 73\n12 60\n53 25\n46 31\n61 86\n22 91\n82 91\n8 41\n", "output": "173\n"}, {"type": "stdin_stdout", "input": "10\n100 34\n27 17\n17 73\n12 60\n53 25\n46 31\n51 86\n22 91\n82 91\n8 41\n", "output": "173\n"}, {"type": "stdin_stdout", "input": "10\n110 34\n27 17\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\nA super computer has been built ...
[{"type": "stdin_stdout", "input": "100 1 1\n0\n\n1\n\n1\n\n1\n\n0\n\n0\n\n0\n\n1\n\n1\n\n0\n\n0\n\n1\n\n0\n\n1\n\n1\n\n1\n\n1\n\n0\n\n0\n\n1\n\n1\n\n1\n\n0\n\n0\n\n0\n\n0\n\n0\n\n1\n\n1\n\n0\n\n1\n\n1\n\n1\n\n0\n\n1\n\n0\n\n0\n\n1\n\n0\n\n1\n\n1\n\n0\n\n0\n\n0\n\n0\n\n1\n\n0\n\n1\n\n0\n\n0\n\n1\n\n1\n\n1\n\n0\n\n1\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\nOnce upon a time there were seve...
[{"type": "stdin_stdout", "input": "10 10\n..P..WWP.W\nPP.WPPPPPP\nWWPP.PPWPP\nPPPPW..PPW\nPP.PW.P.PW\nWW..PPWWP.\n..PW...PP.\n.PPPP.PPPW\nPP.PWP..P.\nPWPPP..WWP\n", "output": "20\n"}, {"type": "stdin_stdout", "input": "10 10\nWPPPPWPPWP\nPPPWPPPPPP\nPWPPPPWPPP\nPPPPWPPPWP\nWPPPPPPPPP\nPPPWPPWPPP\nPWPPPPPPWP\nPPPPWPPPP...
code_stdio