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\nLittle Petya likes numbers a lot...
[{"type": "stdin_stdout", "input": "1209\n", "output": "263450/1207\n"}, {"type": "stdin_stdout", "input": "1869\n", "output": "627063/1867\n"}, {"type": "stdin_stdout", "input": "1865\n", "output": "623876/1863\n"}, {"type": "stdin_stdout", "input": "1343\n", "output": "325366/1341\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\nJohn is a programmer. ...
[{"input": "5\n6\n[1, 2, 3, 10]", "output": "[12]", "fn_name": "shortest_time"}, {"input": "5\n5\n[1, 2, 3, 10]", "output": "[11]", "fn_name": "shortest_time"}, {"input": "2\n2\n[2, 3, 4, 10]", "output": "[10]", "fn_name": "shortest_time"}, {"input": "5\n4\n[1, 2, 3, 10]", "output": "[12]", "fn_name": "shortest_time"},...
code_functional
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nAnia has a large integer $S$. It...
[{"type": "stdin_stdout", "input": "400 224\n34034718296316650556302576767095880542740697596682657060609028712014739414658241556774411582749368771597248873201583574900424227251655547840887764275893533353440635216728376201808545879398359535670372855472971530695051695650262058940466340529417646357776899296790403916961389...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nDifference of Big Integers\n\nGi...
[{"type": "stdin_stdout", "input": "-2 -1280", "output": "1278\n"}, {"type": "stdin_stdout", "input": "-2 -1243", "output": "1241\n"}, {"type": "stdin_stdout", "input": "-2 -2265", "output": "2263\n"}, {"type": "stdin_stdout", "input": "-1 -2265", "output": "2264\n"}, {"type": "stdin_stdout", "input": "-1 -2368", "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\nThe weight of a sequence is defi...
[{"type": "stdin_stdout", "input": "2\n4\n2 2 2 2\n4\n1 3 3 4\n", "output": "15\n4\n"}, {"type": "stdin_stdout", "input": "2\n4\n2 2 2 2\n4\n1 4 3 4\n", "output": "15\n2\n"}, {"type": "stdin_stdout", "input": "2\n4\n2 2 2 2\n4\n1 2 3 4\n", "output": "15\n0\n"}, {"type": "stdin_stdout", "input": "2\n4\n1 2 3 1\n4\n1 4 1...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nFor a permutation P[1... N] of i...
[{"type": "stdin_stdout", "input": "10 7 5\n", "output": "2 3 4 5 1 7 8 9 10 6 "}, {"type": "stdin_stdout", "input": "10 7 5\n", "output": "2 3 4 5 1 7 8 9 10 6 "}, {"type": "stdin_stdout", "input": "9 2 5\n", "output": "2 1 4 3 6 7 8 9 5 "}, {"type": "stdin_stdout", "input": "9 7 9\n", "output": "2 3 4 5 6 7 8 9 1 "},...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nYou'll be given a string, and ha...
[{"input": "\"Mary Had A Little Lamb\"", "output": "[1873]", "fn_name": "uni_total"}, {"input": "\"Mary had a little lamb\"", "output": "[2001]", "fn_name": "uni_total"}, {"input": "\"And so does Strive\"", "output": "[1661]", "fn_name": "uni_total"}, {"input": "\"CodeWars rocks\"", "output": "[1370]", "fn_name": "uni_...
code_functional
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nThere are two bus stops denoted ...
[{"type": "stdin_stdout", "input": "2 1000000000\n1 1000000000\n2 2\n", "output": "Yes\n 2000000000 2000000001"}, {"type": "stdin_stdout", "input": "2 10\n4 5\n2 2\n", "output": "Yes\n ...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\n##Task:\n\nYou have to write a f...
[{"input": "6", "output": "[\"22\\n4444\\n666666\"]", "fn_name": "pattern"}, {"input": "5", "output": "[\"22\\n4444\"]", "fn_name": "pattern"}, {"input": "2", "output": "[\"22\"]", "fn_name": "pattern"}, {"input": "-25", "output": "[\"\"]", "fn_name": "pattern"}, {"input": "1", "output": "[\"\"]", "fn_name": "pattern"}...
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, Taro received a strange...
[{"type": "stdin_stdout", "input": "341143514535\n158\n143565553551655311343411652235654535651124615163\n551544654451431564\n4\n3411\n6363636363\n153414", "output": "naruto\nNA\ndo you wanna go to aizu?\nyes sure!\nNA\nna\n?????\nend\n"}, {"type": "stdin_stdout", "input": "341143514535\n158\n143565553551655311343411652...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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\n[3R2 as DJ Mashiro - Happiness B...
[{"type": "stdin_stdout", "input": "10 83\n1 3\n2 2\n2 2\n2 2\n2 2\n2 2\n2 2\n2 2\n1 4\n2 2\n2 3\n2 3\n2 3\n2 3\n2 3\n2 3\n1 4\n1 5\n1 7\n2 2\n2 2\n1 5\n2 2\n1 3\n2 1\n2 6\n1 5\n2 6\n2 9\n1 2\n2 5\n1 2\n2 5\n2 4\n2 4\n1 2\n1 2\n1 4\n2 6\n2 6\n2 4\n2 4\n1 2\n1 2\n2 4\n2 4\n2 3\n2 3\n1 2\n2 9\n1 2\n1 2\n1 2\n2 6\n2 6\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\nComplete the function that takes...
[{"input": "1005\n9999999999999999999999999999999999999999999\n109", "output": "[91743119266055045871559633027522935779807]", "fn_name": "divisible_count"}, {"input": "101\n9999999999999999999999999999999999999999999\n11", "output": "[909090909090909090909090909090909090909081]", "fn_name": "divisible_count"}, {"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\nA newspaper is published in Walr...
[{"type": "stdin_stdout", "input": "ehfjaabjfedhddejjfcfijagefhkeahjcddhchahjbagi\nfbfdjbjhibjgjgaaajgdbcfdbhjcajcbbieijhcjgajhgaa\n", "output": "10\n"}, {"type": "stdin_stdout", "input": "ehfjaabjfedhddejjfcfijagefhkeahjcddhchahjbagi\naaghjagjchjieibbcjacjhbdfcbdgjaaagjgjbihjbjdfbf\n", "output": "10\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\nKsenia has ordinary pan scales a...
[{"type": "stdin_stdout", "input": "CKQHRUZMISGE|FBVWPXDLTJYN\nOA\n", "output": "CKQHRUZMISGEA|FBVWPXDLTJYNO\n"}, {"type": "stdin_stdout", "input": "V|CMOEUTAXBFWSK\nDLRZJGIYNQHP\n", "output": "VDLRZJGIYNQHP|CMOEUTAXBFWSK\n"}, {"type": "stdin_stdout", "input": "QWHNMALDGKTJ|\nPBRYVXZUESCOIF\n", "output": "QWHNMALDGKTJF...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nMancala is a game famous in the ...
[{"type": "stdin_stdout", "input": "297857621 238127103 749085829 139033277 597985489 202617713 1366784327 117968155 278551059 297781685 330124279 338959601 682874531 259895291\n", "output": "5305874892\n"}, {"type": "stdin_stdout", "input": "404418821 993626161 346204297 122439813 461187221 628048227 625919459 6286117...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nRoman and Denis are on the trip ...
[{"type": "stdin_stdout", "input": "4\nqe\nnd\niqryhukieskfvaeettersinksrmazelxtgvartuz\nvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 ages ago Berland was a k...
[{"type": "stdin_stdout", "input": "1000 1100 1000\n", "output": "3196901\n"}, {"type": "stdin_stdout", "input": "1000 0100 1000\n", "output": "1197901\n"}, {"type": "stdin_stdout", "input": "1000 1000 1000\n", "output": "2997001"}, {"type": "stdin_stdout", "input": "998 999 1001\n", "output": "2993002\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\n$n$ people gathered to hold a ju...
[{"type": "stdin_stdout", "input": "1\n74\n15 4 1 8 1 4 -1 5 9 1 6 3 1 16 2 1 3 6 7 4 1 6 8 9 21 4 0 6 6 4 22 1 8 7 0 1 6 6 4 1 8 9 16 4 10 5 9 2 20 10 0 5 3 8 1 7 7 0 2 10 2 4 8 4 6 9 2 4 9 8 1 11 3 0\n", "output": "210389544\n"}, {"type": "stdin_stdout", "input": "1\n74\n15 4 1 8 1 4 0 5 9 1 6 3 1 16 2 1 3 6 7 4 1 6 ...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nYou are a paparazzi working in M...
[{"type": "stdin_stdout", "input": "500 10\n69 477 122\n73 186 235\n341 101 145\n372 77 497\n404 117 440\n494 471 37\n522 300 498\n682 149 379\n821 486 359\n855 157 386\n", "output": "3\n"}, {"type": "stdin_stdout", "input": "500 10\n69 477 111\n73 186 235\n341 101 145\n372 77 497\n404 117 440\n494 471 37\n522 300 498\...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nGiven a permutation $p$ of lengt...
[{"type": "stdin_stdout", "input": "2\n3\n3 4 1\n4\n1 12 4 6\n", "output": "3\n3 4 1\n4\n1 12 4 6\n"}, {"type": "stdin_stdout", "input": "2\n3\n3 4 1\n4\n1 12 3 6\n", "output": "3\n3 4 1\n4\n1 12 3 6\n"}, {"type": "stdin_stdout", "input": "2\n3\n5 14 1\n4\n1 5 16 2\n", "output": "3\n5 14 1\n3\n1 16 2\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\nWe have N sticks with negligible...
[{"type": "stdin_stdout", "input": "10\n1 1 2 -3 2 8 1 218 -1 8", "output": "16\n"}, {"type": "stdin_stdout", "input": "10\n0 1 0 -2 4 34 1 34 0 4", "output": "136\n"}, {"type": "stdin_stdout", "input": "10\n-1 2 12 15 3 1 0 18 1 1", "output": "0\n"}, {"type": "stdin_stdout", "input": "10\n-2 2 12 1 4 2 1 41 -1 1", "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\nConsider the following series:\n...
[{"input": "5000", "output": "[283]", "fn_name": "convergence"}, {"input": "500", "output": "[29]", "fn_name": "convergence"}, {"input": "10", "output": "[5]", "fn_name": "convergence"}, {"input": "15", "output": "[2]", "fn_name": "convergence"}, {"input": "3", "output": "[5]", "fn_name": "convergence"}, {"input": "5",...
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 take your son to the forest ...
[{"input": "20", "output": "[[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20]]", "fn_name": "monkey_count"}, {"input": "10", "output": "[[1, 2, 3, 4, 5, 6, 7, 8, 9, 10]]", "fn_name": "monkey_count"}, {"input": "9", "output": "[[1, 2, 3, 4, 5, 6, 7, 8, 9]]", "fn_name": "monkey_count"}, {"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\nGalois is one of the strongest c...
[{"type": "stdin_stdout", "input": "........\n........\n.B....B.\n....W...\n........\n..W.....\n........\n........\n", "output": "A\n"}, {"type": "stdin_stdout", "input": "..B.....\n..W.....\n......B.\n........\n.....W..\n......B.\n........\n........\n", "output": "B\n"}, {"type": "stdin_stdout", "input": ".BB.B.B.\nB....
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nWrite a program which finds a pa...
[{"type": "stdin_stdout", "input": "vanceknowledgetoad\nbdvanced", "output": "No\n"}, {"type": "stdin_stdout", "input": "vanceknowledgetoad\ncdvanced", "output": "No\n"}, {"type": "stdin_stdout", "input": "vanceknowmedgetoad\ncdvanced", "output": "No\n"}, {"type": "stdin_stdout", "input": "vbnceknowmedgetoad\ncdvanced"...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 $f(i)$ denote the minimum po...
[{"type": "stdin_stdout", "input": "6\n1\n4\n3\n4\n10\n10000000000000000\n", "output": "2\n10\n7\n10\n26\n366580019\n"}, {"type": "stdin_stdout", "input": "6\n1\n2\n3\n4\n10\n10000000000000000\n", "output": "2\n5\n7\n10\n26\n366580019\n"}, {"type": "stdin_stdout", "input": "6\n1\n2\n3\n4\n10\n10000000000000000\n", "out...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nThe Third Doctor Who once correc...
[{"type": "stdin_stdout", "input": "18 16 20 4\n0 0\n0 1\n1 7\n1 7\n", "output": "18 16\n17 15\n18 16\n19 17\n"}, {"type": "stdin_stdout", "input": "18 16 20 4\n0 0\n0 1\n1 7\n1 6\n", "output": "18 16\n17 15\n18 16\n19 17\n"}, {"type": "stdin_stdout", "input": "18 8 20 4\n1 1\n0 1\n1 7\n1 7\n", "output": "19 9\n18 8\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\nNotes\n\nTemplate in C\n\nConstr...
[{"type": "stdin_stdout", "input": "1 1 + 5 11 - *", "output": "-12\n"}, {"type": "stdin_stdout", "input": "0 0 + 6 21 - +", "output": "-15\n"}, {"type": "stdin_stdout", "input": "1 12 + 3 8 - *", "output": "-65\n"}, {"type": "stdin_stdout", "input": "1 0 + 6 21 - +", "output": "-14\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\nSanta Claus decided to disassemb...
[{"type": "stdin_stdout", "input": "dofbgdppdvmwjwtdyphhmqliydxyjfxoopxiscevowleccmhwybrxitvujkfliamvqinlrpytyaqdlbywccprukoisyaseibuqbfqjcabkieimsggsakpnqliwhehnemewhychqrfiuyaecoydnromrh\ndofbgdppdvmwjwtdyphhmqliydxyjfxoopxiscevowleccmhwybsxitvujkfliamvqinlrpytyaqdlbywccprukoisyaseibuqbfqjcabkieimsggsakpnqliwhehnemew...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nPetya works as a PR manager for ...
[{"type": "stdin_stdout", "input": "100\n1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 ...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 Statement\n\nMr. Takatsu...
[{"type": "stdin_stdout", "input": "6\nZI?U -1\nLINFR 14\nKNGE -1\nLCL -1\n@S 2\nKFHD 15\nBSKA\nILIC\nPZRH\nEDLU\n1", "output": "0\n"}, {"type": "stdin_stdout", "input": "6\n[I?U -1\nLINFR 14\nKNGE -1\nLCL -1\n@S 2\nKFHD 15\nBSKA\nILIC\nPZRH\nEDLU\n1", "output": "0\n"}, {"type": "stdin_stdout", "input": "6\n[I?U -1\nRF...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nYou have a robot that can move a...
[{"type": "stdin_stdout", "input": "8\n3\n1 5\n3 0\n6 4\n3\n1 5\n2 4\n10 -5\n5\n2 -5\n3 1\n4 1\n5 1\n6 1\n4\n3 3\n5 -3\n9 2\n12 0\n8\n1 1\n2 -6\n7 2\n8 3\n12 -9\n14 2\n18 -1\n23 9\n5\n1 -4\n4 -7\n6 -1\n7 -3\n8 -7\n2\n1 2\n2 -2\n6\n3 10\n5 5\n8 0\n12 -4\n14 -7\n19 -5\n", "output": "\n1\n2\n0\n2\n1\n1\n0\n2\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\nArkadiy has lots square photos w...
[{"type": "stdin_stdout", "input": "452081307 790635695 790635695\n", "output": "169277194.00000000000000000000\n"}, {"type": "stdin_stdout", "input": "469568633 681052815 681052815\n", "output": "105742091.00000000000000000000\n"}, {"type": "stdin_stdout", "input": "338084774 564168943 564168943\n", "output": "1130420...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nMisha was interested in water de...
[{"type": "stdin_stdout", "input": "100 74 20\n9 15 16 18 55 41 64 44 5 1 27 31 36 25 71 28 71 35 47 40 21 53 31 11 24 1 69 67 58 16 19 52 33 17 63 1 49 28 17 52 46 60 53 21 21 60 19 63 11 61 10 27 3 22 38 31 45 69 61 18 58 22 8 71 17 1 64 70 56 10 66 47 70 1 45 8 66 8 66 25 39 45 47 7 41 24 41 72 16 42 28 7 15 10 38 2...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nYou are given a sequence $a=[a_1...
[{"type": "stdin_stdout", "input": "4\n6\n55 45 30 30 40 100\n4\n10 23 7 13\n5\n10 55 35 30 65\n6\n4 1 1 1 1 4\n", "output": "3\n4\n2\n3\n"}, {"type": "stdin_stdout", "input": "5\n4\n18 6 6 6\n5\n5 5 5 5 5\n3\n12 6 6\n2\n1 1\n1\n1\n", "output": "3\n1\n2\n1\n1\n"}, {"type": "stdin_stdout", "input": "4\n3\n6 6 12\n4\n18 ...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\n1000000000000001 dogs suddenly a...
[{"type": "stdin_stdout", "input": "1000000000000001\n", "output": "gbdpxgrzxjm\n"}, {"type": "stdin_stdout", "input": "530000050000000\n", "output": "csoypdctwnh\n"}, {"type": "stdin_stdout", "input": "95678123450002\n", "output": "qpdjiixlxb\n"}, {"type": "stdin_stdout", "input": "1000000000\n", "output": "cfdgsxl\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\nMove every letter in the provide...
[{"input": "\"returnofthespacecamel\"", "output": "[\"bodebxypdroczkmomkwov\"]", "fn_name": "move_ten"}, {"input": "\"bringonthebootcamp\"", "output": "[\"lbsxqyxdrolyydmkwz\"]", "fn_name": "move_ten"}, {"input": "\"weneedanofficedog\"", "output": "[\"goxoonkxyppsmonyq\"]", "fn_name": "move_ten"}, {"input": "\"examplet...
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\nLittle Bolek has found a picture...
[{"type": "stdin_stdout", "input": "100 20\n2 3 0 4 0 1 0 6 3 4 3 6 4 6 0 9 0 6 2 7 3 8 7 10 2 9 3 9 5 6 5 10 3 7 1 5 2 8 3 7 2 3 1 6 0 8 3 8 0 4 1 8 3 7 1 9 5 9 5 8 7 8 5 6 5 8 1 9 8 9 8 10 7 10 5 8 6 10 2 6 3 9 2 6 3 10 5 9 3 10 1 3 2 11 8 9 8 10 1 8 7 11 0 9 5 8 4 5 0 7 3 7 5 9 5 10 1 7 1 9 1 6 3 8 2 4 1 4 2 6 0 4 2...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\n## Task:\nYou have to write a fu...
[{"input": "5", "output": "[\"1\\n22\\n333\\n4444\\n55555\"]", "fn_name": "pattern"}, {"input": "2", "output": "[\"1\\n22\"]", "fn_name": "pattern"}, {"input": "-25", "output": "[\"\"]", "fn_name": "pattern"}, {"input": "1", "output": "[\"1\"]", "fn_name": "pattern"}, {"input": "0", "output": "[\"\"]", "fn_name": "patt...
code_functional
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nAs it's the first of April, Heid...
[{"type": "stdin_stdout", "input": "sjvmovplbrnakthytvanvvbscgdcdkdkbgginnbiyczyrkywcuvbgolznifdyiilonvqblbywxzgjnntldeuhhlecubshirsdxugezholvufotprjovwqiitypvaghlcxlrajrtufmysbpegjfvdboewogamnunalynjvwiopqfhndupfqxfatbpklpzdsdmzwvtitvdxkefremodmlferuxyisxmvjydjthekokldjkwoiffmhlquulcbogdnnzqaisoxqpgztuzvbleiitrqbzljbb...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 your garden, there is a long ...
[{"type": "stdin_stdout", "input": "1 1000000000\n1000000000000000000 1000000000", "output": "1999999999000000000"}, {"type": "stdin_stdout", "input": "3 17\n22 15\n10 10\n17 10", "output": "70\n"}, {"type": "stdin_stdout", "input": "3 17\n22 19\n10 10\n17 10", "output": "77\n"}, {"type": "stdin_stdout", "input": "3 27...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 --Misawa's rooted tree\n\nProb...
[{"type": "stdin_stdout", "input": "((()[1]())[2]())[5](((()[2]())[6](()[3]()))[8]()(\n(()[4]())[3](((()[2]())[1]())[8](()[4]')))", "output": "(()[6]())[8](((()[4]())[7]())[16]())\n"}, {"type": "stdin_stdout", "input": "((()[8]())[2]())[5](((()[3]())[6](()[3]()))[2]())\n(()[4]())[2](((()[2]())[1]())[8](()[3]())(", "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\nThe fundamental idea in the JPEG...
[{"type": "stdin_stdout", "input": "3\n9\n0", "output": "Case 1:\n 1 2 6\n 3 5 7\n 4 8 9\nCase 2:\n 1 2 6 7 15 16 28 29 45\n 3 5 8 14 17 27 30 44 46\n 4 9 13 18 26 31 43 47 60\n 10 12 19 25 32 42 48 59 61\n 11 20 24 33 41 49 58 62 71\n 21 23 34 40 50 57 63 70 72\n 22 35 39 51 56 64 69 73 78\n 36 38 52...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 bear decided to store some r...
[{"type": "stdin_stdout", "input": "100 9\n66 71 37 41 23 38 77 11 74 13 51 26 93 56 81 17 12 70 85 37 54 100 14 99 12 83 44 16 99 65 13 48 92 32 69 33 100 57 58 88 25 45 44 85 5 41 82 15 37 18 21 45 3 68 33 9 52 64 8 73 32 41 87 99 26 26 47 24 79 93 9 44 11 34 85 26 14 61 49 38 25 65 49 81 29 82 28 23 2 64 38 13 77 68...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 have to mo...
[{"input": "\"As Grainier drove along in the wagon behind a wide, slow, sand-colored mare, clusters of orange butterflies exploded off the purple blackish piles of bear sign and winked and winked and fluttered magically like leaves without trees.\"", "output": "[\"AS reiniarG drove along IN the wagon behind 0 WIDE, SLO...
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 an all-powerful being an...
[{"type": "stdin_stdout", "input": "4\n7 8\nAAPAAAAA\nAAAAPPPP\nPPPPAAAA\nAPAAPPPP\nAPAPPAPP\nAAAAPPAP\nAAAAPPAA\n6 5\nAAAAA\nAAAAA\nAAPAA\nAAPAP\nAAAPP\nAAAPP\n4 4\nPPPP\nPPPP\nPPPP\nPPPP\n3 4\nPPPP\nPAAP\nPPPP\n", "output": "2\n1\nMORTAL\n4\n"}, {"type": "stdin_stdout", "input": "4\n7 8\nAAPABAAA\nPPPPAAAA\nPPPPAAAA\...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 105 is quite special ...
[{"type": "stdin_stdout", "input": "105\n", "output": "1\n"}, {"type": "stdin_stdout", "input": "104\n", "output": "0\n"}, {"type": "stdin_stdout", "input": "134\n", "output": "1\n"}, {"type": "stdin_stdout", "input": "135\n", "output": "2\n"}, {"type": "stdin_stdout", "input": "164\n", "output": "2\n"}, {"type": "stdi...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nYou are given a positive integer...
[{"type": "stdin_stdout", "input": "1000000001000000000", "output": "999867657\n"}, {"type": "stdin_stdout", "input": "1100000001000000000", "output": "355035671\n"}, {"type": "stdin_stdout", "input": "1100000001000010000", "output": "391646023\n"}, {"type": "stdin_stdout", "input": "1100000001001010000", "output": "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\nYou are given an array $a_1, a_2...
[{"type": "stdin_stdout", "input": "11\n1\n0\n1\n1\n1\n2\n1\n3\n1\n4\n1\n5\n1\n6\n1\n7\n1\n8\n1\n9\n26\n11140000000090000000002111\n", "output": "0\n1\n0\n0\n0\n0\n0\n0\n0\n0\n37\n"}, {"type": "stdin_stdout", "input": "11\n1\n0\n1\n1\n1\n2\n1\n3\n1\n4\n1\n5\n1\n6\n1\n7\n1\n8\n1\n9\n26\n11140000000090000000002111\n", "o...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nOnce again Tavas started eating ...
[{"type": "stdin_stdout", "input": "777777777\n", "output": "1022\n"}, {"type": "stdin_stdout", "input": "444444444\n", "output": "511\n"}, {"type": "stdin_stdout", "input": "477477447\n", "output": "728\n"}, {"type": "stdin_stdout", "input": "777744747\n", "output": "996\n"}, {"type": "stdin_stdout", "input": "7777777...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\n*This kata is based on [Project ...
[{"input": "10000000", "output": "[1153412]", "fn_name": "langtons_ant"}, {"input": "1000000", "output": "[114952]", "fn_name": "langtons_ant"}, {"input": "100000", "output": "[11108]", "fn_name": "langtons_ant"}, {"input": "10000", "output": "[720]", "fn_name": "langtons_ant"}, {"input": "1000", "output": "[118]", "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 given a string $s$, cons...
[{"type": "stdin_stdout", "input": "4\n1\na\n6\nabbaba\n6\nabbaba\n9\nbabbabbaa\n", "output": "-1 -1\n1 2\n1 2\n1 2\n"}, {"type": "stdin_stdout", "input": "4\n1\na\n6\nabbaba\n6\nabbaba\n9\nbabbabbaa\n", "output": "-1 -1\n1 2\n1 2\n1 2\n"}, {"type": "stdin_stdout", "input": "4\n1\na\n6\nabbaba\n6\nabbaba\n7\nbabbabbaa\...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nWabbit is trying to move a box c...
[{"type": "stdin_stdout", "input": "5\n1 0 1000000000 1000000000\n1 1 1000000000 1000001100\n1 0 1001000000 1000000000\n1 1 1100010011 1001000000\n2 1 108856 18413\n", "output": "2000000001\n2000001100\n2001000001\n2101010011\n127268\n"}, {"type": "stdin_stdout", "input": "5\n1 0 1000000000 1000000000\n1 1 1001000000 1...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nYou have a permutation: an array...
[{"type": "stdin_stdout", "input": "3\n3\n3 2 1\n7\n4 5 7 1 3 2 6\n5\n1 2 3 4 5\n", "output": "3\n5\n0\n"}, {"type": "stdin_stdout", "input": "3\n3\n3 2 1\n7\n4 5 7 1 3 2 6\n5\n1 3 2 4 5\n", "output": "3\n5\n2\n"}, {"type": "stdin_stdout", "input": "3\n3\n2 3 1\n7\n4 5 7 1 3 2 6\n5\n1 2 3 4 5\n", "output": "3\n5\n0\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\nJAG-channel\n\nNathan O. Davis o...
[{"type": "stdin_stdout", "input": "6\nhoge\n.fuga\n..foobar\n..jagjag\n...zigzag\n.piyo\n8\njagjag\n.hogehoge\n..fugafuga\n...ponyoponyo\n....evaeva\n....pokemon\n...nowawa\n.buhihi\n8\nhello\n.goodmorning\n..howareyou\n.goodafternoon\n..letshavealunch\n.goodevening\n.goodnight\n..gotobed\n3\ncaution\n.themessagelengt...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nRudolf is on his way to the cast...
[{"type": "stdin_stdout", "input": "30\n011110110100010000011001000100\n110111101001011001100001101101\n", "output": "146\n"}, {"type": "stdin_stdout", "input": "30\n011110110100010000011001000100\n110111101001011001100001101101\n", "output": "146\n"}, {"type": "stdin_stdout", "input": "30\n0111101101000100000110010001...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nIvan wants to make a necklace as...
[{"type": "stdin_stdout", "input": "3\n33332 19151 47433\n", "output": "0\naaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 Dima and Alex had an arg...
[{"type": "stdin_stdout", "input": "4\n4 2\n6 1\n2 6\n-2 11\n", "output": "Happy Alex\n"}, {"type": "stdin_stdout", "input": "4\n4 1\n6 2\n2 5\n-1 4\n", "output": "Happy Alex\n"}, {"type": "stdin_stdout", "input": "4\n4 1\n6 2\n2 5\n-2 4\n", "output": "Happy Alex\n"}, {"type": "stdin_stdout", "input": "4\n4 1\n6 2\n2 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\nThe new PIN is hard to remember....
[{"type": "stdin_stdout", "input": "Thereare100yenonthetable.Iam17yearsold.\n.mp6taemohogdluohsI", "output": "123\n"}, {"type": "stdin_stdout", "input": "Thergarn100yeeontgesable-Iam17ye`rsolc.\nIshptkogdhomemt5q`.", "output": "122\n"}, {"type": "stdin_stdout", "input": "Thereare100yenonthetable.Iam17ye`rsold.\n.mp6tae...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 called beautiful if ...
[{"type": "stdin_stdout", "input": "5\n0 11 12 13 14\n", "output": "\n120"}, {"type": "stdin_stdout", "input": "5\n0 12 1 13 14\n", "output": "24\n"}, {"type": "stdin_stdout", "input": "5\n1 3 0 13 48\n", "output": "120\n"}, {"type": "stdin_stdout", "input": "5\n1 18 2 13 26\n", "output": "24\n"}, {"type": "stdin_stdou...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nComplete the method which return...
[{"input": "[12, 10, 8, 8, 3, 3, 3, 3, 2, 4, 10, 12, 10]", "output": "[3]", "fn_name": "highest_rank"}, {"input": "[12, 10, 8, 12, 7, 6, 4, 10, 12, 10]", "output": "[12]", "fn_name": "highest_rank"}, {"input": "[12, 10, 8, 12, 7, 6, 4, 10, 12]", "output": "[12]", "fn_name": "highest_rank"}, {"input": "[12, 10, 8, 12, 7...
code_functional
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nAccording to rules of the Berlan...
[{"type": "stdin_stdout", "input": "231\n0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nYou have a sequence $a$ with $n$...
[{"type": "stdin_stdout", "input": "4\n1 1\n3 3\n5 5\n5 5\n", "output": "1\n1 2 3\n1 2 3 4 5\n1 2 3 4 5\n"}, {"type": "stdin_stdout", "input": "4\n1 1\n2 2\n5 5\n5 5\n", "output": "1\n1 2\n1 2 3 4 5\n1 2 3 4 5\n"}, {"type": "stdin_stdout", "input": "4\n1 1\n3 2\n5 5\n5 5\n", "output": "1\n2 1\n1 2 3 4 5\n1 2 3 4 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\nSnuke is interested in strings t...
[{"type": "stdin_stdout", "input": "4\nexpr\nexpq", "output": "8\n"}, {"type": "stdin_stdout", "input": "4\nexpr\nrxep", "output": "7\n"}, {"type": "stdin_stdout", "input": "4\nexpr\nepxq", "output": "8\n"}, {"type": "stdin_stdout", "input": "4\nexpr\npexq", "output": "8\n"}, {"type": "stdin_stdout", "input": "4\nexpr\...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 sisters Alice and ...
[{"type": "stdin_stdout", "input": "98\n710\n896\n635\n909\n528\n799\n184\n970\n731\n285\n481\n62\n829\n815\n204\n927\n48\n958\n858\n549\n722\n900\n290\n96\n414\n323\n488\n140\n494\n286\n783\n551\n896\n580\n722\n766\n841\n914\n200\n170\n384\n664\n14\n203\n582\n203\n678\n502\n677\n318\n189\n144\n97\n330\n169\n20\n492\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\nYou are given two sorted arrays ...
[{"input": "[-8, -3, -2, 4, 5, 6, 7, 15, 42, 90, 134]\n[216, 102, 74, 32, 8, 2, 0, -9, -13]", "output": "[[-13, -9, -8, -3, -2, 0, 2, 4, 5, 6, 7, 8, 15, 32, 42, 74, 90, 102, 134, 216]]", "fn_name": "merge_arrays"}, {"input": "[18, 7, 2, 0, -22, -46, -103, -293]\n[-300, -293, -46, -31, -5, 0, 18, 19, 74, 231]", "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\nMayor of city S just hates trees...
[{"type": "stdin_stdout", "input": "10\n21005 10850\n27020 13372\n28183 3724\n22874 13564\n27446 11493\n22522 10012\n24819 11529\n24166 11084\n24539 9211\n24152 9235\n", "output": "71869\n31855 31856 31857 31858 31859 31860 31861 31862 31863 31864 \n"}, {"type": "stdin_stdout", "input": "10\n21005 10850\n27020 13372\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\nThere are N boxes arranged in a ...
[{"type": "stdin_stdout", "input": "43535 7\n5 1 1 5 1 1 5 1 1 5 1 1 5 1 1 5 1 1 5 1 1 5 1 1 5 1 1 5 1 1 5 1 1 5 1 1 5 1 1 5 1 1 5 1 1 5 1 1 5 1 1 5 1 1 5 1 1 5 1 1 5 1 1 5 1 1 5 1 1 5 1 1 5 1 1 5 1 1 5 1 1 5 1 1 5 1 1 5 1 1 5 1 1 5 1 1 5 1 1 5 1 1 5 1 1 5 1 1 5 1 1 5 1 1 5 1 1 5 1 1 5 1 1 5 1 1 5 1 1 5 1 1 5 1 1 5 1 1...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nIn his publication Liber Abaci L...
[{"input": "100\n3", "output": "[465790837923166086127602033842234887]", "fn_name": "fib_rabbits"}, {"input": "40\n6", "output": "[2431532871909060205]", "fn_name": "fib_rabbits"}, {"input": "11\n33", "output": "[58212793]", "fn_name": "fib_rabbits"}, {"input": "8\n12", "output": "[8425]", "fn_name": "fib_rabbits"}, {"...
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\nSome time ago Lesha found an ent...
[{"type": "stdin_stdout", "input": "ggaaaawwwxxxxxxrrrrrrrrwwwwwwwwggggggggjjusszzzzqqqqqsssssssbbwwwwwwmmmmtttttttvvvvvvvvssssppppppggggsrrrrrrzzzzzzzyyyyyccccccchhhhhhhhjjrrrrhhhhhhhheeeeeeeaaaaaaaiiiiiuuuuuuuvvvvvjjjjjjjjffbbbbbbbbrrrrrllllllllggggggggooooollssvvvvvvvvvvnnnnnnnnuuuuuuuucccccyyyyyyyyyyzzzzzzzkkkkuuuu...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nUnlucky year in Berland is such ...
[{"type": "stdin_stdout", "input": "433333986179614514 1000000000000000000 433333986179614515 726628630292055493\n", "output": "293294644112440978\n"}, {"type": "stdin_stdout", "input": "433333986179614514 1000001000000000000 433333986179614515 726628630292055493\n", "output": "293294644112440978\n"}, {"type": "stdin_s...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nA restaurant received n orders f...
[{"type": "stdin_stdout", "input": "20\n22 77\n13 50\n55 64\n16 52\n67 96\n49 51\n59 95\n2 25\n69 91\n2 24\n4 46\n50 74\n45 106\n39 55\n31 33\n9 33\n6 72\n14 67\n56 98\n69 152\n", "output": "5\n"}, {"type": "stdin_stdout", "input": "20\n22 77\n13 50\n55 64\n16 52\n62 96\n49 51\n59 95\n2 25\n69 91\n2 24\n4 46\n50 74\n45...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nYou have a set of four (4) balls...
[{"input": "4\n5", "output": "[\"It cannot be possible!\"]", "fn_name": "combs_non_empty_boxes"}, {"input": "20\n8", "output": "[15170932662679]", "fn_name": "combs_non_empty_boxes"}, {"input": "4\n3", "output": "[6]", "fn_name": "combs_non_empty_boxes"}, {"input": "4\n2", "output": "[7]", "fn_name": "combs_non_empty_b...
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 standing on top of an am...
[{"input": "[\"2016.img1\", \"2013.img3\", \"2016.img2\", \"2015.img3\", \"2012.img7\", \"2016.img4\", \"2013.img5\"]", "output": "[[\"2013.img5\", \"2015.img3\", \"2016.img1\", \"2016.img2\", \"2016.img4\", \"2016.img5\"]]", "fn_name": "sort_photos"}, {"input": "[\"2016.img7\", \"2016.img2\", \"2016.img3\", \"2015.img...
code_functional
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nYou are given an n × m table, co...
[{"type": "stdin_stdout", "input": "3 5\nGACGA\nAGCAG\nAGCAG\n", "output": "AGCGA\nCTATC\nAGCGA\n"}, {"type": "stdin_stdout", "input": "3 5\nAGGAC\nGACGA\nGACGA\n", "output": "AGAGC\nCTCTA\nAGAGC\n"}, {"type": "stdin_stdout", "input": "3 5\nAGCAG\nAGCAG\nGACGA\n", "output": "AGCGA\nCTATC\nAGCGA\n"}, {"type": "stdin_std...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nThe new ITone 6 has been release...
[{"type": "stdin_stdout", "input": "141 12 6\n66 53 86 91 12 27 5 74 79 50 33 2 100 26 2 73 16 14 50 86 75 9 66 48 19 34 25 1 22 50 63 39 38 42 98 71 76 27 80 16 74 21 36 1 32 20 65 28 68 40 41 6 0 77 65 84 0 34 60 0 42 65 2 16 25 85 35 57 74 66 26 33 39 14 0 6 2 15 87 99 47 67 75 63 72 32 93 7 5 63 35 99 89 61 18 25 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\n# Task\n A robot is standing at ...
[{"input": "[11, 8, 6, 6, 4, 3, 7, 2, 1]", "output": "[true]", "fn_name": "robot_walk"}, {"input": "[10, 3, 10, 2, 5, 1, 2]", "output": "[false]", "fn_name": "robot_walk"}, {"input": "[34241, 23434, 2341]", "output": "[false]", "fn_name": "robot_walk"}, {"input": "[9348, 2188, 9348]", "output": "[false]", "fn_name": "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\nHow much bigger is a 16-inch piz...
[{"input": "16", "output": "[\"pizzas: 4, slices: 0\"]", "fn_name": "how_many_pizzas"}, {"input": "12", "output": "[\"pizzas: 2, slices: 2\"]", "fn_name": "how_many_pizzas"}, {"input": "8", "output": "[\"pizzas: 1, slices: 0\"]", "fn_name": "how_many_pizzas"}, {"input": "6", "output": "[\"pizzas: 0, slices: 4\"]", "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\nLet's define `increasing` number...
[{"input": "50", "output": "[87959698326]", "fn_name": "total_inc_dec"}, {"input": "20", "output": "[40059819]", "fn_name": "total_inc_dec"}, {"input": "10", "output": "[277033]", "fn_name": "total_inc_dec"}, {"input": "6", "output": "[12952]", "fn_name": "total_inc_dec"}, {"input": "4", "output": "[1675]", "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\nTwo players decided to play one ...
[{"type": "stdin_stdout", "input": "2\n2 1 1\n2\n-1\n5 2 3\n1 3\n2 11 5\n", "output": "YES\nNO\n"}, {"type": "stdin_stdout", "input": "2\n2 1 1\n2\n-1\n5 2 3\n2 3\n2 2 5\n", "output": "YES\nNO\n"}, {"type": "stdin_stdout", "input": "2\n2 1 1\n2\n1\n5 2 3\n2 3\n-1 6 5\n", "output": "YES\nNO\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\nProblem\n\nGiven a permutation o...
[{"type": "stdin_stdout", "input": "0 3\n3 -1 1", "output": "Yes\n"}, {"type": "stdin_stdout", "input": "0 2\n6 11 1", "output": "Yes\n"}, {"type": "stdin_stdout", "input": "1 2\n10 2 2", "output": "Yes\n"}, {"type": "stdin_stdout", "input": "0 2\n10 2 2", "output": "Yes\n"}, {"type": "stdin_stdout", "input": "0 2\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\nRead problems statements in Mand...
[{"type": "stdin_stdout", "input": "3\n2\n0 4\n5\n0 2 10 2 3\n3\n1 1 1", "output": "4\n11\n1\n"}, {"type": "stdin_stdout", "input": "3\n2\n2 2\n5\n0 0 11 4 3\n3\n0 3 0", "output": "2\n11\n3\n"}, {"type": "stdin_stdout", "input": "3\n2\n0 2\n5\n1 2 12 2 3\n3\n1 0 1", "output": "2\n13\n2\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\nExample\n\nInput\n\n3\naab\nczc\...
[{"type": "stdin_stdout", "input": "3\naab\nccz\nbaa", "output": "aac\n"}, {"type": "stdin_stdout", "input": "3\nbba\nzcc\nbaa", "output": "aaz\n"}, {"type": "stdin_stdout", "input": "3\nabb\nzbc\nbaa", "output": "aab\n"}, {"type": "stdin_stdout", "input": "3\nbbb\nzcd\nbaa", "output": "abc\n"}, {"type": "stdin_stdout"...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nLet's call an array consisting o...
[{"type": "stdin_stdout", "input": "58 38\n6384 48910\n97759 90589\n28947 5031\n45169 32592\n85656 26360\n88538 42484\n44042 88351\n42837 79021\n96022 59200\n485 96735\n98000 3939\n3789 64468\n10894 58484\n26422 26618\n25515 95617\n37452 5250\n39557 66304\n79009 40610\n80703 60486\n90344 37588\n57504 61201\n62619 79797...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 string S of an odd length is s...
[{"type": "stdin_stdout", "input": "qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq\n", "output": "Yes\n"}, {"type": "stdin_stdout", "input": "kszhkbpphykinkezplvfjaqmpmqajfvlpzeknikyhppbkhzskokszhkbpphykinkezplvfjaqmpmqajfvlpzeknikyhppbkhzsk\n", "output": "Yes\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\nEveryone loves a freebie. Especi...
[{"type": "stdin_stdout", "input": "100\n98 63 672 100 254 218 623 415 426 986 920 915 736 795 407 541 382 213 935 743 961 59 660 512 134 935 248 378 739 356 543 714 28 667 602 596 759 791 103 564 225 520 159 542 966 332 983 655 517 273 95 242 593 940 286 236 41 318 941 727 384 225 319 627 982 359 232 769 854 172 643 5...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nWrite a program which print coor...
[{"type": "stdin_stdout", "input": "5\n-1 3\n1 15\n-1 1\n-1 -1\n-1 -1", "output": "-1 -1\n-1 -1\n-1 1\n-1 3\n1 15\n"}, {"type": "stdin_stdout", "input": "5\n-1 3\n1 15\n-1 0\n-1 -1\n-1 -1", "output": "-1 -1\n-1 -1\n-1 0\n-1 3\n1 15\n"}, {"type": "stdin_stdout", "input": "5\n-1 3\n1 22\n-1 0\n-1 -1\n-1 -1", "output": "-...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nMotorist Kojiro spent 10 years s...
[{"type": "stdin_stdout", "input": "386 20 29 30\n1 349\n2 482\n1 112\n1 93\n2 189\n1 207\n2 35\n2 -5\n1 422\n1 442\n1 402\n2 238\n3 258\n3 54\n2 369\n2 290\n2 329\n3 74\n3 -62\n2 170\n1 462\n2 15\n2 222\n1 309\n3 150\n1 -25\n3 130\n1 271\n1 -43\n351 250 91 102 0 286 123 93 100 205 328 269 188 83 73 35 188 223 73 215 1...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nThere are N cities. There are al...
[{"type": "stdin_stdout", "input": "25 4 4\n1 2\n3 3\n2 5\n6 7\n3 5\n4 3\n3 4\n6 7", "output": "1 1 1 1 1 2 2 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1\n"}, {"type": "stdin_stdout", "input": "27 0 1\n0 0\n2 10\n3 -1\n1 0", "output": "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"}, {"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\nVasily the bear has got a sequen...
[{"type": "stdin_stdout", "input": "39\n37749932 37750076 37750391 37750488 37750607 37750812 37750978 37751835 37752173 37752254 75497669 75497829 75497852 75498044 75498061 75498155 75498198 75498341 75498382 75498465 150994988 150994989 150995009 150995019 150995024 150995030 150995031 150995069 150995072 805306369 ...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 string t is called an anagram ...
[{"type": "stdin_stdout", "input": "??fb???a??\ndeeefc\n", "output": "0\n"}, {"type": "stdin_stdout", "input": "??fb???a??\ndedefc\n", "output": "0\n"}, {"type": "stdin_stdout", "input": "??fb???a??\ndedefd\n", "output": "0\n"}, {"type": "stdin_stdout", "input": "??a???bf??\ndedefd\n", "output": "0\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\nScheme? - Too loudly said. Just ...
[{"type": "stdin_stdout", "input": "3\n17\n7\n20", "output": "129140160\n2184\n486784383\n"}, {"type": "stdin_stdout", "input": "3\n19\n7\n21", "output": "162261457\n2184\n460353130\n"}, {"type": "stdin_stdout", "input": "3\n12\n13\n11", "output": "531444\n1594320\n177144\n"}, {"type": "stdin_stdout", "input": "3\n17\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 the world of birding there ar...
[{"input": "[\"Scarlet Tanager\", \"Great Blue Heron\", \"Eastern Phoebe\", \"American Black Duck\", \"Mallard\", \"Canvasback\", \"Merlin\", \"Ovenbird\"]", "output": "[[\"SCTA\", \"GBHE\", \"EAPH\", \"ABDU\", \"MALL\", \"CANV\", \"MERL\", \"OVEN\"]]", "fn_name": "bird_code"}, {"input": "[\"Fox Sparrow\", \"White-Wing...
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\nPermutation p is an ordered set ...
[{"type": "stdin_stdout", "input": "011\n", "output": "890786230\n"}, {"type": "stdin_stdout", "input": "13\n", "output": "695720788\n"}, {"type": "stdin_stdout", "input": "15\n", "output": "150347555\n"}, {"type": "stdin_stdout", "input": "11\n", "output": "890786230\n"}, {"type": "stdin_stdout", "input": "11\n", "out...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nYou are given an array consistin...
[{"type": "stdin_stdout", "input": "9\n100 50 6\n1 49\n51 100\n40 60\n30 70\n20 30\n70 80\n100 1 11\n1 1\n1 1\n1 1\n2 2\n2 100\n1 4\n2 3\n3 7\n5 6\n6 100\n4 5\n1 1 5\n1 1\n1 1\n1 1\n1 1\n1 1\n11 6 4\n6 6\n1 5\n7 11\n6 6\n3 3 2\n1 2\n2 3\n1000000000 1 1\n1 1000000000\n1000000000 1 1\n1 999999999\n1000000000 1 1\n2 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\nHardutta is planning an inter co...
[{"type": "stdin_stdout", "input": "73\n11 46\n78 14\n79 84\n3 7\n77 94\n67 62\n2 12\n12 46\n17 21\n89 35\n68 2\n76 10\n79 19\n58 78\n6 28\n35 16\n73 34\n67 80\n70 59\n53 21\n46 97\n36 80\n32 91\n14 26\n97 92\n42 100\n84 76\n28 32\n80 63\n86 39\n10 63\n66 86\n54 50\n77 71\n87 79\n43 99\n76 87\n82 35\n28 70\n5 37\n15 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\nLuba thinks about watering her g...
[{"type": "stdin_stdout", "input": "100 100\n2 46 24 18 86 90 31 38 84 49 58 28 15 80 14 24 87 56 62 87 41 87 55 71 87 32 41 56 91 32 24 75 43 42 35 30 72 53 31 26 54 61 87 85 36 75 44 31 7 38 77 57 61 54 70 77 45 96 39 57 11 8 91 42 52 15 42 30 92 41 27 26 34 27 3 80 32 86 26 97 63 91 30 75 14 7 19 23 45 11 8 43 44 73...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 Artem has invented a time...
[{"type": "stdin_stdout", "input": "10\n1 1 1000000000\n1 4 1000000000\n2 2 1000000000\n1 5 1000000000\n1 8 1000000000\n2 15 1000000000\n3 3 1000000000\n3 10 1000000000\n3 6 1000000000\n3 7 1000000000\n", "output": "0\n3\n2\n2\n"}, {"type": "stdin_stdout", "input": "10\n1 1 1000000000\n1 4 1000000000\n2 2 1000000000\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\nLittle boy Gerald studies at sch...
[{"type": "stdin_stdout", "input": "68 74\n51 54\n3 22\n12 24\n3 27\n32 42\n36 55\n60 64\n1 4\n4 23\n11 64\n54 62\n50 56\n21 34\n27 63\n15 54\n28 61\n13 57\n39 53\n12 32\n32 40\n33 67\n55 61\n33 67\n30 37\n15 49\n27 45\n21 41\n8 42\n24 63\n40 48\n28 41\n30 67\n0 4\n7 15\n27 59\n60 62\n25 65\n30 31\n38 67\n24 43\n14 64\...
code_stdio