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\nVasya learns to type. He has an ...
[{"type": "stdin_stdout", "input": "10 10 2\nfriuxvShvg\nerslojqtgu\nzeqsmdewry\nwvhbeeyeSu\ngkofbjaavr\ntwkcdxugps\nnzlylSmafu\nstamkpxnzt\nuwxwximkrm\nmzxyboazbl\n100\nmRIfAtrLKmztpVkAmojDCiIgseBwlUilBIiyDQhqNhNAqVLLIobuCIretLdSvixNNdCiouFMXtwHZFlObCeaygmIiFBfaCirbmCa\n", "output": "19\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\nCity X consists of n vertical an...
[{"type": "stdin_stdout", "input": "9\n4 5\n2 3\n8 3\n5 6\n9 3\n4 4\n5 4\n4 7\n1 7\n8 4\n1 4\n1 5\n5 7\n7 8\n7 1\n9 9\n8 7\n7 5\n3 7\n6 6\n7 3\n5 2\n3 6\n7 4\n9 6\n5 8\n9 7\n6 3\n7 9\n1 2\n1 1\n6 2\n5 3\n7 2\n1 6\n4 1\n6 1\n8 9\n2 2\n3 9\n2 9\n7 7\n2 8\n9 4\n2 5\n8 6\n3 4\n2 1\n2 7\n6 5\n9 1\n3 3\n3 8\n5 5\n4 3\n3 1\n1...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nLet's call a string \"s-palindro...
[{"type": "stdin_stdout", "input": "mmmmmmmmmmmmmmmm\n", "output": "NIE\n"}, {"type": "stdin_stdout", "input": "mmmmmmmmmmmmmmmm\n", "output": "NIE\n"}, {"type": "stdin_stdout", "input": "mmmmmmmmmmmmmmmn\n", "output": "NIE\n"}, {"type": "stdin_stdout", "input": "nnnnnnnnnnnnn\n", "output": "NIE\n"}, {"type": "stdin_st...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nYou have a team of N people. For...
[{"type": "stdin_stdout", "input": "1000000000 5000\n", "output": "642932262\n"}, {"type": "stdin_stdout", "input": "1000000000 5000\n", "output": "642932262\n"}, {"type": "stdin_stdout", "input": "158260522 4575\n", "output": "875142289\n"}, {"type": "stdin_stdout", "input": "602436426 4445\n", "output": "582490088\n"...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nYou are given a polynomial of de...
[{"type": "stdin_stdout", "input": "0\n461740266", "output": "2\n3\n13\n1327\n1487\n"}, {"type": "stdin_stdout", "input": "0\n1326078230", "output": "2\n5\n1051\n126173\n"}, {"type": "stdin_stdout", "input": "0\n754892205", "output": "3\n5\n41\n853\n1439\n"}, {"type": "stdin_stdout", "input": "0\n732779016", "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\nSitting in a station waiting roo...
[{"type": "stdin_stdout", "input": "1222\n", "output": "1+2+2+2=7\n"}, {"type": "stdin_stdout", "input": "0290\n", "output": "0-2+9+0=7\n"}, {"type": "stdin_stdout", "input": "3242\n", "output": "3+2+4-2=7\n"}, {"type": "stdin_stdout", "input": "2364", "output": "2+3+6-4=7\n"}, {"type": "stdin_stdout", "input": "1114",...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 will receive a st...
[{"input": "\"dasf6ds65f45df65gdf651vdf5s1d6g5f65vqweAQWIDKsdds\"", "output": "[\"adefgqsvwADIKQW1456-dfgsv156-dfs56-dfs56-dfs56-df56-d5-d\"]", "fn_name": "blocks"}, {"input": "\"SDF45648374RHF8BFVYg378rg3784rf87g3278bdqG\"", "output": "[\"bdfgqrBDFGHRSVY2345678-grF3478-gF3478-3478-78-8\"]", "fn_name": "blocks"}, {"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\nAmidakuji is a traditional metho...
[{"type": "stdin_stdout", "input": "100 8 8\n", "output": "467571711\n"}, {"type": "stdin_stdout", "input": "100 8 3\n", "output": "938282570\n"}, {"type": "stdin_stdout", "input": "100 8 1\n", "output": "755868507\n"}, {"type": "stdin_stdout", "input": "15 8 5\n", "output": "437760187\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\nSherlock Holmes found a mysterio...
[{"type": "stdin_stdout", "input": "10\njrojjyqqjtrfjf\nvuwzvmwjyfvifdfddymwfuzmvvummwdfzjzdvzuvfvjiuvyzymviyyumvziyimfzfiji\nwxzwojjzqzyqlojjbrjlbqrrwqw\nqfwppnuvbgegbqgbmeqpbguwmmqhunnquepepeewubbmnenvmwhnvhunnmsqmmgfepevupewvenmwpmgspnebv\nrxqzorkizznsiirciokscrrjqqqzkfijrrkkfrqjjifczcjcnqoisorszkjxcxvqzcfczqfcrvfrs...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 last contest held on Johnny'...
[{"type": "stdin_stdout", "input": "3\n576460752303423484\n576460752303423484\n576460752303423485\n", "output": "1152921504606846911\n1152921504606846911\n1152921504606846912\n"}, {"type": "stdin_stdout", "input": "3\n576460752303423484\n576460752303423484\n576460752303423485\n", "output": "1152921504606846911\n1152921...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nAuthors have come up with the st...
[{"type": "stdin_stdout", "input": "6 5\n5 6 1 2 3 4\n6 5 1 2 3 4\n", "output": "YES\nbcdeaa\n"}, {"type": "stdin_stdout", "input": "6 5\n5 6 1 2 3 4\n6 5 1 2 3 4\n", "output": "YES\nbcdeaa\n"}, {"type": "stdin_stdout", "input": "5 2\n5 2 4 3 1\n5 4 3 1 2\n", "output": "YES\nbbbba\n"}, {"type": "stdin_stdout", "input":...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nYou are given a set of $2n+1$ in...
[{"type": "stdin_stdout", "input": "1000000000000000000 1000000000000000000\n", "output": "1\n"}, {"type": "stdin_stdout", "input": "1 1000000000000000000\n", "output": "1000000000000000000\n"}, {"type": "stdin_stdout", "input": "1000000001 1000000000000000000\n", "output": "1000000000\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\nAn AI has infected a text with a...
[{"input": "\"_3ebzgh4\"\n\"&\"", "output": "[\"&&&&&&&&\"]", "fn_name": "contamination"}, {"input": "\"//case\"\n\" \"", "output": "[\" \"]", "fn_name": "contamination"}, {"input": "\"abc\"\n\"z\"", "output": "[\"zzz\"]", "fn_name": "contamination"}, {"input": "\"abc\"\n\"\"", "output": "[\"\"]", "fn_name": "cont...
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\nKostya likes the number 4 much. ...
[{"type": "stdin_stdout", "input": "5\n794947\n1850\n2424\n119\n24", "output": "2\n0\n2\n0\n1\n"}, {"type": "stdin_stdout", "input": "5\n447474\n228\n6664\n40\n81\n", "output": "4\n0\n1\n1\n0\n"}, {"type": "stdin_stdout", "input": "5\n1167956\n340\n2424\n40\n42", "output": "0\n1\n2\n1\n1\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\nPolycarp starts his own business...
[{"type": "stdin_stdout", "input": "30\n522692116 159\n589719489 488\n662495181 961\n915956552 470\n683572975 271\n498400137 480\n327010963 181\n200704287 367\n961198611 54\n978100746 208\n345455616 986\n106372142 876\n446972337 42\n309349333 200\n93462198 543\n167946793 318\n325598940 427\n121873339 459\n174934933 598...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nFox Ciel is going to publish a p...
[{"type": "stdin_stdout", "input": "10\npetr\negor\nendagorion\nfeferivan\nilovetanyaromanova\nkoatks\ndmitriyh\nmaratsnowbear\nbredorjaguarturnik\ncgyforever\n", "output": "aghjlopqrstuvwxyznefikdmbc\n"}, {"type": "stdin_stdout", "input": "10\npetr\negor\nendagorion\nfeferivan\nilovetanyaromanova\nkoatks\ndmitriyh\nma...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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...
[{"input": "15", "output": "[\"1 1\\n 2 2 \\n 3 3 \\n 4 4 \\n 5 5 \\n 6 6 \\n 7 7 \\n 8 8 \\n 9 9 \\n ...
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 three points marked on...
[{"type": "stdin_stdout", "input": "1000000000 -1000000000\n1000000000 1000000000\n-1000000000 -1000000000\n", "output": "2\n"}, {"type": "stdin_stdout", "input": "1000000000 -1000000000\n1000000000 1000000000\n-1000000000 -1000000000\n", "output": "2\n"}, {"type": "stdin_stdout", "input": "1000000000 -1000000000\n1000...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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\n\nFish are an ...
[{"input": "\"111111111111111111112222222222\"", "output": "[5]", "fn_name": "fish"}, {"input": "\"151128241212192113722321331\"", "output": "[5]", "fn_name": "fish"}, {"input": "\"111122223333\"", "output": "[4]", "fn_name": "fish"}, {"input": "\"111111111111\"", "output": "[3]", "fn_name": "fish"}, {"input": "\"11112...
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\nGigi is a clever monkey, living ...
[{"input": "\"abcdefghijklmnopqrstuvwxyz\"", "output": "[8]", "fn_name": "countzero"}, {"input": "\"1234567890\"", "output": "[5]", "fn_name": "countzero"}, {"input": "\"0oO0oO\"", "output": "[6]", "fn_name": "countzero"}, {"input": "\"BRA\"", "output": "[3]", "fn_name": "countzero"}, {"input": "\"()\"", "output": "[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\nCreate a function that will retu...
[{"input": "[2, 4, 6, 8, 10, 12, 14, 16, 18, 22]", "output": "[false]", "fn_name": "validate_sequence"}, {"input": "[2, 4, 6, 8, 10, 12, 13, 16, 18, 20]", "output": "[false]", "fn_name": "validate_sequence"}, {"input": "[2, 4, 6, 8, 10, 12, 14, 16, 18, 20]", "output": "[true]", "fn_name": "validate_sequence"}, {"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\nWherever the destination is, who...
[{"type": "stdin_stdout", "input": "20 50000 50000\n2 45955 55488\n1 19804 29337\n2 3767 90811\n2 24025 33558\n1 46985 56518\n2 21094 30627\n2 5787 15320\n1 4262 91306\n2 37231 46764\n1 18125 27658\n1 36532 12317\n1 31330 40863\n1 18992 28525\n1 29387 38920\n1 44654 54187\n2 45485 55018\n2 36850 46383\n1 44649 54182\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\nXXI Berland Annual Fair is comin...
[{"type": "stdin_stdout", "input": "78 74\n20194 1621 21498 13827 31277 19791 6583 13579 11160 20419 26490 160 3450 12925 18134 10381 27009 28815 10209 6478 18504 15371 32608 14197 12075 13723 12612 19020 28762 11057 12891 31164 16684 13717 19933 25453 2742 4955 6814 2863 10397 15461 20616 10905 2600 20137 4681 9199 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\nFrog Gorf is traveling through S...
[{"type": "stdin_stdout", "input": "19\n1 1 3 4 5 3 5 0 0 6 3 1 10 3 13 9 1 4 2\n3 0 6 3 8 6 8 7 8 6 0 0 5 0 0 1 1 1 0\n", "output": "5\n17 15 2 1 0\n"}, {"type": "stdin_stdout", "input": "19\n1 1 3 4 5 3 5 11 0 6 5 3 10 3 13 9 1 4 17\n3 0 6 3 8 6 8 7 8 6 -1 0 5 0 0 1 1 1 0\n", "output": "3\n2 1 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\nIvan had string s consisting of ...
[{"type": "stdin_stdout", "input": "20\nadabacabaeabacabada 1 359\nabadabacabafabaca 1 213\nacabagabacaba 1 315\ncabaeabacabadabacab 1 268\nfabacabadabacabaeab 1 352\ncabafabacabada 1 28\nacabadabacabaea 1 67\ncabadabacabaeabacaba 1 484\nabacabadabacaba 1 209\nacabaiabacaba 1 251\nacabafabacabadabac 1 475\nabacabaeabac...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nWrite a program which reads $n$ ...
[{"type": "stdin_stdout", "input": "3\n-1 10 1 14 13 17\n6 0 35 1 0 0\n4 4 2 7 -1 -1", "output": "Yes\n"}, {"type": "stdin_stdout", "input": "3\n-1 10 1 14 13 17\n6 0 35 1 0 0\n4 4 2 5 -1 -1", "output": "Yes\n"}, {"type": "stdin_stdout", "input": "3\n0 10 1 14 9 17\n6 0 35 1 0 0\n13 4 2 7 -1 -1", "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\nPolycarp was given an array of $...
[{"type": "stdin_stdout", "input": "50\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\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\nWelcome to another task about br...
[{"type": "stdin_stdout", "input": "100\nmntyyerijtaaditeyqvxstrwxoxglpaubigaggtrepaegniybvfmssawvhrgjjhwwkwuqhtyrimxvolcstyllbhlcursvgfafpts\nbsgmhsgavsbgtwiiqaigmtyjxihphxdlseeajfywugawigrjruttuykthfrvwagpcsxlxsopnarqcvetnbtvfrvlyymwoyelrlta\n", "output": "300\n67 1 100 88 1 100 93 1 100 70 1 100 46 1 100 96 1 100 88...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nConnected undirected graph witho...
[{"type": "stdin_stdout", "input": "51\n28 3\n42 40\n40 51\n48 20\n13 28\n18 40\n44 40\n22 5\n22 27\n45 34\n40 9\n34 46\n40 34\n22 1\n22 11\n40 7\n28 40\n40 22\n14 40\n34 30\n40 20\n47 40\n12 34\n28 23\n40 24\n40 43\n41 40\n28 15\n49 32\n40 8\n32 10\n40 50\n40 36\n40 21\n16 33\n40 38\n34 2\n28 16\n34 4\n17 34\n19 40\n3...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nWhile Mahmoud and Ehab were prac...
[{"type": "stdin_stdout", "input": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\nbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 [Chinese zodiac](https://en....
[{"input": "6673", "output": "[\"Water Rooster\"]", "fn_name": "chinese_zodiac"}, {"input": "1968", "output": "[\"Earth Monkey\"]", "fn_name": "chinese_zodiac"}, {"input": "2323", "output": "[\"Water Rabbit\"]", "fn_name": "chinese_zodiac"}, {"input": "1938", "output": "[\"Earth Tiger\"]", "fn_name": "chinese_zodiac"},...
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\nTaro is addicted to a novel. The...
[{"type": "stdin_stdout", "input": "3 9\n1051\n300\n800\n200\n100\n600\n900\n1032\n400\n4 3\n1000\n1000\n1000\n0 0", "output": "2151\n1000\n"}, {"type": "stdin_stdout", "input": "3 9\n1051\n300\n800\n200\n100\n600\n900\n1032\n400\n4 3\n1000\n1000\n1001\n0 0", "output": "2151\n1001\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\nA binary heap which satisfies ma...
[{"type": "stdin_stdout", "input": "10\n-1 2 2 0 140 11 1 1 12 5", "output": " 140 12 11 1 5 2 1 -1 0 2\n"}, {"type": "stdin_stdout", "input": "10\n0 2 2 0 140 11 1 -1 12 5", "output": " 140 12 11 0 5 2 1 -1 0 2\n"}, {"type": "stdin_stdout", "input": "10\n1 -1 0 0 15 18 1 -1 -1 2", "output": " 18 15 1 0 2 0 1 -1 -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\nThe store sells $n$ beads. The c...
[{"type": "stdin_stdout", "input": "1\n364 1485\naaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaabbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccddddddddddddddddddddddddddeeeeeeeeeeeeeeeeeeeeeeefffffffffffffffffffffffffffgggggggggggggggggggggggggggggggggggggggghhhhhhh...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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:\nThis kata asks you to m...
[{"input": "\"100\"\n\"1111111111\"", "output": "[\"0101010101\"]", "fn_name": "interpreter"}, {"input": "\"0\"\n\"100010001\"", "output": "[\"100010001\"]", "fn_name": "interpreter"}, {"input": "\"10\"\n\"1100101\"", "output": "[\"0011010\"]", "fn_name": "interpreter"}, {"input": "\"101010\"\n\"111\"", "output": "[\"0...
code_functional
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nCodeforces user' handle color de...
[{"type": "stdin_stdout", "input": "9\nmwAz9lQ 1786 -1631\nnYgYFXZQfY -1849 -1775\nKU4jF -1773 -3376\nopR 3752 2931\nGl -1481 -1002\nR -1111 3778\n0i9B21DC 3650 279\nQ8L2dS0 358 -3305\ng -2662 3968\n", "output": "NO\n"}, {"type": "stdin_stdout", "input": "9\nmwAz9lQ 1786 -1631\nnYgYFXZQfY -1849 -1775\nKU4jF -1773 -3376...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nPolycarp thinks about the meanin...
[{"type": "stdin_stdout", "input": "babbbbabbabbbababbabbbbbbabaabaababaaabbbbbabbbbaaaaabbaaabbaabaabbbbabbbababbabaaabbababaaababbbaaa\n", "output": "babababababababababababa\n"}, {"type": "stdin_stdout", "input": "aaabbbabaaabababbaaababbababbbabbbbaabaabbaaabbaaaaabbbbabbbbbaaababaabaababbbbbbabbababbbabbabbbbab\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 got to a sale of old TV...
[{"type": "stdin_stdout", "input": "99 17\n-993 -1745 -959 -989 -991 -995 -976 -997 -990 -1000 -996 -994 -999 -354 -1000 -983 -979 -1000 -989 -968 -994 -992 -962 -1593 -999 -983 -991 -979 -995 -993 -973 -999 -995 -995 -999 -993 -995 -992 -947 -1000 -999 -998 -982 -988 -757 -993 -426 -988 -980 -990 -979 -976 -995 -999 -...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 can't possibly imagine how c...
[{"type": "stdin_stdout", "input": "7938986881993\n", "output": "1\n378028993\n"}, {"type": "stdin_stdout", "input": "472670214391\n", "output": "1\n23020027\n"}, {"type": "stdin_stdout", "input": "1468526771489\n", "output": "1\n613783\n"}, {"type": "stdin_stdout", "input": "1245373417369\n", "output": "1\n908209\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\nConsider creating the following ...
[{"type": "stdin_stdout", "input": "4823108376\n2273064329\n0123456789", "output": "5\n1\n4\n"}, {"type": "stdin_stdout", "input": "4823108376\n2314825047\n0123456789", "output": "5\n4\n4\n"}, {"type": "stdin_stdout", "input": "4823108376\n1842094049\n0123456789", "output": "5\n0\n4\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\nThere is a directed graph with N...
[{"type": "stdin_stdout", "input": "2500 5000 0\n1206 2272 100000\n315 2399 100000\n1186 1435 100000\n303 1569 100000\n2364 581 100000\n1683 1969 100000\n700 1088 100000\n717 410 100000\n1412 1595 100000\n2066 813 100000\n1190 949 100000\n258 2307 100000\n423 2263 100000\n671 425 100000\n1712 1110 100000\n787 1469 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\n# Task\n The sequence of `Chando...
[{"input": "123", "output": "[97530]", "fn_name": "nth_chandos_number"}, {"input": "23", "output": "[3280]", "fn_name": "nth_chandos_number"}, {"input": "9", "output": "[630]", "fn_name": "nth_chandos_number"}, {"input": "2", "output": "[25]", "fn_name": "nth_chandos_number"}, {"input": "1", "output": "[5]", "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\nFor given two segments s1 and s2...
[{"type": "stdin_stdout", "input": "3\n-1 -1 -1 -6 -1 1 1 1\n0 -1 18 -1 2 0 -1 2\n-11 1 2 -1 0 2 -1 0", "output": "2.0000000000\n1.0000000000\n0.5322001449\n"}, {"type": "stdin_stdout", "input": "3\n-1 -1 -1 -6 -1 1 1 1\n0 -1 18 -1 2 0 -1 2\n-11 1 3 -1 0 2 -1 0", "output": "2.0000000000\n1.0000000000\n0.4242640687\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\nWrite a function, which takes a ...
[{"input": "359999", "output": "[\"99:59:59\"]", "fn_name": "make_readable"}, {"input": "86399", "output": "[\"23:59:59\"]", "fn_name": "make_readable"}, {"input": "86400", "output": "[\"24:00:00\"]", "fn_name": "make_readable"}, {"input": "3599", "output": "[\"00:59:59\"]", "fn_name": "make_readable"}, {"input": "3600...
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\nTaro is playing with a puzzle th...
[{"type": "stdin_stdout", "input": "2\n-1 2 3 3 4 10 8 13 9\n6 5 1 7 39 9 1 2 3\n7 11 11 2 -1 3 2 5 8\n2 4 0 1 6 9 12 9 0\n0 8 7 8 9 1 2 1 4\n8 9 1 0 3 4 2 8 7\n1 4 5 8 7 8 9 1 3\n8 12 8 9 1 4 3 4 5\n12 0 2 3 4 0 13 7 0\n2 1 3 2 5 4 7 8 14\n4 5 6 7 8 9 0 1 3\n7 8 13 1 4 4 8 5 8\n2 6 4 8 6 7 8 9 1\n5 6 12 8 9 1 2 6 3\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\nAnya loves to watch horror movie...
[{"type": "stdin_stdout", "input": "138 245 30\n3 5 6 8 9 13 15 16 19 20 24 25 27 29 30 32 33 34 35 36 37 38 40 42 47 51 52 53 55 56 58 59 63 66 67 68 69 72 73 74 75 77 78 80 81 82 85 86 87 89 91 93 95 96 99 100 102 104 105 108 110 111 112 117 122 124 125 128 129 131 133 136 139 144 145 146 147 148 149 151 153 155 156 ...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nYour search for Heidi is over – ...
[{"type": "stdin_stdout", "input": "80 4\n71 49 41 21 72 71 37 14 51 59 73 11 70 15 36 46 32 57 58 15 72 67 16 75 70 11 67 3 40 36 2 9 63 68 32 22 63 52 67 55 35 19 72 59 22 19 44 55 59 74 4 34 53 3 22 57 32 27 78 12 71 4 26 15 43 21 79 10 67 39 34 74 38 26 31 78 2 78 69 42\n", "output": "62\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\nThe robot is placed in the top l...
[{"type": "stdin_stdout", "input": "3\n2 3 1 3 0\n2 3 1 3 1\n5 5 3 4 1\n", "output": "3\n-1\n8\n"}, {"type": "stdin_stdout", "input": "2\n3 5 2 3 1\n5 3 3 2 1\n", "output": "-1\n-1\n"}, {"type": "stdin_stdout", "input": "2\n2 3 1 3 0\n2 3 1 3 1\n", "output": "3\n-1\n"}, {"type": "stdin_stdout", "input": "2\n3 3 2 2 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\nYou are given two strings s and ...
[{"type": "stdin_stdout", "input": "ccaaa?bc?baccbccccbca?cccab??aacccbaac?bccacc?accccaccbcbbcbc\ncbaaacccc\n", "output": "ccaaaabcabaccbccccbcaacccabaaaacccbaaczbccacczaccccaccbcbbcbc\n"}, {"type": "stdin_stdout", "input": "ccaaa?bc?baccbccccbca?cccab??aacccbaac?bccacc?accccaccbcbbcbc\ncbaaacccc\n", "output": "ccaaaa...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nHarry Water, Ronaldo, Her-my-oh-...
[{"type": "stdin_stdout", "input": "2\n10\n10\n", "output": "200\n"}, {"type": "stdin_stdout", "input": "2\n19\n10\n", "output": "380\n"}, {"type": "stdin_stdout", "input": "2\n4\n18\n", "output": "144\n"}, {"type": "stdin_stdout", "input": "2\n6\n18\n", "output": "216\n"}, {"type": "stdin_stdout", "input": "2\n6\n23\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\nIt is nighttime and Joe the Elus...
[{"type": "stdin_stdout", "input": "95 97575868 5\n4612 1644 3613 5413 5649 2419 5416 3926 4610 4419 2796 5062 2112 1071 3790 4220 3955 2142 4638 2832 2702 2115 2045 4085 3599 2452 5495 4767 1368 2344 4625 4132 5755 5815 2581 6259 1330 4938 815 5430 1628 3108 4342 3692 2928 1941 3714 4498 4471 4842 1822 867 3395 2587 3...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nWrite a function ```convert_temp...
[{"input": "128.25\n\"Ro\"\n\"C\"", "output": "[230]", "fn_name": "convert_temp"}, {"input": "373.15\n\"K\"\n\"N\"", "output": "[33]", "fn_name": "convert_temp"}, {"input": "-273.15\n\"C\"\n\"R\"", "output": "[0]", "fn_name": "convert_temp"}, {"input": "-30\n\"De\"\n\"K\"", "output": "[393]", "fn_name": "convert_temp"}...
code_functional
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nThe Metropolis computer network ...
[{"type": "stdin_stdout", "input": "10 40 10\n838 215 738 782 183 422 127 283 103 129\n1 2\n1 4\n1 5\n1 6\n1 7\n1 8\n1 9\n1 10\n2 3\n2 4\n2 5\n2 6\n2 7\n2 8\n2 9\n2 10\n3 3\n3 5\n3 6\n3 7\n3 8\n3 9\n3 10\n4 5\n4 6\n4 7\n4 9\n4 10\n5 7\n5 8\n5 9\n5 10\n6 7\n6 8\n6 9\n6 10\n7 9\n7 10\n8 10\n9 10\n", "output": "1028608\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\nUnscramble the eggs.\n\nThe stri...
[{"input": "\"veggegeggyeggmeggitegge onegg teggoaseggtegg\"", "output": "[\"vegymite on toast\"]", "fn_name": "unscramble_eggs"}, {"input": "\"seggceggreggameggbeggleggedegg egegggeggsegg\"", "output": "[\"scrambled eggs\"]", "fn_name": "unscramble_eggs"}, {"input": "\"Heggeleggleggo weggoreggleggdegg\"", "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\nThe student council has a shared...
[{"type": "stdin_stdout", "input": "5\n3\nTMT\n3\nTMT\n6\nTMTMTT\n6\nTMTTTT\n6\nTTMMTT\n", "output": "YES\nYES\nYES\nNO\nYES\n"}, {"type": "stdin_stdout", "input": "5\n3\nTMT\n3\nMTT\n6\nTMTMTT\n6\nTMTTTT\n6\nTTMMTT\n", "output": "\nYES\nNO\nYES\nNO\nYES\n"}, {"type": "stdin_stdout", "input": "5\n3\nTMT\n3\nMTT\n6\nTMT...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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\nThere are $n$ people who want to...
[{"type": "stdin_stdout", "input": "4\n14\n2 6 5 9 5 8 13 14 12 5 6 14 5 2\n36\n15 22 27 14 23 36 10 17 33 21 18 22 3 4 32 24 8 19 36 22 17 11 24 10 33 4 30 6 2 17 11 16 18 1 2 20\n2\n2 2\n12\n4 9 10 6 1 9 5 8 12 9 9 12\n", "output": "3\n11\n1\n4\n"}, {"type": "stdin_stdout", "input": "4\n14\n2 6 5 9 5 8 13 14 12 5 6 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\nAlice has a string $s$. She real...
[{"type": "stdin_stdout", "input": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\n", "output": "50\n"}, {"type": "stdin_stdout", "input": "ababababababababababababababababababababababababav\n", "output": "49\n"}, {"type": "stdin_stdout", "input": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\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\nAs their story unravels, a timel...
[{"type": "stdin_stdout", "input": "5\n7\n?R???BR\n7\n???R???\n1\n?\n1\nB\n10\n?R??RB??B?\n", "output": "BRBRBBR\nBRBRBRB\nR\nB\nBRBRRBRBBR\n"}, {"type": "stdin_stdout", "input": "5\n7\n?R???BR\n7\n???R???\n1\n?\n1\nB\n10\n?R??RB??B?\n", "output": "BRBRBBR\nBRBRBRB\nB\nB\nBRBRRBRBBR\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\nPrior to having fancy iPhones, t...
[{"input": "\"WHERE DO U WANT 2 MEET L8R\"", "output": "[47]", "fn_name": "presses"}, {"input": "\"IS NE1 OUT THERE\"", "output": "[31]", "fn_name": "presses"}, {"input": "\"#codewars #rocks\"", "output": "[36]", "fn_name": "presses"}, {"input": "\"HOW R U\"", "output": "[13]", "fn_name": "presses"}, {"input": "\"ZER0\...
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 want to go on a trip with a ...
[{"type": "stdin_stdout", "input": "10000\n1225 3150\n861 12737\n0 -1\n5000 1050\n5000 4211\n5000 412\n5000 5000\n5000 5000\n-1 -1\n5075 1951\n9143 2494\n5000 2100\n29170\n100000 000000\n100010 110000\n100000 100000\n100000 100000\n100100 100100\n100000 111000\n100000 100000\n101000 100000\n100000 100010\n100000 100000...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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, Norge found a string $...
[{"type": "stdin_stdout", "input": "200 13\nvgfjhgkgwkftaeqejmbgildembgxdbskxfndwmcckjfkbeekxkgakmcjhclqsecpnkaigcxxhfghgegfadjktckftdhtifriemfifakygoesjfginnddjjklwiwlbjsgftwhtjdxmcadpvhaeddxwnmguwhetwbmffbmvdvuhecgjckddrbikgwkrfwfhdhqolidgkfm\na b c d e f g h i j k l m\n", "output": "578\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\nMasha and Grisha like studying s...
[{"type": "stdin_stdout", "input": "1\n100\n74 14 24 45 22 9 49 78 79 20 60 1 31 91 32 39 90 5 42 57 30 58 64 68 12 11 86 8 3 38 76 17 98 26 85 92 56 65 89 66 36 87 23 67 13 48 15 47 81 73 117 50 34 93 82 44 77 69 96 100 41 19 35 16 88 27 99 40 62 95 70 18 46 21 53 59 37 6 61 71 2 4 52 28 97 25 29 51 7 33 80 83 72 10 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\nLord Omkar has permitted you to ...
[{"type": "stdin_stdout", "input": "80\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\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\nAs Famil Door’s birthday is comi...
[{"type": "stdin_stdout", "input": "1980 464\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 \"BerCorp\" company has got ...
[{"type": "stdin_stdout", "input": "100 100\n1 33\n0\n2 35 4\n2 40 78\n1 69\n0\n1 2\n0\n0\n2 81 34\n1 45\n0\n1 87\n1 50\n1 97\n0\n2 100 59\n0\n0\n0\n1 45\n0\n0\n0\n1 6\n1 54\n0\n0\n0\n4 79 96 52 84\n1 86\n0\n0\n0\n0\n0\n0\n0\n0\n3 90 2 80\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n1 2\n0\n1 64\n0\n1 78\n1 82\n0\n0\n0\n0\n0\n1 6\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\nThe classic programming language...
[{"type": "stdin_stdout", "input": "101\nX++\nX++\nX++\n++X\n--X\nX--\nX++\nX--\nX--\n--X\n--X\n++X\nX++\n++X\n++X\nX--\n--X\n++X\nX++\nX--\n++X\n--X\n--X\n--X\n++X\n--X\n++X\nX++\nX++\n++X\n--X\nX++\nX--\nX++\n++X\n++X\nX--\nX--\nX--\nX++\nX++\nX--\nX--\nX++\n++X\n++X\n++X\n--X\n--X\n++X\nX--\nX--\n--X\n++X\nX--\n++X\...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 story of 20XX. The n...
[{"type": "stdin_stdout", "input": "6\n1 1\n.\n3 3\n...\n.W.\n...\n10 10\n..........\n.DDDDCCC..\n.DDDDCCC..\n.DDDDCCC..\nADDDDCCC..\nAAA..CCC..\n..CBBBBAAA\nAAABBBB...\n..BBBBB...\n..........\n10 10\n..........\n.DDDDDD...\n.DDDDCCC..\n.DDDDCCC..\nADDDDCCC..\nAAA.-CCC..\nAAABBBBC..\nAAABBBB...\n..BBBBB...\n..........\...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nProblem F Pizza Delivery\n\nAlys...
[{"type": "stdin_stdout", "input": "4 5\n1 3 7\n4 2 6\n4 3 0\n2 1 34\n3 3 12", "output": "SOSO\nSOSO\nHAPPY\nHAPPY\nSOSO\n"}, {"type": "stdin_stdout", "input": "4 5\n1 1 5\n3 4 6\n4 2 13\n2 1 6\n2 3 17", "output": "SOSO\nSOSO\nSOSO\nHAPPY\nSOSO\n"}, {"type": "stdin_stdout", "input": "4 5\n1 3 5\n3 4 6\n2 2 7\n2 1 1\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\nBilly investigates the question ...
[{"type": "stdin_stdout", "input": "91\n4000000 3000000 2900000 2511334 2511333 2102003 1901011 1700000 1200000 999999 800000 750000 600000 508111 202000 101000 35000 20000 9000 5000 2000 899 630 629 628 627 626 625 624 623 622 621 620 619 618 617 616 615 614 613 612 611 610 609 608 607 606 605 604 603 602 601 504 405 ...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nThis problem is a simplified ver...
[{"type": "stdin_stdout", "input": "10\n10\n25 25 7 61 97 -47 43 7 -11 -29\n10\n44 -10 -10 -64 -64 98 -64 62 -10 -64\n10\n20 50 65 35 65 -40 50 20 -55 -10\n10\n7 -91 -77 -91 -21 7 77 35 21 -7\n10\n56 -76 78 12 -54 -43 23 1 -65 45\n10\n-68 12 -88 -48 52 -8 -28 -8 92 -88\n10\n55 -2 -2 74 36 -59 -59 55 36 -78\n10\n70 -66 ...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 playing a game of Spacesh...
[{"type": "stdin_stdout", "input": "2\n4 4\n9\n1 1 1\n1 2 1\n1 3 1\n2 1 2\n2 2 2\n2 3 2\n2 3 1\n2 2 1\n2 1 1\n", "output": "7\n6\n5\n4\n3\n2\n2\n3\n4\n"}, {"type": "stdin_stdout", "input": "2\n4 4\n9\n1 1 1\n1 2 1\n1 3 1\n2 1 2\n2 2 2\n2 3 2\n2 3 1\n2 2 1\n2 1 1\n", "output": "7\n6\n5\n4\n3\n2\n2\n3\n4\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\nJohn Smith knows that his son, T...
[{"type": "stdin_stdout", "input": "18\n68 32 84 6\n44 53 11 21\n61 34 77 82\n19 36 47 58\n47 73 31 96\n17 50 82 16\n57 90 64 8\n14 37 45 69\n48 1 18 58\n42 34 96 14\n56 82 33 77\n40 66 30 53\n33 31 44 95\n0 90 24 8\n7 85 39 1\n76 77 93 35\n98 9 62 13\n24 84 60 51\n", "output": "8\n"}, {"type": "stdin_stdout", "input":...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nYou are given a matrix with $n$ ...
[{"type": "stdin_stdout", "input": "4\n2 2\n1 1\n0 1\n2 3\n1 1 0\n1 0 0\n3 7\n1 0 1 1 1 1 1\n0 0 0 0 0 0 0\n1 0 1 1 1 0 1\n2 5\n1 0 1 0 0\n1 1 1 1 0\n-1 1 1 0 0\n", "output": "0\n3\n5\n4\n"}, {"type": "stdin_stdout", "input": "4\n2 2\n1 1\n0 1\n2 3\n1 1 1\n1 0 0\n3 7\n1 0 1 1 1 1 1\n0 0 1 0 0 1 0\n1 0 1 0 1 0 1\n2 5\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\nHere's a way to construct a list...
[{"input": "1000000000", "output": "[[73411, 65788]]", "fn_name": "rat_at"}, {"input": "10", "output": "[[5, 2]]", "fn_name": "rat_at"}, {"input": "0", "output": "[[1, 1]]", "fn_name": "rat_at"}, {"input": "3", "output": "[[1, 3]]", "fn_name": "rat_at"}, {"input": "4", "output": "[[3, 2]]", "fn_name": "rat_at"}]
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\nSalem gave you $n$ sticks with i...
[{"type": "stdin_stdout", "input": "113\n86 67 31 33 72 100 88 63 16 12 79 80 76 45 31 96 44 10 24 33 53 11 56 100 23 57 9 48 28 73 18 48 12 89 73 9 51 11 82 94 90 92 34 99 54 58 33 67 35 87 58 90 94 64 57 80 87 99 84 99 20 1 63 12 16 40 50 95 33 58 7 23 71 89 53 15 95 29 71 16 65 21 66 89 82 30 6 45 6 66 58 32 27 78 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\nPolycarpus likes studying at sch...
[{"type": "stdin_stdout", "input": "10\n58 22116\n112840 772160\n127432 399484\n182031 255417\n459340 548097\n603984 739189\n606173 663033\n280170 366159\n779239 906234\n874623 155443\n", "output": "7\n"}, {"type": "stdin_stdout", "input": "10\n58 22116\n112840 772160\n122094 399484\n182031 255417\n459340 548097\n60398...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nYou are given set of n points in...
[{"type": "stdin_stdout", "input": "11\n358 -724 -232 53 -520\n486 -554 -328 53 -220\n358 -554 -232 -372 -520\n358 -554 -232 308 -520\n868 -554 448 53 -520\n478 -554 -322 53 -600\n358 296 -232 53 -520\n256 -554 -368 53 -520\n230 -554 -136 53 -820\n-182 -554 173 53 -160\n358 -554 -232 53 -520\n", "output": "1\n11\n"}, {...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nYour task is to make function, w...
[{"input": "2\n24\n22", "output": "[26]", "fn_name": "sequence_sum"}, {"input": "0\n15\n3", "output": "[45]", "fn_name": "sequence_sum"}, {"input": "16\n15\n3", "output": "[0]", "fn_name": "sequence_sum"}, {"input": "1\n15\n3", "output": "[35]", "fn_name": "sequence_sum"}, {"input": "2\n6\n2", "output": "[12]", "fn_nam...
code_functional
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nA Pythagorean triple is a triple...
[{"type": "stdin_stdout", "input": "3\n2131\n21165\n6666\n", "output": "32\n102\n57\n"}, {"type": "stdin_stdout", "input": "3\n2131\n21165\n6666\n", "output": "32\n102\n57\n"}, {"type": "stdin_stdout", "input": "3\n2131\n38301\n6666\n", "output": "32\n137\n57\n"}, {"type": "stdin_stdout", "input": "3\n1625\n38301\n6666...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 thief sneaked into a museum wi...
[{"type": "stdin_stdout", "input": "50\n5\n60,10\n100,10\n03,022\n210,45\n10,4\n162\n5\n60,10\n100,20\n120,30\n210,45\n10,4\n0", "output": "Case 1:\n220\n49\nCase 2:\n500\n109\n"}, {"type": "stdin_stdout", "input": "50\n5\n60,20\n100,20\n03,021\n210,45\n10,4\n143\n5\n60,10\n100,20\n120,30\n200,45\n10,4\n0", "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## Emotional Sort ( ︶︿︶)\n\nYou'...
[{"input": "[\":)\", \"T_T\", \":)\", \":D\", \":D\"]\nfalse", "output": "[[\"T_T\", \":)\", \":)\", \":D\", \":D\"]]", "fn_name": "sort_emotions"}, {"input": "[\":)\", \"T_T\", \":)\", \":D\", \":D\"]\ntrue", "output": "[[\":D\", \":D\", \":)\", \":)\", \"T_T\"]]", "fn_name": "sort_emotions"}, {"input": "[\":D\", \"T_...
code_functional
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nKaavi, the mysterious fortune te...
[{"type": "stdin_stdout", "input": "babbaaababbbbabbaaaababbbaabababbaabbaababbaaabaabbabaabbaababababbaabaaabaaaaababbaabaaaaabaabbabaaababbbb\nbbaabbbbabbbbaaaaaababbbabaaabbbbabababbbaabbbbbabaababbaabaaabaabbababababaaaaabaabbabaaabaaaaaaaaaaaaabbb\n", "output": "284471294"}, {"type": "stdin_stdout", "input": "bbbb...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nImplement the function unique_in...
[{"input": "\"AAAABBBCCDAABBB\"", "output": "[[\"A\", \"B\", \"C\", \"D\", \"A\", \"B\"]]", "fn_name": "unique_in_order"}, {"input": "\"ABBCcAD\"", "output": "[[\"A\", \"B\", \"C\", \"c\", \"A\", \"D\"]]", "fn_name": "unique_in_order"}, {"input": "[\"a\", \"b\", \"b\"]", "output": "[[\"a\", \"b\"]]", "fn_name": "unique...
code_functional
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nExample\n\nInput\n\n8\n-10 0\n-1...
[{"type": "stdin_stdout", "input": "8\n-18 1\n-10 2\n-10 8\n-27 -1\n11 0\n22 -5\n4 -8\n5 0", "output": "137\n"}, {"type": "stdin_stdout", "input": "8\n-18 1\n-10 2\n-10 8\n-27 -1\n11 0\n22 -7\n4 -8\n5 0", "output": "144\n"}, {"type": "stdin_stdout", "input": "8\n-18 1\n-10 2\n-10 8\n-7 -1\n11 0\n22 -14\n4 -8\n5 0", "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\nHi there! \nYou have to implemen...
[{"input": "702", "output": "[\"ZZ\"]", "fn_name": "get_column_title"}, {"input": "52", "output": "[\"AZ\"]", "fn_name": "get_column_title"}, {"input": "53", "output": "[\"BA\"]", "fn_name": "get_column_title"}, {"input": "26", "output": "[\"Z\"]", "fn_name": "get_column_title"}, {"input": "1", "output": "[\"A\"]", "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\n$N$ sages are sitting around a r...
[{"type": "stdin_stdout", "input": "5\n1 1 0 1 0\n1 3 1 -2 4", "output": "-1\n"}, {"type": "stdin_stdout", "input": "5\n1 1 0 1 0\n1 3 1 -1 4", "output": "0\n"}, {"type": "stdin_stdout", "input": "5\n1 1 0 0 2\n1 3 0 2 13", "output": "1\n"}, {"type": "stdin_stdout", "input": "5\n1 0 0 1 0\n2 3 6 1 2", "output": "3\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\nSereja has got an array, consist...
[{"type": "stdin_stdout", "input": "6 6\n202714501 613423725 367325359 862808465 196327629 745008828\n2 492\n2 1943\n1 3 173984392\n1 5 17007494\n3 4\n1 5 472683539\n", "output": "862810900\n\n"}, {"type": "stdin_stdout", "input": "6 6\n202714501 613423725 367325359 862808465 196327629 745008828\n2 492\n2 1943\n1 3 173...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 strings arranged in ...
[{"type": "stdin_stdout", "input": "5\n11 1 2 2 2", "output": "3"}, {"type": "stdin_stdout", "input": "5\n14 1 2 2 2", "output": "3"}, {"type": "stdin_stdout", "input": "5\n28 1 2 2 2", "output": "3"}, {"type": "stdin_stdout", "input": "5\n3 1 2 1 13", "output": "3"}, {"type": "stdin_stdout", "input": "5\n11 1 2 2 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\nAn accordion is a string (yes, i...
[{"type": "stdin_stdout", "input": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa[\n", "output": "-1\n"}, {"type": "stdin_stdout", "input": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nSomeone give a strange birthday ...
[{"type": "stdin_stdout", "input": "33 2\n3 13\n17 3\n2 6\n5 33\n4 18\n1 2\n31 5\n4 19\n3 16\n1 3\n9 2\n10 3\n5 1\n5 28\n21 4\n7 2\n1 4\n5 24\n30 5\n14 3\n3 11\n27 5\n8 2\n22 4\n12 3\n20 4\n26 5\n4 23\n32 5\n25 5\n15 3\n29 5\n", "output": "Yes\n"}, {"type": "stdin_stdout", "input": "25 2\n1 2\n1 3\n1 4\n2 5\n2 6\n2 7\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 only difference between easy...
[{"type": "stdin_stdout", "input": "100\n1\n2\n3\n4\n5\n6\n7\n8\n14\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n29\n30\n31\n32\n33\n34\n35\n36\n37\n38\n39\n40\n41\n42\n43\n44\n45\n46\n47\n48\n49\n50\n51\n52\n53\n54\n55\n56\n57\n58\n59\n60\n61\n62\n63\n64\n65\n66\n67\n68\n69\n70\n71\n72\...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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# Covfefe\n\n\nYour are given a ...
[{"input": "\"double space \"", "output": "[\"double space covfefe\"]", "fn_name": "covfefe"}, {"input": "\"coverage coverage\"", "output": "[\"covfefe covfefe\"]", "fn_name": "covfefe"}, {"input": "\"nothing\"", "output": "[\"nothing covfefe\"]", "fn_name": "covfefe"}, {"input": "\"covfefe\"", "output": "[\"covfefe c...
code_functional
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nAn expedition group flew from pl...
[{"type": "stdin_stdout", "input": "602799218 494169337\n", "output": "105935725\n"}, {"type": "stdin_stdout", "input": "523061914 144515354\n", "output": "127493116\n"}, {"type": "stdin_stdout", "input": "622152471 448257864\n", "output": "210299666\n"}, {"type": "stdin_stdout", "input": "549662082 945236243\n", "outp...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nA telephone number is a sequence...
[{"type": "stdin_stdout", "input": "2\n13\n7818005553535\n11\n31415926535\n", "output": "YES\nNO\n"}, {"type": "stdin_stdout", "input": "2\n13\n14222439333841\n11\n31415926535\n", "output": "NO\nNO\n"}, {"type": "stdin_stdout", "input": "2\n13\n3872943379171\n11\n45489461254\n", "output": "YES\nNO\n"}, {"type": "stdin_...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nYou are an upcoming movie direct...
[{"type": "stdin_stdout", "input": "9\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n", "output": "1\n1\n1\n1\n1\n1\n1\n1\n1\n"}, {"type": "stdin_stdout", "input": "9\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n", "output": "1\n1\n1\n1\n1\n1\n1\n1\n1\n"}, {"type": "stdin_stdout", "input": "9\n1\n1\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\nVasya plays the Need For Brake. ...
[{"type": "stdin_stdout", "input": "20\ng 1000000\nibb 1000000\nidj 1000000\nkccg 1000000\nbbe 1000000\nhjf 1000000\na 1000000\nf 1000000\niij 1000000\nakgf 1000000\nkdkhj 1000000\ne 1000000\nh 1000000\nhb 1000000\nfaie 1000000\nj 1000000\ni 1000000\nhgg 1000000\nfi 1000000\nicf 1000000\n12\n1000000 1000000 1000000 100...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nA positive integer is called a 2...
[{"type": "stdin_stdout", "input": "1088391168 1934917632\n", "output": "17\n"}, {"type": "stdin_stdout", "input": "1088391167 1934917632\n", "output": "17\n"}, {"type": "stdin_stdout", "input": "1088391169 1934917632\n", "output": "16\n"}, {"type": "stdin_stdout", "input": "1088391168 1934917631\n", "output": "16\n"},...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nYou are given a permutation $p$ ...
[{"type": "stdin_stdout", "input": "5\n3 4 1 5 2\n", "output": "2\n"}, {"type": "stdin_stdout", "input": "5\n4 5 1 3 2\n", "output": "2\n"}, {"type": "stdin_stdout", "input": "5\n5 4 1 3 2\n", "output": "1\n"}, {"type": "stdin_stdout", "input": "5\n3 4 2 5 1\n", "output": "1\n"}, {"type": "stdin_stdout", "input": "5\n3...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\n# Fourier transformations are ha...
[{"input": "2579111107964987025047536361483312385374008248282655401675211033926782006920415224913494809688581314878892733564", "output": "[\"2579111107964987025047536361483312385374008248282655401675211033926782006920415224913494809688581314878892733564 is the fouriest (4444444444444444444444444444444444444444444444) i...
code_functional