messages
listlengths
1
1
ground_truth
stringlengths
156
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\nOne particularly well-known fact about zombies is that they move and think terribly slowly. While we still do...
[{"input": "10 9\n2 3\n6 8\n10 1\n1 8\n6 7\n8 7\n10 5\n7 10\n2 5\n", "output": "no\n"}, {"input": "10 9\n2 3\n6 8\n10 1\n1 8\n6 7\n8 7\n10 5\n7 10\n2 5\n", "output": "no\n"}, {"input": "10 9\n2 3\n6 8\n10 1\n1 8\n6 7\n8 7\n10 5\n7 10\n2 2\n", "output": "no\n"}, {"input": "10 9\n2 3\n6 8\n10 1\n1 8\n6 7\n8 7\n10 4\n7 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\nYou are standing near a very strange machine. If you put C cents in the machine, the remaining money in your ...
[{"input": "2\n9 72 53\n98 73 69", "output": "125\n27\n"}, {"input": "2\n9 82 69\n98 116 69", "output": "33\n11\n"}, {"input": "2\n9 82 100\n98 116 69", "output": "1\n11\n"}, {"input": "2\n9 90 80\n100 73 69", "output": "125\n0\n"}, {"input": "2\n11 72 32\n78 0 13", "output": "53\n121\n"}, {"input": "2\n2 77 69\n104 84...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nHooray! Berl II, the king of Berland is making a knight tournament. The king has already sent the message to ...
[{"input": "11 8\n3 5 5\n8 9 9\n4 6 6\n8 10 10\n5 7 7\n2 7 2\n10 11 11\n1 11 1\n", "output": "0 1 5 5 6 7 2 9 10 11 1 \n"}, {"input": "11 7\n7 8 8\n5 6 5\n1 3 3\n7 9 9\n5 10 10\n10 11 11\n1 11 4\n", "output": "3 3 4 0 10 5 8 9 10 11 4 \n"}, {"input": "11 7\n7 8 8\n5 6 5\n1 3 3\n7 9 9\n5 10 10\n10 11 11\n1 11 3\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\nToad Rash has a binary string $s$. A binary string consists only of zeros and ones.\n\nLet $n$ be the length ...
[{"input": "1101111000011110111111110101100111111110111100001111011010111001101100010110000001010101101010111000\n", "output": "4672\n"}, {"input": "1101111000011110111111110101100111111110111100001111011010111001101100010110000001010101101010111000\n", "output": "4672\n"}, {"input": "1101111000011110111111110101100110...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nNew Year is coming in Line World! In this world, there are n cells numbered by integers from 1 to n, as a 1 ×...
[{"input": "120 104\n41 15 95 85 34 11 25 42 65 39 77 80 74 17 66 73 21 14 36 63 63 79 45 24 65 7 63 80 51 21 2 19 78 28 71 2 15 23 17 68 62 18 54 39 43 70 3 46 34 23 41 65 32 10 13 18 10 3 16 48 54 18 57 28 3 24 44 50 15 2 20 22 45 44 3 29 2 27 11 2 12 25 25 31 1 2 32 4 11 30 13 16 26 21 1 13 21 8 15 5 18 13 5 15 3 8 ...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nAmericans are odd people: in their buildings, the first floor is actually the ground floor and there is no 13...
[{"input": "200", "output": "[198]", "fn_name": "get_real_floor"}, {"input": "12", "output": "[11]", "fn_name": "get_real_floor"}, {"input": "14", "output": "[12]", "fn_name": "get_real_floor"}, {"input": "15", "output": "[13]", "fn_name": "get_real_floor"}, {"input": "37", "output": "[35]", "fn_name": "get_real_floor"...
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\nExample\n\nInput\n\n5\n\n\nOutput\n\n5### Format: Read the inputs from stdin solve the problem and write the ...
[{"input": "304", "output": "10816520\n"}, {"input": "309", "output": "17426472\n"}, {"input": "352", "output": "45765225\n"}, {"input": "227", "output": "1542687\n"}, {"input": "280", "output": "6677055\n"}, {"input": "161", "output": "142120\n"}, {"input": "187", "output": "372075\n"}, {"input": "157", "output": "121...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nTavas is a strange creature. Usually \"zzz\" comes out of people's mouth while sleeping, but string s of leng...
[{"input": "173700 6\nbcabcbcbcbaaacaccaacaccaabacabaacbcacbbccaccbcacbabcaccccccaacacabbbbbacabbaaacbcbbaccaccabbbbaabbacacbabccaabcabbbcacaaccbabbcaaaaaabccbbcabcacbcbcabcbcbbaabacaaccccabacaaaccacaaabbacacabbcccacbaabcacacbbaaaccaccbaccccccbccaabcacaacabaccababacabcccbcbbacbabacbcbabacbbaccaabcabcbbbaaabbacbbbcacccb...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nYou are given an integer sequence of length N, a = {a_1, a_2, …, a_N}, and an integer K.\n\na has N(N+1)/2 no...
[{"input": "7 26\n10\n20\n30\n43\n30\n20\n10", "output": "13\n"}, {"input": "1 26\n10\n20\n30\n43\n30\n20\n10", "output": "0\n"}, {"input": "1 26\n10\n20\n30\n12\n30\n20\n12", "output": "0\n"}, {"input": "1 26\n10\n20\n27\n12\n30\n20\n12", "output": "0\n"}, {"input": "1 26\n10\n20\n30\n12\n30\n20\n20", "output": "0\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\nPolycarp loves ciphers. He has invented his own cipher called Right-Left.\n\nRight-Left cipher is used for st...
[{"input": "qwertyuioasdfghjklrtyuiodfghjklqwertyuioasdfssddxb\n", "output": "dfogihujyktlrqlwkejrhtgyfudisoaaosidufystsrdedwxqb\n"}, {"input": "qwertyuioasdfghjklrtyuiodfghjklqwertyuioasdfssddxb\n", "output": "dfogihujyktlrqlwkejrhtgyfudisoaaosidufystsrdedwxqb\n"}, {"input": "qwertyuioasdfghjklrtyuipdfghjklqwertyuioas...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nThere exist two zeroes: +0 (or just 0) and -0.\n\nWrite a function that returns `true` if the input number is...
[{"input": "-Infinity", "output": "[false]", "fn_name": "is_negative_zero"}, {"input": "Infinity", "output": "[false]", "fn_name": "is_negative_zero"}, {"input": "-5.0", "output": "[false]", "fn_name": "is_negative_zero"}, {"input": "-4.0", "output": "[false]", "fn_name": "is_negative_zero"}, {"input": "-3.0", "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\nGiven is a sequence of N digits a_1a_2\\ldots a_N, where each element is 1, 2, or 3. Let x_{i,j} defined as f...
[{"input": "10\n1806305381", "output": "0\n"}, {"input": "10\n2192114600", "output": "1\n"}, {"input": "10\n3104206232", "output": "1\n"}, {"input": "10\n2763272837", "output": "1\n"}, {"input": "10\n1238013900", "output": "1\n"}, {"input": "10\n1665759416", "output": "0\n"}, {"input": "10\n2224468077", "output": "0\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\nIn this Kata you need to write the method SharedBits that returns true if 2 integers share at least two '1' b...
[{"input": "16\n8", "output": "[false]", "fn_name": "shared_bits"}, {"input": "7\n10", "output": "[false]", "fn_name": "shared_bits"}, {"input": "43\n77", "output": "[true]", "fn_name": "shared_bits"}, {"input": "1\n2", "output": "[false]", "fn_name": "shared_bits"}, {"input": "1\n1", "output": "[false]", "fn_name": "s...
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\nGiven is an integer N. Snuke will choose integers s_1, s_2, n_1, n_2, u_1, u_2, k_1, k_2, e_1, and e_2 so tha...
[{"input": "4\n33\n1\n28\n0111010001", "output": "996765147\n0\n399637805\n501963061\n"}, {"input": "4\n33\n1\n28\n0111110001", "output": "996765147\n0\n399637805\n744953502\n"}, {"input": "4\n24\n2\n30\n0110110001", "output": "192839398\n0\n434820093\n589150439\n"}, {"input": "4\n2\n18\n124\n0010000000", "output": "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\nPolycarp has built his own web service. Being a modern web service it includes login feature. And that always...
[{"input": "5\nabacaba\nzyxaabcaabkjh\nonetwothree\nthreetwoone\none\nzzonneyy\none\nnone\ntwenty\nten\n", "output": "YES\nYES\nNO\nYES\nNO\n"}, {"input": "5\nabacaba\nzyxaabcaabkjh\nonetwothree\nthreetwoone\none\nzzonneyy\neno\nnone\ntwenty\nten\n", "output": "YES\nYES\nNO\nYES\nNO\n"}, {"input": "5\nabacaba\nzyxaabca...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nRoma is playing a new expansion for his favorite game World of Darkraft. He made a new character and is going...
[{"input": "10 10 10\n51 87\n68 600\n82 1284\n33 936\n55 242\n89 1990\n58 357\n66 666\n62 512\n51 87\n92 1670\n56 280\n56 280\n91 1631\n77 1091\n89 1554\n61 473\n98 1901\n77 1091\n77 1091\n86 15 759\n43 58 386\n68 33 386\n39 62 386\n95 6 386\n74 27 386\n94 7 386\n17 36 386\n105 4 386\n45 56 386\n", "output": "598\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\nYour task is to perform a simple table calculation.\n\nWrite a program which reads the number of rows r, colu...
[{"input": "4 5\n2 1 3 12 13\n0 2 2 12 5\n3 6 1 1 1\n2 6 3 1 21", "output": "2 1 3 12 13 31\n0 2 2 12 5 21\n3 6 1 1 1 12\n2 6 3 1 21 33\n7 15 9 26 40 97\n"}, {"input": "4 5\n2 1 3 12 13\n0 2 2 12 5\n3 3 1 1 1\n2 6 3 1 21", "output": "2 1 3 12 13 31\n0 2 2 12 5 21\n3 3 1 1 1 9\n2 6 3 1 21 33\n7 12 9 26 40 94\n"}, {"inpu...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nTanya wants to go on a journey across the cities of Berland. There are $n$ cities situated along the main rai...
[{"input": "10\n10 60 12 13 14 15 16 66 18 130\n", "output": "130\n"}, {"input": "10\n10 60 12 13 14 15 16 66 18 130\n", "output": "130\n"}, {"input": "10\n8 60 12 13 14 15 16 66 18 130\n", "output": "130\n"}, {"input": "9\n18 11 24 7 18 10 1 20 17\n", "output": "24\n"}, {"input": "9\n18 11 24 7 18 10 1 20 17\n", "outp...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nThe faculty of application management and consulting services (FAMCS) of the Berland State University (BSU) h...
[{"input": "1\n4 2 3 14\n7 5 7\n10 6 10\n7 10 9\n9 0", "output": "Impossible\n"}, {"input": "1\n4 2 3 14\n7 5 7\n10 6 10\n7 10 9\n9 1", "output": "Impossible\n"}, {"input": "1\n4 2 3 2\n14 7 7\n10 6 7\n7 14 11\n9 9", "output": "Impossible\n"}, {"input": "1\n4 2 3 2\n14 14 7\n10 6 7\n7 14 6\n9 9", "output": "Impossible\...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nFox Ciel saw a large field while she was on a bus. The field was a n × m rectangle divided into 1 × 1 cells. ...
[{"input": "31 31 31 4\n15 26\n29 15\n17 31\n29 21\n21 3\n9 27\n19 20\n8 19\n5 4\n1 16\n6 17\n5 24\n1 4\n27 30\n16 24\n14 29\n24 31\n6 20\n2 20\n12 26\n26 15\n23 8\n29 10\n11 8\n3 7\n2 26\n15 10\n15 24\n6 10\n31 22\n12 2\n10 3\n6 24\n23 12\n19 1\n", "output": "Grapes\nCarrots\nCarrots\nCarrots\n"}, {"input": "31 31 31 ...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nThere are $n$ people in this world, conveniently numbered $1$ through $n$. They are using burles to buy goods...
[{"input": "12 20\n1 3 1000000000\n3 2 1000000000\n1 4 1000000000\n4 2 1000000000\n1 5 1000000000\n5 2 1000000000\n1 6 1000000010\n6 2 1000000000\n1 7 1000000000\n7 2 1000000000\n1 8 1000000000\n8 4 1000000000\n1 9 1000000000\n9 2 1000000000\n1 10 1000000000\n10 2 1000000000\n1 11 1000000000\n11 2 1000000000\n1 12 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\nTic-tac-toe is a game in which you win when you put ○ and × alternately in the 3 × 3 squares and line up ○ or...
[{"input": "ooosxssxs\nxooswsosx\nooxxxooxo", "output": "o\nd\nd\n"}, {"input": "oopsxssxs\nxooswsosx\noxooxxxoo", "output": "d\nd\nd\n"}, {"input": "oopsxrsxs\nxsoswsoox\nooooxxxox", "output": "d\nd\no\n"}, {"input": "xprmnwrtt\ntoyqulosl\nxxxmilpm{", "output": "d\nd\nx\n"}, {"input": "ooosxssxs\nxoosxsosx\noxooxxxoo"...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nFor a given polygon g and target points t, print \"2\" if g contains t, \"1\" if t is on a segment of g, \"0\...
[{"input": "4\n3 0\n15 -1\n0 1\n-1 0\n3\n-1 -2\n1 0\n-1 -1", "output": "0\n1\n0\n"}, {"input": "4\n3 0\n8 -1\n0 1\n-1 2\n3\n-1 -2\n0 -1\n0 -1", "output": "0\n0\n0\n"}, {"input": "4\n-1 -1\n4 -2\n3 -1\n1 4\n2\n0 1\n1 0\n-2 1", "output": "2\n2\n"}, {"input": "4\n0 -1\n6 -2\n3 -1\n1 4\n2\n0 1\n1 0\n-1 0", "output": "0\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\nA new agent called Killjoy invented a virus COVID-2069 that infects accounts on Codeforces. Each account has ...
[{"input": "7\n2 7\n7 1313\n2 14\n8 1211\n2 9\n12 121\n2 121\n121 312\n2 121\n136 121\n2 7\n1313 7\n2 8\n1211 8\n", "output": "1\n2\n2\n1\n1\n1\n1\n"}, {"input": "7\n2 7\n7 1313\n2 8\n8 1211\n2 9\n12 121\n2 121\n121 312\n2 121\n312 121\n2 7\n1313 7\n2 8\n1211 8\n", "output": "1\n1\n2\n1\n1\n1\n1\n"}, {"input": "7\n2 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\nBizon the Champion isn't just charming, he also is very smart.\n\nWhile some of us were learning the multipli...
[{"input": "500000 500000 250000000000\n", "output": "250000000000\n"}, {"input": "499997 499989 248758432143\n", "output": "225563648440\n"}, {"input": "499997 499989 248758432143\n", "output": "225563648440"}, {"input": "500000 500000 250000000000\n", "output": "250000000000"}, {"input": "183656 409931 42943608085\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\nYou are given a string $s$, consisting of lowercase Latin letters. While there is at least one character in t...
[{"input": "1\naaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaabaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\n", "output": "ba\n"}, {"input": "1\naaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nAs behooves any intelligent schoolboy, Kevin Sun is studying psycowlogy, cowculus, and cryptcowgraphy at the ...
[{"input": "990037 453792\n", "output": "654009570\n"}, {"input": "586189 189159\n", "output": "168174057\n"}, {"input": "512287 359783\n", "output": "542484357\n"}, {"input": "999983 239239\n", "output": "965993296\n"}, {"input": "498653 116674\n", "output": "625264514\n"}, {"input": "805711 702149\n", "output": "7598...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nFrom tomorrow, the long-awaited summer vacation will begin. So I decided to invite my friends to go out to th...
[{"input": "5\n8 100001\n14 100001\n12 100000\n11 100001\n3 100001", "output": "0\n"}, {"input": "5\n8 100001\n14 100001\n13 100000\n11 100001\n3 100001", "output": "0\n"}, {"input": "5\n8 000001\n14 100001\n13 100000\n11 100001\n3 100001", "output": "0\n"}, {"input": "5\n8 100001\n14 100001\n12 100000\n13 100001\n3 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\nGiven two matrices A and B. Both have N rows and M columns. In the matrix A, numbers from 1 to MN have been w...
[{"input": "1\n1 102", "output": "102\n"}, {"input": "1\n1 167", "output": "167\n"}, {"input": "1\n-23 -5", "output": "-5\n"}, {"input": "1\n135 1", "output": "135\n"}, {"input": "1\n215 1", "output": "215\n"}, {"input": "1\n396 1", "output": "396\n"}, {"input": "1\n1 143", "output": "143\n"}, {"input": "1\n1 113", "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\nBob is a duck. He wants to get to Alice's nest, so that those two can duck! [Image] Duck is the ultimate anim...
[{"input": "10\n324839129156 133475576222 1946579156099 185514358673 88712073883 243757012712 950854402304 21947060440 598567289966 674328002732\nGLLLLLLLLW\n", "output": "26365097587258\n"}, {"input": "10\n324839129156 133475576222 987711341463 185514358673 88712073883 243757012712 950854402304 21947060440 59856728996...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nRecently Polycarp started to develop a text editor that works only with correct bracket sequences (abbreviate...
[{"input": "92 51 18\n(()(((()())(()())())())(()())()()()())((()()())(())(())(()((())()())())(())())((())()())()()\nLRLRLLLLRRRLLRRLDLRLRRLRDLDLDLDDRRLRRRLLRDRLDDRLRRD\n", "output": "(()()()()())((()()())(())(())(()((())()())())(())())((())()())()()\n"}, {"input": "86 11 62\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\nYou are given a system of pipes. It consists of two rows, each row consists of $n$ pipes. The top left pipe h...
[{"input": "6\n7\n2323216\n1615124\n1\n3\n4\n2\n13\n24\n2\n12\n34\n3\n536\n345\n2\n46\n101\n", "output": "YES\nYES\nYES\nNO\nYES\nNO\n"}, {"input": "6\n7\n2323216\n1615124\n1\n5\n4\n2\n13\n24\n2\n12\n34\n3\n536\n345\n2\n46\n101\n", "output": "YES\nYES\nYES\nNO\nYES\nNO\n"}, {"input": "6\n7\n2323216\n1615124\n1\n3\n4\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\nTakahashi is at an all-you-can-eat restaurant.\nThe restaurant offers N kinds of dishes. It takes A_i minutes...
[{"input": "3000 3000\n2996 2995\n2990 2993\n2994 2994\n2994 2997\n3000 2990\n2991 3000\n3000 2998\n2994 2997\n2996 2993\n2991 3000\n2992 2991\n2991 2994\n2996 3000\n2996 2997\n3000 2998\n2995 2995\n2994 2997\n2996 2999\n2990 2992\n2997 2994\n2995 3000\n2993 2998\n2994 2998\n2990 2997\n2995 2998\n3000 2997\n3000 2995\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\nA lot of people associate Logo programming language with turtle graphics. In this case the turtle moves along...
[{"input": "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF\n50\n", "output": "100\n"}, {"input": "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF\n40\n", "output": "100\n"}, {"input": "FFFFFFFFFFFFFFFFFFFFFFFFFFFF...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nYou are given an integer sequence A of length N.\nFind the maximum absolute difference of two elements (with ...
[{"input": "100\n3142445 16266949 17493698 35569790 80507149 98771888 109205766 111818374 116565925 119183522 141425056 157086378 180302992 187469083 216070266 233105051 257048184 265553444 273526101 281450237 289171706 301768399 311455945 319497119 326729809 338683702 339701654 346802542 353453224 373203259 386147801 ...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n# MOD 256 without the MOD operator\n\nThe MOD-operator % (aka mod/modulus/remainder):\n```\nReturns the remai...
[{"input": "-258", "output": "[254]", "fn_name": "mod256_without_mod"}, {"input": "254", "output": "[254]", "fn_name": "mod256_without_mod"}, {"input": "-254", "output": "[2]", "fn_name": "mod256_without_mod"}, {"input": "-256", "output": "[0]", "fn_name": "mod256_without_mod"}, {"input": "256", "output": "[0]", "fn_na...
code_functional
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nOn the Internet, data is divided into packets, and each packet is transferred to a destination via a relay de...
[{"input": "7\n1 4 2 5 5 3\n2 1 5\n3 1 6\n4 1 7\n5 2 7 6\n6 1 2\n7 0\n6\n1 2 0\n1 5 0\n1 2 0\n5 1 3\n6 3 0\n1 7 4", "output": "NA\nNA\nNA\nNA\nNA\n3\n"}, {"input": "7\n1 4 2 5 4 3\n2 1 5\n3 1 6\n4 1 7\n5 2 7 6\n6 1 1\n7 0\n6\n1 2 1\n1 3 6\n1 2 0\n5 2 3\n6 3 0\n3 7 4", "output": "NA\n2\nNA\nNA\nNA\nNA\n"}, {"input": "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\nWhen registering in a social network, users are allowed to create their own convenient login to make it easie...
[{"input": "ELioO1lOoOIOiLoooi1iolul1O\n7\nOoEIuOIl1ui1010uiooOoi0Oio001L0EoEolO0\nOLIoOEuoE11u1u1iLOI0oO\nuEOuO0uIOOlO01OlEI0E1Oo0IO1LI0uE0LILO0\nEOo0Il11iIOOOIiuOiIiiLOLEOOII001EE\niOoO0LOulioE0OLIIIulli01OoiuOOOoOlEiI0EiiElIIu0\nlE1LOE1Oil\n1u0EOliIiIOl1u110il0l1O0u\n", "output": "Yes\n"}, {"input": "ELioO1lOoOIOiLo...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nCreate a function that will return ```true``` if the input is in the following date time format ```01-09-2016...
[{"input": "\"Tue Sep 06 2016 01:46:38 GMT+0100\"", "output": "[false]", "fn_name": "date_checker"}, {"input": "\"01-09-2016 01;20\"", "output": "[false]", "fn_name": "date_checker"}, {"input": "\"01_09_2016 01:20\"", "output": "[false]", "fn_name": "date_checker"}, {"input": "\"Tenth of January\"", "output": "[false]"...
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\n------ Problem Statement ------ \n\nPast\n\nIn the year of 2048, the Virtual Reality Massively Multiplayer On...
[{"input": "2\n5 -1\n^^^^^\n^^]^^\n^^^^#\n^^^^^\n^]^^^\n5 7\n^^#^^^_\n^^###^^\n#^^^^^^\n^^#^^#^\n^^^^^^^", "output": "0\n0\n"}, {"input": "2\n5 -1\n^^^^_\n^^]^^\n^^^^#\n^^^^^\n^]^^^\n5 7\n^^#^^^_\n^^###^^\n#^^^^^^\n^^#^^#^\n^^^^^^^", "output": "0\n0\n"}, {"input": "2\n5 -1\n^^^^^\n^^]^^\n^^^^#\n^^^^^\n^]^^^\n5 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\nThere is a line with 1000 cells numbered from 1 to 1000 from left to right and N coins placed on it. Coin i i...
[{"input": "2\n12 2\n2 4 18\n22 3\n1 2 4 8 12", "output": "16\n7\n"}, {"input": "2\n10 2\n1 5 13\n8 6\n1 4 5 6 21", "output": "10\n16\n"}, {"input": "2\n10 2\n1 5 21\n8 6\n1 4 5 6 21", "output": "18\n16\n"}, {"input": "2\n10 2\n1 5 34\n8 6\n1 4 5 6 21", "output": "31\n16\n"}, {"input": "2\n12 2\n2 4 18\n22 3\n1 3 4 8 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\nIf you have completed the Tribonacci sequence kata, you would know by now that mister Fibonacci has at least ...
[{"input": "[0.5, 0, 0, 0, 0, 0, 0, 0, 0, 0]\n20", "output": "[[0.5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.5, 0.5, 1, 2, 4, 8, 16, 32, 64, 128]]", "fn_name": "Xbonacci"}, {"input": "[1, 0, 0, 0, 0, 0, 0, 0, 0, 0]\n20", "output": "[[1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 2, 4, 8, 16, 32, 64, 128, 256]]", "fn_name": "Xbonacci"}, {"i...
code_functional
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nYou are given an integer $n$. Pair the integers $1$ to $2n$ (i.e. each integer should be in exactly one pair)...
[{"input": "4\n1\n2\n3\n4\n", "output": "YES\n1 2\nNO\nYES\n1 6\n2 4\n3 5\nNO\n"}, {"input": "1\n100000\n", "output": "NO\n"}, {"input": "1\n99988\n", "output": "NO\n"}, {"input": "1\n99990\n", "output": "NO\n"}, {"input": "1\n99992\n", "output": "NO\n"}, {"input": "1\n99994\n", "output": "NO\n"}, {"input": "1\n99996\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\nVasya is pressing the keys on the keyboard reluctantly, squeezing out his ideas on the classical epos depicte...
[{"input": "100\n1622 320 1261 282 1604 57 1427 1382 904 911 1719 1682 984 1727 1301 1799 1110 1057 248 764 1642 1325 1172 1677 182 32 665 397 1146 73 412 554 973 874 774 1948 1676 1959 518 280 1467 568 613 760 594 252 224 1359 876 253 760 1566 929 1614 940 1079 288 245 1432 1647 1534 1768 1947 733 225 495 1239 644 124...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nA number `n` is called `prime happy` if there is at least one prime less than `n` and the `sum of all primes ...
[{"input": "8", "output": "[false]", "fn_name": "is_prime_happy"}, {"input": "25", "output": "[true]", "fn_name": "is_prime_happy"}, {"input": "32", "output": "[true]", "fn_name": "is_prime_happy"}, {"input": "2", "output": "[false]", "fn_name": "is_prime_happy"}, {"input": "0", "output": "[false]", "fn_name": "is_prim...
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\nI have n tickets for a train with a rabbit. Each ticket is numbered from 0 to n − 1, and you can use the k ti...
[{"input": "6 279 2 5 26 14", "output": "117\n"}, {"input": "17 256 2 3 10 9", "output": "67\n"}, {"input": "6 323 2 12 8 9", "output": "182\n"}, {"input": "6 279 2 5 46 14", "output": "57\n"}, {"input": "22 144 2 3 3 5", "output": "15\n"}, {"input": "17 144 2 3 6 5", "output": "37\n"}, {"input": "6 200 2 3 26 8", "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\nNoora is a student of one famous high school. It's her final year in school — she is going to study in univer...
[{"input": "100 100\n100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nThere are N Reversi pieces arranged in a row. (A Reversi piece is a disc with a black side and a white side.)...
[{"input": "WBWBWB", "output": "3\n"}, {"input": "WBWBVB", "output": "1\n"}, {"input": "WBWBUB", "output": "1\n"}, {"input": "WBWBUC", "output": "1\n"}, {"input": "WBWBTC", "output": "1\n"}, {"input": "WBWBVC", "output": "1\n"}, {"input": "WBVBVC", "output": "0\n"}, {"input": "BWBWBW", "output": "6"}, {"input": "BBX", ...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nThere is a connected undirected graph with N vertices and M edges. The vertices are numbered 1 to N, and the ...
[{"input": "10 9\n81 20 73 7 2 61 86 38 90 28\n6 8 725\n3 10 12\n1 4 558\n4 9 615\n5 6 942\n8 9 918\n2 7 720\n4 7 292\n7 10 414", "output": "8\n"}, {"input": "10 9\n81 20 73 7 2 61 86 44 90 28\n6 8 725\n3 10 12\n1 4 558\n4 9 615\n5 6 942\n8 9 918\n2 7 720\n4 7 292\n7 10 414", "output": "8\n"}, {"input": "10 9\n81 20 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\nIt's Friday night, and Chuck is bored. He's already run 1,000 miles, stopping only to eat a family sized bag ...
[{"input": "[\"*****************************************\", \"*********** _O_ * _O_ ***********\", \"** _O_ * C(.)J * /(.)J * _O_ **\", \"** /(.)J * _| |_ * _/ )_ * C(.)J **\", \"** _/ )_ ********************* _/ |_ **\", \"******************* X *******************\", \"********************** ...
code_functional
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nThere is a tree with N vertices, numbered 1 through N. The i-th of the N-1 edges connects vertices a_i and b_...
[{"input": "6\n3 2 2 2 2 2\n1 2\n2 3\n1 6\n1 5\n4 6", "output": "YES\n"}, {"input": "6\n5 2 2 2 2 2\n1 2\n2 3\n1 6\n1 5\n4 6", "output": "NO\n"}, {"input": "6\n5 2 4 2 2 2\n1 2\n2 3\n1 6\n1 5\n4 6", "output": "NO\n"}, {"input": "6\n5 2 4 2 2 2\n1 2\n2 3\n1 6\n1 5\n6 6", "output": "NO\n"}, {"input": "6\n5 2 4 2 2 2\n1 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\nIn Berland a money reform is being prepared. New coins are being introduced. After long economic calculations...
[{"input": "1000000\n", "output": "1000000 500000 250000 125000 62500 31250 15625 3125 625 125 25 5 1\n"}, {"input": "685248\n", "output": "685248 342624 171312 85656 42828 21414 10707 3569 83 1 "}, {"input": "100000\n", "output": "100000 50000 25000 12500 6250 3125 625 125 25 5 1\n"}, {"input": "537000\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\nWe have N strings of lowercase English letters: S_1, S_2, \\cdots, S_N.\nTakahashi wants to make a string tha...
[{"input": "50\nxkxkbxdadmrlymnhzpdb 964776970\nfxocahjfrcucddkozsuy 964776970\nxdqaekpuagisbklbybec 964776970\nvyowutrbwyqqqyvlchvr 964776970\nwjtibdpzhnmylrmdadxb 964776970\nyfvmjwesjqnahyzn 964776970\nuvbgtgszdkzicesngmpn 964776970\nmltwiydbpshxhgtgewfu 964776970\nsqhxdcadyvkjsyfwnphs 964776970\nxwbkeyhvgqcfznwybsct...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nWe need you to implement a method of receiving commands over a network, processing the information and respon...
[{"input": "\"H1H10F1200120008F4F4\"", "output": "[\"H1H1FFFF00200000F4F4\"]", "fn_name": "communication_module"}, {"input": "\"D7D70F1200250015G8G8\"", "output": "[\"D7D7FFFF00400000G8G8\"]", "fn_name": "communication_module"}, {"input": "\"X7X7B7A201400058L0L0\"", "output": "[\"X7X7FFFF00820000L0L0\"]", "fn_name": "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\nAlice and Bob are playing a game on a matrix, consisting of $2$ rows and $m$ columns. The cell in the $i$-th ...
[{"input": "3\n3\n2 3 12\n2 10 0\n3\n-1 4 17\n3 9 0\n1\n4\n3\n", "output": "12\n12\n0\n"}, {"input": "3\n3\n2 3 12\n2 10 1\n3\n-1 4 17\n2 9 0\n1\n4\n3\n", "output": "12\n11\n0\n"}, {"input": "3\n3\n2 3 12\n2 10 2\n3\n-1 4 17\n3 5 0\n1\n4\n3\n", "output": "12\n8\n0\n"}, {"input": "3\n3\n2 3 12\n2 10 0\n3\n-1 4 17\n3 5 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\nRead problems statements in Mandarin Chinese, Russian and Vietnamese as well. \nNim is a well-known combinato...
[{"input": "3\n4\n1 2 4 12\n3\n2 3 3\n5\n1 3 3 3 3", "output": "First\nSecond\nSecond\n"}, {"input": "3\n4\n1 2 4 12\n3\n1 3 3\n5\n1 3 3 3 3", "output": "First\nSecond\nSecond\n"}, {"input": "3\n4\n1 2 8 13\n3\n3 1 3\n5\n1 3 1 3 3", "output": "First\nSecond\nSecond\n"}, {"input": "3\n4\n1 2 4 16\n3\n3 3 3\n5\n1 3 3 3 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\nBob has a server farm crunching numbers. He has `nodes` servers in his farm. His company has a lot of work to...
[{"input": "4\n10", "output": "[[[0, 1, 2], [3, 4, 5], [6, 7], [8, 9]]]", "fn_name": "distribute"}, {"input": "3\n9", "output": "[[[0, 1, 2], [3, 4, 5], [6, 7, 8]]]", "fn_name": "distribute"}, {"input": "5\n4", "output": "[[[0], [1], [2], [3], []]]", "fn_name": "distribute"}, {"input": "4\n5", "output": "[[[0, 1], [2],...
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\nYou are given a matrix consisting of digits zero and one, its size is n × m. You are allowed to rearrange its...
[{"input": "15 18\n111111111111111111\n111111111111111111\n111111111111111111\n111111111111111111\n111111111111111111\n111111111111111111\n111111111111111111\n111111111111111111\n111111111111111111\n111111111111111111\n111111111111111111\n111111111111111111\n111111111111111111\n111111111111111111\n111111111111111111\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\nYou are given several queries. In the i-th query you are given a single positive integer n_{i}. You are to re...
[{"input": "100\n611\n513\n544\n463\n38\n778\n347\n317\n848\n1308\n382\n108\n718\n33\n544\n876\n234\n22\n944\n305\n159\n245\n513\n691\n639\n135\n435\n324\n813\n459\n304\n116\n331\n993\n184\n224\n853\n769\n121\n687\n93\n930\n751\n308\n485\n914\n400\n695\n95\n981\n175\n972\n121\n1007\n242\n610\n617\n999\n237\n548\n742\n7...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nCosmic market, commonly known as Kozumike, is the largest coterie spot sale in the universe. Doujin lovers of...
[{"input": "5 5 4\n0 0 1\n0 0 0\n0 2 0\n1 1 1\n1 0 0\n5 5 5\n1 4 0\n0 1 1\n0 4 1\n1 3 0\n0 3 1\n5 5 5\n1 0 0\n0 3 1\n1 2 1\n0 4 0\n1 1 1\n0 0 0", "output": "5\n0\n13\n12\n"}, {"input": "5 14 5\n2 0 2\n0 0 0\n0 0 1\n1 2 1\n1 0 0\n5 5 5\n1 4 1\n0 1 1\n1 1 1\n1 3 0\n1 3 0\n5 10 5\n1 0 0\n0 3 0\n1 2 1\n0 4 0\n0 1 0\n0 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\nImplement `String#digit?` (in Java `StringUtils.isDigit(String)`), which should return `true` if given object...
[{"input": "\"1\\n0\"", "output": "[false]", "fn_name": "is_digit"}, {"input": "\"1\\n\"", "output": "[false]", "fn_name": "is_digit"}, {"input": "\"a5\"", "output": "[false]", "fn_name": "is_digit"}, {"input": "\"14\"", "output": "[false]", "fn_name": "is_digit"}, {"input": "\"\\\"\"", "output": "[false]", "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\nYou are given two arrays of integers $a_1, a_2, \\ldots, a_n$ and $b_1, b_2, \\ldots, b_n$.\n\nLet's define a...
[{"input": "2\n10\n3 3 2 2 3 2 1 1 2 3\n3 3 2 1 2 3 2 3 1 1\n10\n1 1 3 1 2 2 1 3 3 3\n3 1 3 1 1 2 3 2 2 1\n", "output": "NO\nNO\n"}, {"input": "1\n10\n14 -91 -52 -82 -4 69 33 3 -46 81\n-45 15 -4 82 33 3 -90 -81 -51 69\n", "output": "YES\n"}, {"input": "4\n2\n1 1\n0 0\n3\n1 2 3\n1 3 5\n4\n1 3 5 7\n0 2 4 8\n3\n0 0 0\n-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\nIn this kata, you need to make a (simplified) LZ78 encoder and decoder.\n[LZ78](https://en.wikipedia.org/wiki...
[{"input": "\"ABCDDEFGABCDEDBBDEAAEDAEDCDABC\"", "output": "[\"0A0B0C0D4E0F0G1B3D0E4B2D10A1E4A10D9A2C\"]", "fn_name": "encoder"}, {"input": "\"ABBCBCABABCAABCAABBCAA\"", "output": "[\"0A0B2C3A2A4A6B6\"]", "fn_name": "encoder"}, {"input": "\"ABCABCABCABCABCABC\"", "output": "[\"0A0B0C1B3A2C4C7A6\"]", "fn_name": "encoder...
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\nUjan has a lot of useless stuff in his drawers, a considerable part of which are his math notebooks: it is ti...
[{"input": "15 10\n2 3\n5 4\n5 6\n5 7\n3 8\n3 10\n11 12\n12 13\n13 14\n14 15\n", "output": "0\n"}, {"input": "15 10\n2 3\n5 4\n5 6\n5 7\n3 8\n3 10\n11 12\n12 13\n13 14\n14 15\n", "output": "0\n"}, {"input": "15 10\n2 3\n5 4\n5 4\n5 7\n3 8\n3 10\n11 12\n12 13\n13 14\n14 15\n", "output": "0\n"}, {"input": "15 10\n2 3\n5 ...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nLet T be arbitrary binary tree — tree, every vertex of which has no more than two children. Given tree is roo...
[{"input": "10\n911605217 -1 -1\n801852416 -1 -1\n140035920 -1 9\n981454947 10 2\n404988051 6 3\n307545107 8 7\n278188888 4 1\n523010786 -1 -1\n441817740 -1 -1\n789680429 -1 -1\n", "output": "7\n"}, {"input": "10\n911605217 -1 -1\n801852416 -1 -1\n140035920 -1 9\n981454947 10 2\n404988051 6 3\n307545107 8 7\n278188888 ...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nGennady is one of the best child dentists in Berland. Today n children got an appointment with him, they line...
[{"input": "10\n9 8 8\n2 9 33\n10 7 42\n7 2 18\n3 5 82\n9 9 25\n3 2 86\n3 5 49\n5 3 72\n4 4 71\n", "output": "10\n1 2 3 4 5 6 7 8 9 10 "}, {"input": "10\n9 8 8\n2 9 33\n10 7 42\n7 2 18\n3 5 82\n9 9 25\n3 2 86\n3 5 49\n5 3 72\n4 4 71\n", "output": "10\n1 2 3 4 5 6 7 8 9 10 "}, {"input": "10\n9 8 8\n2 9 33\n10 7 42\n7 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\nImp likes his plush toy a lot.\n\n [Image] \n\nRecently, he found a machine that can clone plush toys. Imp kn...
[{"input": "1000000000 999999999\n", "output": "Yes\n"}, {"input": "1000000000 1000000000\n", "output": "No\n"}, {"input": "1000000000 999999999\n", "output": "Yes\n"}, {"input": "1000000000 1000000000\n", "output": "No\n"}, {"input": "1079372212 582938127\n", "output": "Yes\n"}, {"input": "1000001000 1000000000\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\nWrite a function that removes every lone 9 that is inbetween 7s.\n\n```python\nseven_ate9('79712312') => '771...
[{"input": "\"165561786121789797\"", "output": "[\"16556178612178977\"]", "fn_name": "seven_ate9"}, {"input": "\"797 9 7\"", "output": "[\"77 9 7\"]", "fn_name": "seven_ate9"}, {"input": "\"7979797\"", "output": "[\"7777\"]", "fn_name": "seven_ate9"}, {"input": "\"17797a\"", "output": "[\"1777a\"]", "fn_name": "seven_a...
code_functional
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nZS the Coder is coding on a crazy computer. If you don't type in a word for a c consecutive seconds, everythi...
[{"input": "2 1000000000\n1 1000000000\n", "output": "2\n"}, {"input": "2 1000000000\n1 1000000000\n", "output": "2"}, {"input": "6 5\n1 5 8 14 19 20\n", "output": "3\n"}, {"input": "5 10\n-1 1 22 32 34\n", "output": "3\n"}, {"input": "5 12\n-1 1 22 32 34\n", "output": "3\n"}, {"input": "6 5\n1 3 8 14 19 20\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\nThere is a long-established secondhand bookstore called JOI secondhand bookstore in your town, and you often ...
[{"input": "7 7\n4 1\n13 2\n18 3\n64 3\n13 2\n16 10\n11 2", "output": "147\n"}, {"input": "7 7\n4 1\n13 2\n12 3\n48 3\n8 2\n16 10\n11 2", "output": "120\n"}, {"input": "7 5\n4 1\n13 3\n12 3\n48 3\n8 3\n16 10\n11 2", "output": "109\n"}, {"input": "7 7\n4 1\n13 2\n18 3\n48 3\n8 2\n16 10\n11 2", "output": "126\n"}, {"inpu...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nAfter a hard-working week Polycarp prefers to have fun. Polycarp's favorite entertainment is drawing snakes. ...
[{"input": "2\n1 1\nb\n1 1\nz\n", "output": "YES\n2\n1 1 1 1\n1 1 1 1\nYES\n26\n1 1 1 1\n1 1 1 1\n1 1 1 1\n1 1 1 1\n1 1 1 1\n1 1 1 1\n1 1 1 1\n1 1 1 1\n1 1 1 1\n1 1 1 1\n1 1 1 1\n1 1 1 1\n1 1 1 1\n1 1 1 1\n1 1 1 1\n1 1 1 1\n1 1 1 1\n1 1 1 1\n1 1 1 1\n1 1 1 1\n1 1 1 1\n1 1 1 1\n1 1 1 1\n1 1 1 1\n1 1 1 1\n1 1 1 1\n"}, {"...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nA monster is attacking the Cyberland!\n\nMaster Yang, a braver, is going to beat the monster. Yang and the mo...
[{"input": "100 100 100\n100 100 100\n100 100 100\n", "output": "100"}, {"input": "50 100 51\n100 100 100\n1 100 100\n", "output": "1384"}, {"input": "100 100 1\n100 100 100\n1 100 100\n", "output": "1891"}, {"input": "1 1 1\n100 100 100\n100 100 101\n", "output": "19999\n"}, {"input": "50 100 80\n100 100 100\n1 100 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\n# History\n\nThis kata is a sequel of my [Mixbonacci](https://www.codewars.com/kata/mixbonacci/python) kata. ...
[{"input": "[\"fib\", \"pel\", \"tri\"]\n10", "output": "[[0, 0, 0, 1, 1, 3, 5, 8, 21, 34]]", "fn_name": "zozonacci"}, {"input": "[\"tet\", \"jac\"]\n10", "output": "[[0, 0, 0, 1, 1, 3, 5, 11, 20, 42]]", "fn_name": "zozonacci"}, {"input": "[\"tri\", \"fib\"]\n10", "output": "[[0, 0, 0, 1, 1, 2, 4, 6, 12, 18]]", "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\nVladik is a competitive programmer. This year he is going to win the International Olympiad in Informatics. B...
[{"input": "16 4 12\n0000000011111111\n", "output": "1\n"}, {"input": "16 1 12\n0000000011111111\n", "output": "1\n"}, {"input": "16 1 12\n0100000011111111\n", "output": "1\n"}, {"input": "16 2 12\n0100000011111111\n", "output": "0\n"}, {"input": "16 3 12\n0100000011111111\n", "output": "1\n"}, {"input": "16 2 12\n0100...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nAn old document says that a Ninja House in Kanazawa City was in fact a defensive fortress, which was designed...
[{"input": "2\n3 3 3 3 -3 3 2 -5 3 2 -5 -3 0\n3 5 3 -2 4 -3 -2 -2 -1 0", "output": "1 2 4 6\n2 1 3 8\n3 2 4 7\n4 1 3 5\n5 4 6 7\n6 1 5\n7 3 5 8\n8 2 7\n1 2 2 3 4\n2 1 1 3 4 4\n3 1 2 4\n4 1 2 2 3\n"}, {"input": "2\n3 3 3 3 -3 3 2 -5 3 2 -5 -3 0\n3 5 4 -2 4 -1 -2 -2 -1 0", "output": "1 2 4 6\n2 1 3 8\n3 2 4 7\n4 1 3 5\n5...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nWatto, the owner of a spare parts store, has recently got an order for the mechanism that can process strings...
[{"input": "1 17\ncacdbcacabccba\naccbcbcabaabbcbcaa\nbabccaaacccacbb\nbbbabbabbbcaacbaaac\nabbaccacabacaaaa\nbccbccabaacaacb\nbbbabbbbabcaacbcaac\nbcacababbbdaaca\nccbbbbababbccaab\nbbcbcc`babcaacb\naacccbabbacbabacaca\nbcaacbabcccbcbb\nacbacacbcacc\ncaaabcaaabacabbabbb\nabcbabaaaba\naacccbcaabacbcbcba\nabbaccacabbcaa...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nAnton and Dasha like to play different games during breaks on checkered paper. By the 11th grade they managed...
[{"input": "12 -11 20 200\n11 189\n12 108\n19 190\n21 27\n24 193\n26 86\n26 123\n31 180\n39 196\n107 193\n122 46\n129 103\n131 129\n132 135\n142 51\n157 22\n161 27\n195 163\n198 55\n199 64\n", "output": "Anton\n"}, {"input": "12 -11 20 200\n11 189\n12 108\n19 190\n42 27\n24 193\n26 86\n26 123\n31 180\n39 196\n107 193\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\nЗавтра у хоккейной команды, которой руководит Евгений, важный матч. Евгению нужно выбрать шесть игроков, кото...
[{"input": "29 42 50\n605 254 369 842 889 103 937 235 135 698 482 883 738 467 848 70 1000 129 970 58 94 873 140 363 133 913 834 727 185\n17 676 703 245 149 296 800 106 153 111 285 382 12 704 830 664 30 533 604 380 469 155 216 466 36 347 270 170 10 349 86 5 164 599 517 593 373 461 908 34 569 573\n614 439 78 172 109 217 ...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n# The President's phone is broken\n\nHe is not very happy.\n\nThe only letters still working are uppercase ``...
[{"input": "\"FIREYYFURYYFURYYFURRYFIRE\"", "output": "[\"You are fired! I am really furious. You are fired!\"]", "fn_name": "fire_and_fury"}, {"input": "\"FIREFIREFIREFIREFIRE\"", "output": "[\"You and you and you and you and you are fired!\"]", "fn_name": "fire_and_fury"}, {"input": "\"FURYFURYFURYFURYFURY\"", "outpu...
code_functional
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nPirates have notorious difficulty with enunciating. They tend to blur all the letters together and scream at ...
[{"input": "\"ortsp\"\n[\"sport\", \"parrot\", \"ports\", \"matey\"]", "output": "[[\"sport\", \"ports\"]]", "fn_name": "grabscrab"}, {"input": "\"oolp\"\n[\"donkey\", \"pool\", \"horse\", \"loop\"]", "output": "[[\"pool\", \"loop\"]]", "fn_name": "grabscrab"}, {"input": "\"ainstuomn\"\n[\"mountains\", \"hills\", \"mes...
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\nAny resemblance to any real championship and sport is accidental.\n\nThe Berland National team takes part in ...
[{"input": "MYCXFLPTHVGWDSRXCOI BERLAND 5:9\nSPSHVVQLXQNRUB BERLAND 0:5\nSPSHVVQLXQNRUB MYCXFLPTHVGWDSRXCOI 4:6\nZPIIZCGCLCHNLIXCPBRM MYCXFLPTHVGWDSRXCOI 7:5\nZPIIZCGCLCHNLIXCPBRM SPSHVVQLXQNRUB 3:9\n", "output": "1:0"}, {"input": "VJWNNQCMHKJVXAPRVAD BERLAND 9:3\nVJWNNQCMHKJVXAPRVAD BUDKMHAAE 7:8\nYUMJUSFUDMHTXZAQN BE...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nAndrewid the Android is a galaxy-known detective. Now he does not investigate any case and is eating chocolat...
[{"input": "20 10\n10 11 U\n12 9 U\n6 15 L\n17 4 U\n11 10 L\n7 14 L\n4 17 U\n2 19 L\n8 13 L\n14 7 U\n", "output": "11\n9\n6\n4\n1\n7\n2\n2\n8\n7\n"}, {"input": "10 10\n5 6 U\n4 7 U\n8 3 L\n8 3 L\n1 10 U\n9 2 U\n10 1 L\n10 1 L\n8 3 U\n8 3 U\n", "output": "6\n7\n3\n0\n10\n2\n1\n0\n0\n0\n"}, {"input": "15 7\n8 8 U\n6 10 L...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nA sweet little monster Om Nom loves candies very much. One day he found himself in a rather tricky situation ...
[{"input": "925819493 47350513 28377591 119226256 49881078\n", "output": "510796638\n"}, {"input": "930064129 32726326 25428197 158103592 64501049\n", "output": "355994758\n"}, {"input": "930064129 32726326 25428197 83013449 64501049\n", "output": "363523396\n"}, {"input": "951102310 39876134 24967176 70096104 43888451...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nThe three friends, Kuro, Shiro, and Katie, met up again! It's time for a party...\n\nWhat the cats do when th...
[{"input": "1000 843\n", "output": "157\n"}, {"input": "1000 488\n", "output": "488\n"}, {"input": "1000 843\n", "output": "157\n"}, {"input": "1000 488\n", "output": "488\n"}, {"input": "1000 733\n", "output": "267\n"}, {"input": "543 110\n", "output": "110\n"}, {"input": "924 576\n", "output": "348\n"}, {"input": "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\nWelcome\n\nThis kata is inspired by This Kata\n\n\nWe have a string s\n\nWe have a number n\n\nHere is a func...
[{"input": "\"this_test_will_hurt_you\"\n12345678987654321", "output": "[\"ti_etwl_utyuhsts_ilhr_o\"]", "fn_name": "jumbled_string"}, {"input": "\"codingisfornerdsyounerd\"\n10101010", "output": "[\"criyinodedsgufrnodnoser\"]", "fn_name": "jumbled_string"}, {"input": "\"better example\"\n2", "output": "[\"bexltept mera...
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\nYou are given a mysterious language (codenamed \"Secret\") available in \"Custom Invocation\" tab. Figure out...
[{"input": "-111\n", "output": "INTERCAL\n"}, {"input": "-165\n", "output": "INTERCAL\n"}, {"input": "-137\n", "output": "INTERCAL\n"}, {"input": "-116\n", "output": "INTERCAL\n"}, {"input": "-14\n", "output": "INTERCAL\n"}, {"input": "-17\n", "output": "INTERCAL\n"}, {"input": "-30\n", "output": "INTERCAL\n"}, {"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\nOnce at a team training Vasya, Petya and Sasha got a problem on implementing linear search in an array.\n\nAc...
[{"input": "10\n5 2 10 8 3 1 9 7 6 4\n9\n2 1 9 2 9 2 10 9 8\n", "output": "40 59\n"}, {"input": "10\n5 2 10 8 3 1 9 7 6 4\n9\n3 1 9 2 9 2 10 9 8\n", "output": "43 56\n"}, {"input": "10\n5 2 10 8 3 1 9 7 6 4\n9\n2 1 6 2 9 2 10 9 8\n", "output": "42 57\n"}, {"input": "10\n5 2 10 8 3 1 9 7 6 4\n9\n2 1 6 2 9 2 10 8 8\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\nRecently, Masha was presented with a chessboard with a height of $n$ and a width of $m$.\n\nThe rows on the c...
[{"input": "5\n2 2\n1 1 2 2\n1 1 2 2\n3 4\n2 2 3 3\n3 1 4 3\n1 5\n1 1 3 1\n3 1 5 1\n6 4\n1 1 4 2\n1 3 4 4\n3 4\n1 2 4 2\n2 1 3 3\n", "output": "0 4\n4 8\n2 3\n12 12\n4 8\n"}, {"input": "5\n2 2\n1 1 2 2\n1 1 2 2\n3 5\n2 2 3 2\n3 1 4 3\n1 5\n1 1 5 1\n3 1 5 1\n4 4\n1 1 4 2\n1 3 4 4\n3 4\n1 2 4 2\n2 1 3 3\n", "output": "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\nPositive integers have so many gorgeous features. \nSome of them could be expressed as a sum of two or more c...
[{"input": "5263987", "output": "[true]", "fn_name": "consecutive_ducks"}, {"input": "382131", "output": "[true]", "fn_name": "consecutive_ducks"}, {"input": "118070", "output": "[true]", "fn_name": "consecutive_ducks"}, {"input": "32768", "output": "[false]", "fn_name": "consecutive_ducks"}, {"input": "161997", "outpu...
code_functional
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nGoa'uld Apophis captured Jack O'Neill's team again! Jack himself was able to escape, but by that time Apophis...
[{"input": "8 10\n1 2 3\n2 8 3\n1 4 1\n4 3 6\n3 7 7\n4 5 5\n7 7 2\n7 8 1\n1 6 8\n6 8 7\n0\n4 1 2 3 4\n0\n0\n0\n0\n0\n0\n", "output": "8\n"}, {"input": "8 10\n1 2 3\n2 8 3\n1 4 1\n4 3 6\n3 7 7\n4 5 5\n5 7 2\n7 8 1\n1 6 8\n6 8 7\n0\n4 1 2 3 4\n0\n0\n0\n0\n0\n0\n", "output": "8"}, {"input": "7 6\n1 2 1\n1 3 3\n2 4 3\n2 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\nThis year, as in previous years, MemSQL is inviting the top 25 competitors from the Start[c]up qualification ...
[{"input": "25\n1000000 999999 999998 999997 999996 999995 999994 999993 999992 999991 999990 999989 999988 999987 999986 999985 999984 999983 999982 999981 999980 999979 999978 999977 999976\n", "output": "999975\n"}, {"input": "25\n58115 794098 753382 484882 238434 674285 690118 858677 196185 173301 349729 918792 600...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nKyoya Ootori is selling photobooks of the Ouran High School Host Club. He has 26 photos, labeled \"a\" to \"z...
[{"input": "xulsyfkuizjauadjjopu\n", "output": "526\n"}, {"input": "cskgsxywlvfeicoueglr\n", "output": "526\n"}, {"input": "gggggggggggggggggggg\n", "output": "526\n"}, {"input": "qdqdddqddqqddqddqdqd\n", "output": "526\n"}, {"input": "takttttaakaaktakttkt\n", "output": "526\n"}, {"input": "coccoooogogcgocccmcg\n", "ou...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nKarafs is some kind of vegetable in shape of an 1 × h rectangle. Tavaspolis people love Karafs and they use K...
[{"input": "469 128038 4\n143 914502 747\n74 1244223 74477\n835 246699 1021\n7 477777 444444\n", "output": "-1\n-1\n-1\n-1\n"}, {"input": "469 128038 4\n82 914502 747\n80 1244223 74477\n1360 246699 1021\n7 477777 444444\n", "output": "-1\n-1\n-1\n-1\n"}, {"input": "469 128038 4\n82 914502 747\n74 1244223 74477\n432 383...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nHexadecimal likes drawing. She has drawn many graphs already, both directed and not. Recently she has started...
[{"input": "50 21\n27 16\n42 35\n15 28\n46 17\n30 39\n47 18\n35 25\n26 24\n24 30\n28 41\n40 38\n11 21\n33 20\n43 10\n37 14\n1 43\n32 49\n49 6\n10 45\n21 50\n39 3\n", "output": "YES\n29\n1 2\n2 3\n4 5\n4 6\n5 7\n7 8\n8 9\n9 11\n12 13\n12 14\n13 15\n16 17\n18 19\n19 20\n22 23\n22 25\n23 26\n27 29\n29 31\n31 32\n33 34\n34...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nThis is the simple version of Shortest Code series. If you need some challenges, please try the [challenge ve...
[{"input": "200\n2\n1", "output": "[200]", "fn_name": "sc"}, {"input": "2\n200\n1", "output": "[200]", "fn_name": "sc"}, {"input": "3\n3\n10", "output": "[0]", "fn_name": "sc"}, {"input": "3\n3\n1", "output": "[4]", "fn_name": "sc"}, {"input": "3\n3\n3", "output": "[2]", "fn_name": "sc"}, {"input": "3\n3\n2", "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\nA priority queue is a data structure which maintains a set $S$ of elements, each of with an associated value ...
[{"input": "insert 8\ninsert -1\nextract\ninsert 12\nextract\ninsert 11\nextract\nextract\nend", "output": "8\n12\n11\n-1\n"}, {"input": "insert 9\ninsert -1\nextract\ninsert 12\nextract\ninsert 11\nextract\nextract\nend", "output": "9\n12\n11\n-1\n"}, {"input": "insert 16\ninsert 1\nextract\ninsert 15\nextract\ninsert...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nA ticket is a string consisting of six digits. A ticket is considered lucky if the sum of the first three dig...
[{"input": "5\n213132\n973894\n045207\n000000\n055776\n", "output": "YES\nNO\nYES\nYES\nNO\n"}, {"input": "2\n193758\n123456\n", "output": "NO\nNO\n"}, {"input": "2\n192758\n123456\n", "output": "NO\nNO\n"}, {"input": "1\n114514\n", "output": "NO\n"}, {"input": "1\n975310\n", "output": "NO\n"}, {"input": "1\n666999\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\nYou are given an integer $n$ ($n \\ge 0$) represented with $k$ digits in base (radix) $b$. So,\n\n$$n = a_1 \...
[{"input": "97 100\n93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93\...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nGiven are integers L and R. Find the number, modulo 10^9 + 7, of pairs of integers (x, y) (L \\leq x \\leq y ...
[{"input": "576460752303423487 1000000000000000000\n", "output": "576747015\n"}, {"input": "576460752303423488 1000000000000000000\n", "output": "576747014\n"}, {"input": "272710541579005162 367157307262253986\n", "output": "252027897\n"}, {"input": "1000000000000000000 1000000000000000000\n", "output": "1\n"}, {"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\nYou are given n strings s_1, s_2, ..., s_{n} consisting of characters 0 and 1. m operations are performed, on...
[{"input": "2\n011\n100\n63\n1 1\n3 3\n4 4\n5 5\n6 6\n7 7\n8 8\n9 9\n10 10\n11 11\n12 12\n13 13\n14 14\n15 15\n16 16\n17 17\n18 18\n19 19\n20 20\n21 21\n22 22\n23 23\n24 24\n25 25\n26 26\n27 27\n28 28\n29 29\n30 30\n31 31\n32 32\n2 2\n34 34\n35 35\n36 36\n37 37\n38 38\n39 39\n40 40\n41 41\n42 42\n43 43\n44 44\n45 45\n4...
code_stdio