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\nYou are given a permutation P_1 ...
[{"type": "stdin_stdout", "input": "8 2\n4 5 7 8 3 1 2 6", "output": "1\n2\n3\n6\n5\n4\n7\n8\n"}, {"type": "stdin_stdout", "input": "8 6\n4 5 7 8 3 1 2 6", "output": "4\n5\n7\n8\n3\n1\n2\n6\n"}, {"type": "stdin_stdout", "input": "8 5\n4 5 7 8 3 1 2 6", "output": "4\n5\n6\n8\n3\n1\n2\n7\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\nIahub has drawn a set of n point...
[{"type": "stdin_stdout", "input": "50\n-768 -243\n-741 -984\n-370 213\n-808 571\n-726 442\n234 452\n-105 -990\n-876 -278\n987 473\n-968 -531\n-274 -842\n259 -655\n-59 -555\n976 -396\n878 -85\n551 213\n675 599\n-990 -507\n1 48\n-147 919\n-218 798\n-191 928\n916 263\n-975 169\n567 -967\n394 16\n-224 915\n280 -613\n804 -...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nBob is a competitive programmer....
[{"type": "stdin_stdout", "input": "15\n5318008\n379009\n06\n79153975193751375917591379919397337913333535330\n791539751937513759175913799193973379133301353533\n123456789023487138475693874561834576138495713485673485364857638475673465873457346581495713641\n7915397519375137511917591379919397337913333535330\n31553555535353...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 will retur...
[{"input": "{\"name\": \"John\", \"age\": 32}", "output": "[\"dict\"]", "fn_name": "types"}, {"input": "\"Hello World!\"", "output": "[\"str\"]", "fn_name": "types"}, {"input": "[1, 2, 3, 4]", "output": "[\"list\"]", "fn_name": "types"}, {"input": "null", "output": "[\"NoneType\"]", "fn_name": "types"}, {"input": "3.14...
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 is known that there are k fis...
[{"type": "stdin_stdout", "input": "100 50 10\n7 8 7 1 6 7 9 2 4 6 7 7 3 9 4 5 1 7 8 10 4 1 3 6 8 10 4 6 6 1 6 12 7 4 10 3 10 1 3 2 10 6 9 9 5 2 9 2 9 8 10 2 10 3 3 2 3 8 6 2 7 10 7 2 7 2 8 9 6 2 5 4 4 5 3 3 9 10 9 4 9 3 9 5 3 6 6 1 3 6 10 3 10 2 6 10 10 10 4 8\n3 3 2 9 4 4 10 2 7 3 3 2 6 3 3 4 7 4 1 2 3 8 1 6 7 7 2 10...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nThe only difference between easy...
[{"type": "stdin_stdout", "input": "50 50\n1 -9 8 -9 5 -4 -4 3 -2 -1 3 -8 -6 -6 2 -5 -1 -2 -5 10 2 0 10 10 5 -3 12 -1 -9 9 -10 4 7 0 -6 0 -1 4 8 0 -3 -8 10 10 6 6 -3 -5 -3 -8\n28 41\n28 49\n49 49\n6 38\n22 30\n50 50\n41 45\n30 32\n17 44\n24 25\n27 39\n17 39\n50 50\n10 14\n11 12\n18 28\n11 20\n36 42\n45 49\n29 36\n32 44...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nPolycarpus is a system administr...
[{"type": "stdin_stdout", "input": "14\n1 7 3\n1 0 10\n1 7 3\n1 1 9\n2 2 8\n2 0 10\n1 1 9\n2 8 2\n2 6 4\n1 3 7\n1 3 7\n2 6 4\n2 1 9\n2 7 3\n", "output": "DEAD\nDEAD\n"}, {"type": "stdin_stdout", "input": "14\n1 7 3\n1 0 10\n1 7 3\n1 1 9\n2 2 8\n2 0 10\n1 1 9\n2 8 2\n2 6 4\n1 3 7\n1 3 7\n2 6 4\n2 1 9\n2 7 3\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\n*This kata is inspired by [Proje...
[{"input": "1000\n2000", "output": "[[1000, 1002, 1008, 1020, 1026, 1080, 1088, 1200, 1204, 1206, 1260, 1800, 2000]]", "fn_name": "rthn_between"}, {"input": "30\n100", "output": "[[30, 36, 40, 42, 45, 48, 50, 54, 60, 63, 70, 72, 80, 81, 84, 90, 100]]", "fn_name": "rthn_between"}, {"input": "9000002182976\n9000195371842...
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\nA graph is given in w...
[{"type": "stdin_stdout", "input": "6\n1 2\n2 3\n3 4\n3 5\n5 6", "output": "6\n7\n8\n7\n7\n6\n"}, {"type": "stdin_stdout", "input": "6\n1 2\n2 3\n6 4\n3 5\n5 6", "output": "5\n6\n7\n5\n7\n6\n"}, {"type": "stdin_stdout", "input": "6\n1 2\n2 3\n6 4\n3 4\n5 6", "output": "5\n6\n7\n7\n5\n6\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\nGiven an array, return the rever...
[{"input": "[2, 4, 6, 8, 10, 12, 14, 16]\n3", "output": "[[6, 4, 2, 12, 10, 8, 16, 14]]", "fn_name": "sel_reverse"}, {"input": "[2, 4, 6, 8, 10, 12, 14, 16]\n2", "output": "[[4, 2, 8, 6, 12, 10, 16, 14]]", "fn_name": "sel_reverse"}, {"input": "[1, 2, 3, 4, 5, 6]\n10", "output": "[[6, 5, 4, 3, 2, 1]]", "fn_name": "sel_r...
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 will be given ...
[{"input": "\"abcefghijklmnopqrstuvwxyz\"\n0\n20", "output": "[\"vutsrqponmlkjihgfecbawxyz\"]", "fn_name": "solve"}, {"input": "\"abcefghijklmnopqrstuvwxyz\"\n5\n20", "output": "[\"abcefvutsrqponmlkjihgwxyz\"]", "fn_name": "solve"}, {"input": "\"FunctionalProgramming\"\n2\n15", "output": "[\"FuargorPlanoitcnmming\"]", ...
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've got table a, consisting o...
[{"type": "stdin_stdout", "input": "4\n40 40 24 5\n56 14 59 76 92 34 43 96 33 44 72 37 81 27 42 5 7 95 22 4 60 18 61 103 74 84 93 55 3 62 70 82 77 51 86 102 29 67 91 9\n71 53 21 64 17 45 46 101 97 30 109 100 57 16 80 87 28 12 94 23 39 98 32 52 54 10 19 41 90 11 66 65 99 89 40 36 58 20 78 108\n35 88 73 75 104 63 79 31 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\nPermutation p is an ordered set ...
[{"type": "stdin_stdout", "input": "1000 500\n", "output": "979041279\n"}, {"type": "stdin_stdout", "input": "1000 700\n", "output": "642759746\n"}, {"type": "stdin_stdout", "input": "1000 900\n", "output": "301804159\n"}, {"type": "stdin_stdout", "input": "1000 998\n", "output": "583666213\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\nIkta loves fast programs. Recent...
[{"type": "stdin_stdout", "input": "001", "output": "2\n"}, {"type": "stdin_stdout", "input": "000", "output": "1\n"}, {"type": "stdin_stdout", "input": "178", "output": "0\n"}, {"type": "stdin_stdout", "input": "209", "output": "0\n"}, {"type": "stdin_stdout", "input": "375", "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\nTokitsukaze and CSL are playing ...
[{"type": "stdin_stdout", "input": "14\n9 9 1000 2000 39999 48888 16 32 123456 959658 111 987584 125632 125468\n", "output": "sjfnb\n"}, {"type": "stdin_stdout", "input": "14\n9 9 1000 2000 39999 48888 16 32 123456 959658 111 987584 125632 125477\n", "output": "cslnb\n"}, {"type": "stdin_stdout", "input": "14\n9 9 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\nThe marmots need to prepare k pr...
[{"type": "stdin_stdout", "input": "13 13\n93 19 58 34 96 7 35 46 60 5 36 40 41\n57 3 42 68 26 85 25 45 50 21 60 23 79\n", "output": "1154\n"}, {"type": "stdin_stdout", "input": "13 13\n93 19 58 34 96 7 35 46 60 5 66 40 41\n57 3 42 68 26 85 25 45 50 21 60 23 79\n", "output": "1184\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\nPetr has just bought a new car. ...
[{"type": "stdin_stdout", "input": "15\n168\n168\n168\n168\n168\n168\n168\n168\n168\n168\n168\n168\n168\n168\n168\n", "output": "YES\n"}, {"type": "stdin_stdout", "input": "15\n168\n168\n168\n168\n168\n168\n168\n168\n168\n168\n168\n168\n168\n168\n168\n", "output": "YES\n"}, {"type": "stdin_stdout", "input": "15\n180\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\nXenia the beginner programmer ha...
[{"type": "stdin_stdout", "input": "2 10\n47 17 22 0\n2 15\n2 42\n1 9\n3 13\n3 28\n1 20\n1 13\n1 50\n2 20\n2 12\n", "output": "57\n57\n61\n38\n55\n34\n51\n38\n42\n34\n"}, {"type": "stdin_stdout", "input": "2 10\n47 17 22 0\n4 15\n2 42\n1 9\n3 13\n3 28\n1 20\n1 13\n1 50\n2 20\n2 12\n", "output": "32\n48\n52\n36\n52\n33\...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 March and you just can't se...
[{"input": "\"logger?]?system...12.12.133333 at [12-32-1432-16]\"", "output": "[[\"12-32-1432-16\"]]", "fn_name": "bracket_buster"}, {"input": "\"Big [L][e][B][r][o][n]!][[\"", "output": "[[\"L\", \"e\", \"B\", \"r\", \"o\", \"n\"]]", "fn_name": "bracket_buster"}, {"input": "\"[][]]]][[[[[[][]\"", "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\nLet's define a function $f(x)$ (...
[{"type": "stdin_stdout", "input": "100\n1\n2\n3\n4\n5\n4\n7\n8\n9\n10\n11\n12\n13\n17\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n17\n28\n29\n30\n31\n32\n31\n34\n35\n36\n27\n38\n39\n40\n41\n42\n43\n44\n45\n46\n47\n48\n49\n50\n51\n52\n29\n54\n100\n56\n57\n58\n59\n109\n61\n62\n63\n120\n65\n66\n67\n68\n69\n70\n71\n7...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 graph with $3 \\...
[{"type": "stdin_stdout", "input": "1\n5 39\n1 2\n3 4\n5 6\n7 8\n1 9\n3 10\n3 11\n5 12\n5 13\n7 14\n7 15\n9 2\n10 2\n11 2\n12 2\n13 2\n14 2\n15 2\n9 4\n10 4\n11 4\n12 4\n13 4\n14 4\n15 4\n9 6\n10 6\n11 6\n12 6\n13 6\n14 6\n15 6\n9 8\n10 8\n11 8\n12 8\n13 8\n14 8\n15 8\n", "output": "IndSet\n9 10 11 12 13 \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 playing another computer...
[{"type": "stdin_stdout", "input": "10\n8\n7 4\n9 10\n4 8\n3 1\n1 7\n9 5\n1 4\n2 5\n8\n9 8\n4 7\n7 7\n3 6\n14 9\n2 5\n4 9\n2 8\n7\n2 2\n2 7\n2 10\n8 6\n1 4\n2 6\n3 10\n4\n4 10\n7 5\n6 10\n9 5\n7\n8 9\n8 1\n3 4\n5 1\n3 10\n9 3\n5 5\n5\n6 1\n7 3\n6 5\n6 1\n1 8\n2\n7 8\n7 10\n4\n6 8\n9 3\n8 1\n9 7\n4\n13 7\n5 7\n10 10\n8 ...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nSergey is testing a next-generat...
[{"type": "stdin_stdout", "input": "100\n1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111\n", "output": "100\n"}, {"type": "stdin_stdout", "input": "100\n1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111\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\nVasilisa the Wise from a far awa...
[{"type": "stdin_stdout", "input": "RRYOGB\n", "output": "15\n"}, {"type": "stdin_stdout", "input": "YROVBG\n", "output": "30\n"}, {"type": "stdin_stdout", "input": "RYGOBG\n", "output": "15\n"}, {"type": "stdin_stdout", "input": "VOBYGO\n", "output": "15\n"}, {"type": "stdin_stdout", "input": "GRBYVO\n", "output": "30...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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## Description:\n\n Remove all e...
[{"input": "\"Hi! Hi!\"", "output": "[\"Hi Hi\"]", "fn_name": "remove"}, {"input": "\"Hi!!!\"", "output": "[\"Hi\"]", "fn_name": "remove"}, {"input": "\"!Hi!\"", "output": "[\"!Hi\"]", "fn_name": "remove"}, {"input": "\"!Hi\"", "output": "[\"!Hi\"]", "fn_name": "remove"}, {"input": "\"Hi!\"", "output": "[\"Hi\"]", "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\nYou are required to create a sim...
[{"input": "\":\"\n\",\"\n\"+\"", "output": "[\"unknown value\"]", "fn_name": "calculator"}, {"input": "6\n\"$\"\n\"+\"", "output": "[\"unknown value\"]", "fn_name": "calculator"}, {"input": "\"a\"\n3\n\"+\"", "output": "[\"unknown value\"]", "fn_name": "calculator"}, {"input": "4\n3\n\"\\\\\"", "output": "[\"unknown v...
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 (or list or vecto...
[{"input": "[[3, 2, 1, 0], [4, 6, 5, 3, 2], [9, 8, 7, 4]]", "output": "[16]", "fn_name": "elements_sum"}, {"input": "[[3, 2, 1, 0], [4, 6, 5, 3, 2], []]\n5", "output": "[12]", "fn_name": "elements_sum"}, {"input": "[[3], [4, 6, 5, 3, 2], [9, 8, 7, 4]]", "output": "[15]", "fn_name": "elements_sum"}, {"input": "[[3, 2, 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\n## Task\nIn this kata you'll be ...
[{"input": "\"threesevensevensixninenineninefiveeighttwofiveeightsixthreeeight\"", "output": "[\"three seven seven six nine nine nine five eight two five eight six three eight\"]", "fn_name": "uncollapse"}, {"input": "\"fivethreefivesixthreenineonesevenoneeight\"", "output": "[\"five three five six three nine one seven...
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 nearby pie shop is having a sp...
[{"type": "stdin_stdout", "input": "50\n4 2 6 7 2 6 3 8 8 2 4 8 4 4 1 4 5 2 2 5 6 4 3 3 3 6 8 2 1 3 1 8 2 3 7 4 7 5 4 8 3 5 7 8 6 7 5 8 7 1\n", "output": "130\n"}, {"type": "stdin_stdout", "input": "50\n4 2 6 7 2 6 3 8 8 2 4 8 4 4 1 3 5 2 2 5 6 4 3 3 3 6 8 2 1 3 1 8 2 3 7 4 7 5 4 8 3 5 7 8 6 7 5 8 7 1\n", "output": "12...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nYou are given two strings $s$ an...
[{"type": "stdin_stdout", "input": "24288\naa\nbc\n", "output": "YES\nacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacbacba...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nIahub likes chess very much. He ...
[{"type": "stdin_stdout", "input": "155\n", "output": "12013\nC.C.C.C.C.C.C.C.C.C.C.C.C.C.C.C.C.C.C.C.C.C.C.C.C.C.C.C.C.C.C.C.C.C.C.C.C.C.C.C.C.C.C.C.C.C.C.C.C.C.C.C.C.C.C.C.C.C.C.C.C.C.C.C.C.C.C.C.C.C.C.C.C.C.C.C.C.C\n.C.C.C.C.C.C.C.C.C.C.C.C.C.C.C.C.C.C.C.C.C.C.C.C.C.C.C.C.C.C.C.C.C.C.C.C.C.C.C.C.C.C.C.C.C.C.C.C.C.C....
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nAlgorithmic predicament - Bug Fi...
[{"input": "[{\"name\": \"kay\", \"age\": 1}, {\"name\": \"john\", \"age\": 130}, {\"name\": \"kay\", \"age\": 130}]\n[{\"name\": \"john\", \"age\": 1}, {\"name\": \"alice\", \"age\": 76}]", "output": "[\"john\"]", "fn_name": "highest_age"}, {"input": "[{\"name\": \"kay\", \"age\": 1}, {\"name\": \"john\", \"age\": 13}...
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\nAnna is a girl so brave that she...
[{"type": "stdin_stdout", "input": "6\n2 2 1 2\n0 100 0 1\n12 13 25 1\n27 83 14 25\n0 0 1 0\n1000000000000000000 1000000000000000000 1000000000000000000 1000000000000000000\n", "output": "Yes\nNo\nNo\nYes\nNo\nYes\n"}, {"type": "stdin_stdout", "input": "6\n2 2 1 2\n0 100 0 1\n11 13 25 1\n27 83 14 25\n0 0 1 0\n100000000...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nFirst-rate specialists graduate ...
[{"type": "stdin_stdout", "input": "prntaxhysjfcfmrjngdsitlguahtpnwgbaxptubgpwcfxqehrulbxfcjssgocqncscduvyvarvwxzvmjoatnqfsvsilubexmwugedtzavyamqjqtkxzuslielibjnvkpvyrbndehsqcaqzcrmomqqwskwcypgqoawxdutnxmeivnfpzwvxiyscbfnloqjhjacsfnkfmbhgzpujrqdbaemjsqphokkiplblbflvadcyykcqrdohfasstobwrobslaofbasylwiizrpozvhtwyxtzl\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\nMr. Chanek The Ninja is one day ...
[{"type": "stdin_stdout", "input": "20 17 998\n1000 1000 295133\n1 1000 322998\n31 1 412809\n1 457 347941\n1000 579 600207\n1 708 315587\n1 159 302269\n1000 447 1582128\n247 1 591835\n933 1 16036\n140 1 305582\n1 1 147502\n1000 1 631288\n216 1000 145614\n402 1000 875933\n594 1000 874200\n1000 963 839096\n1 865 156116\n...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nGiven is an integer N. Find the ...
[{"type": "stdin_stdout", "input": "150916391", "output": "67547447\n"}, {"type": "stdin_stdout", "input": "116446379", "output": "20549361\n"}, {"type": "stdin_stdout", "input": "39730771", "output": "39730770\n"}, {"type": "stdin_stdout", "input": "71266519", "output": "17269679\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\nBishwock is a chess figure that ...
[{"type": "stdin_stdout", "input": "0000000000000000000000000000000000000000000000000000000000X0000000000000000000000000000000000000X000\n0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000\n", "output": "66\n"}, {"type": "stdin_stdout", "input": "0000X00X000000X0000X00X...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 love calculat...
[{"type": "stdin_stdout", "input": "10 10 14\n1100110011\n1011001101", "output": "100001000000000010001000\n100001000000000000100010\n"}, {"type": "stdin_stdout", "input": "10 10 14\n1110110011\n1011001101", "output": "100001000000000100001000\n100001000000000000100010\n"}, {"type": "stdin_stdout", "input": "10 10 14\n...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nThere are many caves deep in mou...
[{"type": "stdin_stdout", "input": "3\n1 0\n0 1\n-2 0\n1 0\n0 8\n-1 0\n0 -1\n5 0\n0 1\n0 -4\n1 0\n0 -5\n-3 0\n0 3\n2 0\n-1 -1\n-2 1\n0 1\n0 -1\n1 0\n0 2\n-2 -1\n0 -3\n3 1\n-1 0\n-4 0\n0 0\n-2 0\n1 0\n0 0\n-3 0\n0 0\n2 0\n0 1\n-1 0\n-1 1\n-1 0\n0 -2\n0 0", "output": "4 9\n-2 0\n-3 0\n"}, {"type": "stdin_stdout", "input"...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nAnton is growing a tree in his g...
[{"type": "stdin_stdout", "input": "42\n1 0 0 1 0 1 1 0 1 1 1 1 0 1 0 0 0 1 1 1 0 1 1 1 0 1 0 0 0 0 0 0 1 0 0 0 0 0 0 1 0 0\n35 6\n35 39\n4 31\n31 5\n14 35\n1 2\n40 32\n35 31\n37 35\n32 38\n1 36\n3 25\n35 11\n26 35\n24 35\n3 2\n35 23\n21 1\n20 27\n16 26\n2 18\n34 39\n39 28\n3 32\n26 30\n41 7\n13 35\n1 8\n31 22\n33 21\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\nThis is the hard version of the ...
[{"type": "stdin_stdout", "input": "5\n2 2\n10\n11\n3 3\n011\n101\n010\n4 4\n1111\n0110\n0110\n1111\n5 5\n01011\n11001\n00010\n11011\n10000\n2 3\n011\n101\n", "output": "1\n1 1 2 1 2 2 \n5\n1 2 1 3 2 2 \n2 1 2 2 3 2 \n2 2 3 2 2 3 \n2 2 2 3 3 3 \n3 2 2 3 3 3 \n8\n1 1 1 2 2 1 \n1 3 1 4 2 3 \n2 1 2 2 3 1 \n3 1 4 1 3 2 \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\nI conducted an exit poll of the ...
[{"type": "stdin_stdout", "input": "6\n23426\n5600\n33800\n0\n26495\n52000", "output": "23553\n"}, {"type": "stdin_stdout", "input": "6\n23426\n5600\n33800\n0\n17519\n52000", "output": "22057\n"}, {"type": "stdin_stdout", "input": "6\n23426\n5600\n33800\n0\n14222\n52000", "output": "21508\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\nDescription\n\nIn English we oft...
[{"input": "\"This, is. another! test? case to check your beautiful code.\"", "output": "[\"Thiserr, iserr. anothererr! testerr? case to checkerr yourerr beautifulerr code.\"]", "fn_name": "err_bob"}, {"input": "\"Punctuation? is, important! double space also\"", "output": "[\"Punctuationerr? iserr, importanterr! dou...
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\nKizahashi, who was appointed as ...
[{"type": "stdin_stdout", "input": "30\n384 8895\n1725 9791\n170 1024\n4 11105\n2 6\n578 1815\n702 3352\n143 5141\n1420 6980\n24 1602\n849 999\n76 7586\n85 5570\n444 4991\n719 11090\n470 10708\n1137 4547\n455 9003\n110 9901\n15 8578\n368 3692\n104 1286\n3 4\n366 12143\n7 6649\n610 2374\n152 7324\n4 7042\n292 11386\n334...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 number 81 has a special prop...
[{"input": "6", "output": "[17576]", "fn_name": "power_sumDigTerm"}, {"input": "7", "output": "[19683]", "fn_name": "power_sumDigTerm"}, {"input": "3", "output": "[2401]", "fn_name": "power_sumDigTerm"}, {"input": "4", "output": "[4913]", "fn_name": "power_sumDigTerm"}, {"input": "5", "output": "[5832]", "fn_name": "po...
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 permutation of size $n$ is an ...
[{"type": "stdin_stdout", "input": "69\n-1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -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\nSummer vacation ended at last an...
[{"type": "stdin_stdout", "input": "5 5 5\n3\n2\n11\n16\n18", "output": "5\n"}, {"type": "stdin_stdout", "input": "5 5 5\n3\n2\n11\n29\n18", "output": "5\n"}, {"type": "stdin_stdout", "input": "5 4 5\n3\n2\n11\n29\n18", "output": "5\n"}, {"type": "stdin_stdout", "input": "5 4 5\n3\n2\n11\n29\n30", "output": "5\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\nTakahashi has N blue cards and M...
[{"type": "stdin_stdout", "input": "1\nvoldemort\n10\nvoldemort\nvoldemort\nvoldemort\nvoldemort\nvoldemort\nvoldemort\nvoldemort\nvoldemort\nvoldemort\nvoldemort\n", "output": "0\n"}, {"type": "stdin_stdout", "input": "1\nvoldemort\n10\nvoldemort\nvoldemort\nvoldemort\nvoldemort\nuoldemort\nvoldemort\nvoldemort\nvolde...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nTheofanis started playing the ne...
[{"type": "stdin_stdout", "input": "5\n3 2\n1 2 imposter\n2 3 crewmate\n5 4\n1 5 crewmate\n2 5 crewmate\n2 4 imposter\n3 4 imposter\n2 2\n1 2 imposter\n2 1 crewmate\n3 5\n1 2 imposter\n1 2 imposter\n3 2 crewmate\n2 2 crewmate\n1 3 imposter\n13 0\n", "output": "2\n4\n-1\n2\n13\n"}, {"type": "stdin_stdout", "input": "5\n...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nThe neutral city of Eyes City, i...
[{"type": "stdin_stdout", "input": "10 4\nA\nB\nB\nC\n8 4\nD\nD\nB\nB\n0 0", "output": "AC######BB\nD####BBD\n"}, {"type": "stdin_stdout", "input": "12 4\nA\nB\nB\nD\n5 4\nC\nD\nB\nB\n0 0", "output": "A####D####BB\nD#CBB\n"}, {"type": "stdin_stdout", "input": "10 4\nA\nC\nD\nB\n7 4\nC\nA\nB\nB\n0 0", "output": "AC#####...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nPetr wants to make a calendar fo...
[{"type": "stdin_stdout", "input": "11 6\n", "output": "5\n"}, {"type": "stdin_stdout", "input": "10 1\n", "output": "5\n"}, {"type": "stdin_stdout", "input": "10 2\n", "output": "5\n"}, {"type": "stdin_stdout", "input": "10 3\n", "output": "5\n"}, {"type": "stdin_stdout", "input": "10 4\n", "output": "5\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\nZibi is a competitive programmin...
[{"type": "stdin_stdout", "input": "40 39\n0 -2\n-2 3\n3 3\n3 -2\n-1 1\n2 0\n-3 2\n-2 1\n0 -3\n-1 -3\n1 -1\n-3 -1\n2 2\n0 2\n1 -3\n-2 -1\n1 2\n-1 -2\n-1 0\n3 2\n1 3\n-3 1\n-2 -3\n-3 -1\n3 0\n-1 3\n3 1\n-2 2\n0 3\n3 -1\n2 -3\n1 1\n-1 -1\n0 1\n-3 0\n1 0\n-3 3\n-3 -3\n2 2\n-1 2\n1 29\n29 2\n29 3\n29 4\n5 29\n29 6\n7 29\n8...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nWrite a program that extracts n ...
[{"type": "stdin_stdout", "input": "4 14\n3 1\n0 0", "output": "13\n0\n"}, {"type": "stdin_stdout", "input": "3 10\n5 -2\n0 0", "output": "8\n0\n"}, {"type": "stdin_stdout", "input": "2 -1\n13 1\n0 0", "output": "0\n0\n"}, {"type": "stdin_stdout", "input": "3 -1\n13 1\n0 0", "output": "0\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\nGiven an integer N, Chef wants t...
[{"type": "stdin_stdout", "input": "1\n127", "output": "63\n"}, {"type": "stdin_stdout", "input": "1\n101", "output": "-1\n"}, {"type": "stdin_stdout", "input": "1\n100", "output": "-1\n"}, {"type": "stdin_stdout", "input": "1\n110", "output": "-1\n"}, {"type": "stdin_stdout", "input": "1\n111", "output": "-1\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 teacher decides to give toffee...
[{"type": "stdin_stdout", "input": "484\nLLRRRL==RRLRRLR=LRR=RL=LLLRL===RLRRRLRR=RRRL=LLLLRL==RL==R==LLLRL=RLLRLRLLLLLLLRRLL=LLR=LLR==RLL==LLLR=RL==LL=LRRL=LLRRRLR====R=R=LRRRLLL==RLRRLR=LL==LLRLR===RR=LR==RL==L==R====LRL=LR=R=R=R=LL=L=RLR=RL==R==LRLRL==L==LL=LR=L=RRRR=R==RRLRRRLR==R=LL===R===RLRRR===LRRLLRRRRR=L==LLRR...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nRead problems statements in Mand...
[{"type": "stdin_stdout", "input": "2\n4 1\n0 3\n4 2\n0 3\n-1 -2", "output": "()()\n()()\n"}, {"type": "stdin_stdout", "input": "2\n4 1\n0 3\n4 2\n0 3\n-2 -2", "output": "()()\n()()\n"}, {"type": "stdin_stdout", "input": "2\n4 1\n0 3\n4 1\n0 3\n-1 -2", "output": "()()\n()()\n"}, {"type": "stdin_stdout", "input": "2\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\nExample\n\nInput\n\ncrc\n1\n\n\n...
[{"type": "stdin_stdout", "input": "epi\n-2", "output": "eipie\n"}, {"type": "stdin_stdout", "input": "eoi\n-2", "output": "eioie\n"}, {"type": "stdin_stdout", "input": "eoj\n-2", "output": "ejoje\n"}, {"type": "stdin_stdout", "input": "enj\n-2", "output": "ejnje\n"}, {"type": "stdin_stdout", "input": "fnj\n-2", "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\nFor he knew every Who down in Wh...
[{"type": "stdin_stdout", "input": "336 336\nHHHHHHHHHS..S..HH..H.S.H..HHH.H.H.H.S.H.S.S.H.S..SS..H.SS.H.HH.HH..HH.H...H.H.H.HSS..H...HH..HH.H..H.S.S....S.H.HH..HS..S.S.S.H.H.S..S.H.HH.HH..HH.HH.HS.HH.HSSHHHHHHHHH.H.HH..HHH.H.H.S..H.HH.S.H..HH.HS.HH.S.H.H.H..H.HH.HS.HHHHH.HH.S.SSS.S.S.HH.HS.H.S.HH.H.HH.H.S.HH.HS.HH..HH...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 group of n cities is connected...
[{"type": "stdin_stdout", "input": "50 23129 410924\n18 28\n17 23\n21 15\n18 50\n50 11\n32 3\n44 41\n50 31\n50 34\n5 14\n36 13\n22 40\n20 9\n9 43\n19 47\n48 40\n20 22\n33 45\n35 22\n33 24\n9 6\n13 1\n13 24\n49 20\n1 20\n29 38\n10 35\n25 23\n49 30\n42 8\n20 18\n32 15\n32 1\n27 10\n20 47\n41 7\n20 14\n18 26\n4 20\n20 2\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\nDima overslept the alarm clock, ...
[{"type": "stdin_stdout", "input": "10 8 2\n0 -1 0 -1 -1 0 0 -1 -1\n-1 0 -1 0 0 -1 -1 0 -1\n-1 -1 -1 0 -1 -1 0 0 0\n0 0 0 0 -1 0 0 0 -1\n0 -1 -1 0 -1 -1 -1 0 0\n-1 -1 -1 0 -1 -2 0 -1 0\n0 0 0 0 -1 0 0 0 -1\n0 0 -1 0 -1 0 0 -1 0\n-1 0 0 0 -1 -1 -1 0 0\n-1 -1 -1 0 0 0 -1 -1 0\n", "output": "-1\n"}, {"type": "stdin_stdout...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nWhile surfing in web I found int...
[{"input": "\"2000000,2000001,2000002,2000003\"", "output": "[\"16000048000044000012000001, 4000006000001\"]", "fn_name": "check_root"}, {"input": "\"25000,25001,25002,25003\"", "output": "[\"390718756875150001, 625075001\"]", "fn_name": "check_root"}, {"input": "\"1015,1016,1017,1018\"", "output": "[\"1067648959441, 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\nSergey attends lessons of the N-...
[{"type": "stdin_stdout", "input": "ttspivgoupgupvgpusvppogsseueusuglpiugssviuutlvgvugtpovuvspvpipggooplgvgugpogvesppulovugsvuougveiivgvslllviogpvtolepglguuellotpvgevspvoiiggiiplppgosuguvtstttpielteuglopgeoeeuivtptggltoltpgliviotsospvitupiopisoetupvvspooilsopslpoloptigstspoiuutiuvvuvlpplvioitsuvlpvtleveslslovolloogsgpv...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 method that returns true...
[{"input": "\"pippi\"", "output": "[false]", "fn_name": "powerof4"}, {"input": "4.2", "output": "[false]", "fn_name": "powerof4"}, {"input": "-25", "output": "[false]", "fn_name": "powerof4"}, {"input": "40", "output": "[false]", "fn_name": "powerof4"}, {"input": "256", "output": "[true]", "fn_name": "powerof4"}, {"inp...
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\nYaroslav has an array, consistin...
[{"type": "stdin_stdout", "input": "56\n-157 136 457 598 -138 -586 -338 752 -566 -718 -333 -965 309 -125 -938 -188 -390 17 -75 -902 -320 163 820 -970 -525 -329 81 488 -412 978 138 344 305 -358 -273 -967 253 -665 -245 187 602 252 -825 -511 828 764 -402 278 995 541 542 549 612 -536 527 -884 225 800 160 -409 -926 -795 -32...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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. F has n positive integers, a...
[{"type": "stdin_stdout", "input": "100\n95 94 31 65 35 95 70 78 81 36 69 97 39 28 89 62 36 23 35 21 36 11 65 39 13 34 79 87 91 70 43 82 24 97 6 87 49 140 60 92 63 9 16 6 31 90 6 5 55 48 27 86 65 66 45 8 67 17 24 44 34 93 26 32 82 54 72 83 94 81 79 79 15 9 4 59 42 83 80 67 28 62 56 58 87 67 34 3 61 10 62 19 94 31 74 97...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 most devs know about [big/...
[{"input": "43135012110", "output": "[\"0D0B0A0C0E\"]", "fn_name": "mid_endian"}, {"input": "168496141", "output": "[\"0D0B0A0C\"]", "fn_name": "mid_endian"}, {"input": "9999999", "output": "[\"96987F\"]", "fn_name": "mid_endian"}, {"input": "658188", "output": "[\"0B0A0C\"]", "fn_name": "mid_endian"}, {"input": "0", "...
code_functional
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nTwo integers are coprimes if the...
[{"input": "25", "output": "[[1, 2, 3, 4, 6, 7, 8, 9, 11, 12, 13, 14, 16, 17, 18, 19, 21, 22, 23, 24]]", "fn_name": "coprimes"}, {"input": "30", "output": "[[1, 7, 11, 13, 17, 19, 23, 29]]", "fn_name": "coprimes"}, {"input": "20", "output": "[[1, 3, 7, 9, 11, 13, 17, 19]]", "fn_name": "coprimes"}, {"input": "10", "outp...
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\nBob is a pirate looking for the ...
[{"type": "stdin_stdout", "input": "25\n2 2\n1 -2\n1 1\n0 1\n2 1\n-2 2\n-1 -2\n-1 2\n0 -2\n-1 1\n-2 -1\n-1 -1\n1 -1\n2 -1\n1 2\n-2 -2\n2 0\n-2 0\n-2 1\n2 -2\n-1 0\n1 0\n0 -1\n0 2\n0 0\n1 3\n-3 -1\n-2 0\n-3 1\n1 1\n0 0\n-2 2\n-1 -1\n1 -1\n-3 3\n0 3\n-2 1\n0 1\n-3 2\n-1 3\n-2 3\n-2 -1\n1 2\n1 0\n-3 0\n0 -1\n-1 2\n-1 1\n-...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nOnce Bob decided to lay a parque...
[{"type": "stdin_stdout", "input": "100 100 10000 10000 10000\n", "output": "aabbaabbaabbaabbaabbaabbaabbaabbaabbaabbaabbaabbaabbaabbaabbaabbaabbaabbaabbaabbaabbaabbaabbaabbaabb\naabbaabbaabbaabbaabbaabbaabbaabbaabbaabbaabbaabbaabbaabbaabbaabbaabbaabbaabbaabbaabbaabbaabbaabbaabb\nbbaabbaabbaabbaabbaabbaabbaabbaabbaabba...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 dial lock is a kind of lock wh...
[{"type": "stdin_stdout", "input": "4\n1433 4680\n6\n777777 003330\n0", "output": "4\n2\n"}, {"type": "stdin_stdout", "input": "4\n1357 4680\n6\n509138 003330\n0", "output": "1\n4\n"}, {"type": "stdin_stdout", "input": "4\n1357 4680\n6\n297443 003330\n0", "output": "1\n5\n"}, {"type": "stdin_stdout", "input": "4\n1357 ...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 has been playing Plane of ...
[{"type": "stdin_stdout", "input": "10\nj 10\ni 9\nh 8\ng 7\nf 6\ne 5\nd 4\nc 3\nb 2\na 1\n", "output": "10\na noob\nb noob\nc noob\nd noob\ne random\nf random\ng random\nh average\ni hardcore\nj pro\n"}, {"type": "stdin_stdout", "input": "10\na 1\nb 2\nc 3\nd 4\ne 5\nf 6\ng 7\nh 8\ni 9\nj 10\n", "output": "10\na noob\...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 rectangular grid of s...
[{"type": "stdin_stdout", "input": "3\n1 2\n01\nRL\n3 3\n001\n101\n110\nRLL\nDLD\nULL\n3 3\n000\n000\n000\nRRD\nRLD\nULL\n", "output": "2 1\n4 3\n2 2\n"}, {"type": "stdin_stdout", "input": "3\n1 2\n01\nRL\n3 3\n000\n101\n110\nRLL\nDLD\nULL\n3 3\n000\n000\n000\nRRD\nRLD\nULL\n", "output": "2 1\n4 3\n2 2\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\nSeveral drivers had lined up for...
[{"type": "stdin_stdout", "input": "12\nylwdycynzm qikgzjftsy\nuyjjakdllg oupsqupono\nrzydxwplrl rarepbgeqk\nhzunfitubv tmnfmyxhmb\njqomnyflox znowiqbzyq\nuxpwihqnjy hxsmfvssru\nglsafbvhvu xfszigeomu\niahkxbubof rzvfmulbxj\nsreepibkei wrhzprsrme\nuroagvltiy ahxrusrokr\nrpyfumbrxy wklfolgpzi\ndyejhfnwml rztiqhzhmx\nidzq...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 an integer ```k``` rearrange...
[{"input": "5\n[1, 3, 5, 7, 6, 4, 2]", "output": "[[1, 3, 4, 2, 5, 7, 6]]", "fn_name": "split_by_value"}, {"input": "1\n[3, 2, 8, 3, 2, 1]", "output": "[[3, 2, 8, 3, 2, 1]]", "fn_name": "split_by_value"}, {"input": "6\n[6, 4, 10, 10, 6]", "output": "[[4, 6, 10, 10, 6]]", "fn_name": "split_by_value"}, {"input": "10\n[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\nDue to another of his misbehaved...
[{"input": "50000", "output": "[1250025000]", "fn_name": "f"}, {"input": "300", "output": "[45150]", "fn_name": "f"}, {"input": "303", "output": "[46056]", "fn_name": "f"}, {"input": "3.14", "output": "[null]", "fn_name": "f"}, {"input": "100", "output": "[5050]", "fn_name": "f"}, {"input": "\"n\"", "output": "[null]",...
code_functional
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nWe just discovered a new data st...
[{"type": "stdin_stdout", "input": "30\nmnidamnida\nopmnida\nadinm_masu\nus`m_masu\nuseddesu\nadinmmasu\nmnida_po\ndnmnida\nmasumnida\nusam_po\nmnidadesu\nuted_masu\nmnida_mnida\nadinm_mnida\nusammasu\nmasu_desu\nvsammnida\ngenki_desu\nmm_mnida\nadinmmnida\nop_mnida\nadinm_desu\nused_desu\nusam_desu\nadinmdesu\nsarangh...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nPaladin Manao caught the trail o...
[{"type": "stdin_stdout", "input": "50 2 5\n9 14\n46 34\n40 35\n44 30\n32 16\n1 38\n48 2\n17 14\n50 25\n6 1\n45 19\n21 15\n22 11\n15 33\n8 28\n2 32\n10 22\n37 3\n43 39\n25 16\n9 19\n16 3\n28 32\n20 45\n24 32\n4 18\n49 39\n13 45\n26 4\n11 33\n14 37\n42 19\n31 45\n38 3\n34 8\n18 29\n35 34\n29 16\n7 46\n19 28\n27 33\n30 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\nLet’s define a grid to be a set ...
[{"type": "stdin_stdout", "input": "ABCDEFGHIJKLMNOPQRSGTUVWXYZ\n", "output": "YXWVUTGHIJKLM\nZABCDEFSRQPON\n"}, {"type": "stdin_stdout", "input": "UTEDBZRVWLOFUASHCYIPXGJMKNQ\n", "output": "PIYCHSAUTEDBZ\nXGJMKNQFOLWVR\n"}, {"type": "stdin_stdout", "input": "ZWMFLTCQIAJEVUPODMSGXKHRNYB\n", "output": "HKXGSMFLTCQIA\nRN...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nRead problems statements in Mand...
[{"type": "stdin_stdout", "input": "5 3 3\n2 1 1 16 4\n11 4 1 -1 1", "output": "36\n"}, {"type": "stdin_stdout", "input": "5 3 3\n1 1 1 8 15\n18 1 0 -1 1", "output": "43\n"}, {"type": "stdin_stdout", "input": "5 3 4\n0 2 3 2 34\n-1 2 6 0 3", "output": "44\n"}, {"type": "stdin_stdout", "input": "5 2 11\n3 0 -1 1 0\n3 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 are given three numbers. Is ...
[{"type": "stdin_stdout", "input": "200000000000000000000000000000000000000000000000000000000000000000000000000000\n100000000000000000000000000000000000000000000000000000000000000000000000000000\n300000000000000000000000000000000000000000000000000000000000000000000000000000", "output": "YES"}, {"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\nC: Mod! Mod!\n\nstory\n\nThat's ...
[{"type": "stdin_stdout", "input": "6\n1 25 1 10 1 3", "output": "4\n"}, {"type": "stdin_stdout", "input": "6\n0 15 1 10 2 3", "output": "6\n"}, {"type": "stdin_stdout", "input": "6\n0 15 0 10 2 3", "output": "6\n"}, {"type": "stdin_stdout", "input": "6\n0 15 0 10 2 4", "output": "6\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\nTeacher thinks that we make a lo...
[{"type": "stdin_stdout", "input": "40020 4\n", "output": "102564102564102564102564102564102564102564102564102564102564102564102564102564102564102564102564102564102564102564102564102564102564102564102564102564102564102564102564102564102564102564102564102564102564102564102564102564102564102564102564102564102564102564102...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 inputs the...
[{"type": "stdin_stdout", "input": "4\n30\n125\n75\n4\n30\n125\n75\n5\n30\n125\n149\n65\n4\n30\n125\n75\n4\n30\n125\n75\n6\n52\n50\n50\n25\n75\n0", "output": "0\n2\n2\n"}, {"type": "stdin_stdout", "input": "4\n30\n125\n75\n4\n30\n125\n75\n5\n30\n125\n149\n65\n4\n30\n125\n75\n4\n30\n125\n75\n6\n52\n79\n50\n25\n75\n0", "...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nFinish the solution so that it s...
[{"input": "[1, 2, 3, 10, 5]", "output": "[[1, 2, 3, 5, 10]]", "fn_name": "solution"}, {"input": "[20, 2, 10]", "output": "[[2, 10, 20]]", "fn_name": "solution"}, {"input": "[2, 20, 10]", "output": "[[2, 10, 20]]", "fn_name": "solution"}, {"input": "null", "output": "[[]]", "fn_name": "solution"}, {"input": "[]", "outp...
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# Introduction:\n\nReversi is a ...
[{"input": "[0, 1, 2, 3, 4, 5, 6, 7]", "output": "[\"*******O\"]", "fn_name": "reversi_row"}, {"input": "[1, 0, 2, 3, 4, 5, 6, 7]", "output": "[\"OOOOOOOO\"]", "fn_name": "reversi_row"}, {"input": "[3, 4, 5, 6, 0, 2]", "output": "[\"*.OOOOO.\"]", "fn_name": "reversi_row"}, {"input": "[1, 7, 0, 5, 6, 4]", "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# Task\n A media access control ...
[{"input": "\"not a MAC-48 address\"", "output": "[false]", "fn_name": "is_mac_48_address"}, {"input": "\"02-03-04-05-06-07-\"", "output": "[false]", "fn_name": "is_mac_48_address"}, {"input": "\"Z1-1B-63-84-45-E6\"", "output": "[false]", "fn_name": "is_mac_48_address"}, {"input": "\"G0-00-00-00-00-00\"", "output": "[f...
code_functional
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nBob recently read about bitwise ...
[{"type": "stdin_stdout", "input": "17 15\na := 010000111111110\nb := 101100110000100\nc := 100101100100111\nd := 010110101110110\ne := 111111000010110\nf := 011001110111110\ng := 110011010100101\nh := 000001010010001\ni := 110000111001011\nj := 000010000010111\nk := 110110111110110\nl := 010000110000100\nm := 00011110...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 say Pak Chanek has an arra...
[{"type": "stdin_stdout", "input": "8 8\n1\n2\n3\n4\n5\n6\n7\n8\n", "output": "27\n1\n2\n3\n3\n4\n4\n5\n5\n"}, {"type": "stdin_stdout", "input": "7 7\n1\n2\n3\n4\n5\n6\n7\n", "output": "22\n1\n2\n3\n3\n4\n4\n5\n"}, {"type": "stdin_stdout", "input": "6 6\n1\n2\n3\n4\n5\n6\n", "output": "17\n1\n2\n3\n3\n4\n4\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\nStepan has the newest electronic...
[{"type": "stdin_stdout", "input": "196542\n", "output": "1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nAtCoDeer the deer found two posi...
[{"type": "stdin_stdout", "input": "-1 -2", "output": "Even\n"}, {"type": "stdin_stdout", "input": "-2 -2", "output": "Even\n"}, {"type": "stdin_stdout", "input": "-2 -1", "output": "Even\n"}, {"type": "stdin_stdout", "input": "-4 -1", "output": "Even\n"}, {"type": "stdin_stdout", "input": "-6 -1", "output": "Even\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\nThe \"Western calendar\" is a co...
[{"type": "stdin_stdout", "input": "1 1914", "output": "3781\n"}, {"type": "stdin_stdout", "input": "2 1914", "output": "3825\n"}, {"type": "stdin_stdout", "input": "1 125", "output": "1992\n"}, {"type": "stdin_stdout", "input": "2 125", "output": "2036\n"}, {"type": "stdin_stdout", "input": "2 141", "output": "2052\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\nRecently, Valery have come acros...
[{"type": "stdin_stdout", "input": "5\n void 8os6s2b ( T )\n void 8os6s2b ( int, int, int,int, int ) \n void 8os6s2b ( int, int, T) \n void fow8dmm ( T,T, int, int ) \n void fow8dmm ( int) \n2\n int 2 \n double 9c9t0 \n7\n 8os6s2b ( 9c9t0 ) \n 8os6s2b (9c9t0,9c9t0,9c9t0 ) \n8os6s2b ( 9c9t0,...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nGiant chess is quite common in G...
[{"type": "stdin_stdout", "input": "100 10 30\n40 4\n15 3\n75 3\n88 10\n32 1\n16 5\n81 8\n45 2\n72 8\n11 6\n86 4\n50 2\n9 4\n11 1\n20 3\n47 3\n2 4\n68 3\n90 5\n85 2\n88 1\n88 5\n86 3\n70 9\n49 3\n34 4\n5 7\n77 5\n50 1\n87 5\n", "output": "402737011\n"}, {"type": "stdin_stdout", "input": "100000 100000 4\n50001 50001\n5...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nNot considering number 1, the in...
[{"input": "1000\n3", "output": "[[153, 370, 371, 407]]", "fn_name": "eq_sum_powdig"}, {"input": "1500\n3", "output": "[[153, 370, 371, 407]]", "fn_name": "eq_sum_powdig"}, {"input": "500\n3", "output": "[[153, 370, 371, 407]]", "fn_name": "eq_sum_powdig"}, {"input": "400\n3", "output": "[[153, 370, 371]]", "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\nTavak and Seyyed are good friend...
[{"type": "stdin_stdout", "input": "519002744 519002744\n", "output": "519002744\n"}, {"type": "stdin_stdout", "input": "331900277 331900277\n", "output": "331900277\n"}, {"type": "stdin_stdout", "input": "349533413 349533413\n", "output": "349533413\n"}, {"type": "stdin_stdout", "input": "568814539 568814539\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\nRead problems statements in Mand...
[{"type": "stdin_stdout", "input": "2\n+++-+-+---\n-------", "output": "2\n3\n"}, {"type": "stdin_stdout", "input": "2\n-+--+++--+\n-------", "output": "4\n3\n"}, {"type": "stdin_stdout", "input": "2\n-+-+-+-+-+\n-------", "output": "0\n3\n"}, {"type": "stdin_stdout", "input": "2\n--++---+++\n-----+-", "output": "4\n2\...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nThe chef has a recipe he wishes ...
[{"type": "stdin_stdout", "input": "3\n2 4 11\n3 2 2 7\n4 3 36 13 11", "output": "4 11\n2 2 7\n3 36 13 11\n"}, {"type": "stdin_stdout", "input": "3\n2 4 10\n3 2 2 7\n4 3 36 13 11", "output": "2 5\n2 2 7\n3 36 13 11\n"}, {"type": "stdin_stdout", "input": "3\n2 2 10\n3 2 2 7\n4 3 36 13 11", "output": "1 5\n2 2 7\n3 36 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\nYou are given a sequence of N in...
[{"type": "stdin_stdout", "input": "5\n2 14 11 2 0", "output": "20\n"}, {"type": "stdin_stdout", "input": "5\n13 2 12 4 2", "output": "22\n"}, {"type": "stdin_stdout", "input": "5\n11 1 29 8 2", "output": "29\n"}, {"type": "stdin_stdout", "input": "5\n4 2 5 15 12", "output": "35\n"}, {"type": "stdin_stdout", "input": "...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nThe only difference between easy...
[{"type": "stdin_stdout", "input": "50 15000\n142 -300\n20 -298\n560 -300\n1815 -292\n282 -297\n92 -293\n34 -284\n555 -299\n408 -293\n504 -284\n278 -284\n139 -291\n64 -298\n311 -293\n130 -293\n89 -298\n129 -294\n385 -295\n136 -288\n41 -293\n112 -290\n416 -295\n178 -294\n154 -300\n110 -300\n346 -299\n209 -294\n1394 -295...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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'll call an array of n non-neg...
[{"type": "stdin_stdout", "input": "6 2\n1 2 536870912\n2 3 864795845\n", "output": "YES\n536870912 864795845 864795845 0 0 0\n"}, {"type": "stdin_stdout", "input": "6 2\n1 1 536870912\n2 3 864795845\n", "output": "YES\n536870912 864795845 864795845 0 0 0\n"}, {"type": "stdin_stdout", "input": "3 2\n1 2 536870912\n2 3 ...
code_stdio