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\nInitially, you have the array $a$ consisting of one element $1$ ($a = [1]$).\n\nIn one move, you can do one o...
[{"input": "5\n1\n13\n42\n2538\n1000000000\n", "output": "0\n6\n11\n99\n63244\n"}, {"input": "5\n1\n10\n143\n255\n1000000000\n", "output": "0\n5\n22\n30\n63244\n"}, {"input": "5\n1\n13\n143\n751\n1000001000\n", "output": "0\n6\n22\n53\n63244\n"}, {"input": "5\n1\n5\n42\n1337\n1000000000\n", "output": "0\n3\n11\n72\n632...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nLolek and Bolek are about to travel abroad by plane. The local airport has a special \"Choose Your Plane\" of...
[{"input": "510 132\n50 76 77 69 94 30 47 65 14 62 18 121 26 35 49 17 105 93 47 16 78 3 7 74 7 37 30 36 30 83 121 113 7 58 86 10 65 57 34 102 55 44 43 47 106 44 115 75 109 70 47 45 16 57 62 55 20 88 74 40 45 84 41 1 9 53 65 25 67 31 115 2 63 51 123 70 65 65 18 14 75 14 103 26 117 105 36 104 81 37 35 62 44 90 71 70 88 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\nAmugae is in a very large round corridor. The corridor consists of two areas. The inner area is equally divid...
[{"input": "1 1 10\n1 1 1 1\n1 1 1 1\n1 1 2 1\n1 1 1 1\n2 1 2 1\n2 1 1 1\n1 1 2 1\n1 1 2 1\n2 1 1 1\n2 1 1 1\n", "output": "YES\nYES\nYES\nYES\nYES\nYES\nYES\nYES\nYES\nYES\n"}, {"input": "1 1 10\n1 1 1 1\n1 1 1 1\n1 1 2 1\n1 1 1 1\n2 1 2 1\n2 1 1 1\n1 1 2 1\n1 1 2 1\n2 1 1 1\n2 1 1 1\n", "output": "YES\nYES\nYES\nYES\...
code_stdio
[ { "content": "You are an expert Python programmer. 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 has n boxes in her room. They have the same size and weight, but they might have different strength....
[{"input": "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 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\nIvan has number $b$. He is sorting through the numbers $a$ from $1$ to $10^{18}$, and for every $a$ writes $\...
[{"input": "2793510720\n", "output": "1792\n"}, {"input": "1102701600\n", "output": "1440\n"}, {"input": "2327925600\n", "output": "1728\n"}, {"input": "2095133040\n", "output": "1600\n"}, {"input": "9133684560\n", "output": "1920\n"}, {"input": "6983776800\n", "output": "2304\n"}, {"input": "3491888400\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\nJack is working on his jumping skills recently. Currently he's located at point zero of the number line. He w...
[{"input": "-1000000000\n", "output": "44723\n"}, {"input": "-1028109475\n", "output": "45346\n"}, {"input": "-1050321888\n", "output": "45835\n"}, {"input": "-245245154\n", "output": "22147\n"}, {"input": "-779406751\n", "output": "39482\n"}, {"input": "-904422532\n", "output": "42531\n"}, {"input": "-517744582\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\nFinished her homework, Nastya decided to play computer games. Passing levels one by one, Nastya eventually fa...
[{"input": "4237 4112\n", "output": "12836\n"}, {"input": "5000 1628\n", "output": "16627\n"}, {"input": "5000 3531\n", "output": "16469\n"}, {"input": "5000 2895\n", "output": "17105\n"}, {"input": "5000 3576\n", "output": "16424\n"}, {"input": "3474 3427\n", "output": "10469\n"}, {"input": "3400 1203\n", "output": "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\nThis problem is given in two versions that differ only by constraints. If you can solve this problem in large...
[{"input": "80 979\n2 1 1 1 2 1 1 1 3 1 4 4 2 1 1 3 1 1 2 1 4 1 1 2 5 4 8 1 3 6 5 7 2 3 4 1 2 2 6 1 2 2 4 1 1 2 3 2 8 1 1 3 3 4 1 1 2 1 4 4 1 4 3 2 6 5 2 1 4 1 2 3 2 1 3 3 1 2 1 3\n498 976 513 869 917 914 664 656 957 893 981 947 1947 693 576 958 987 822 981 718 884 729 295 683 485 998 730 894 731 975 739 854 906 740 98...
code_stdio
[ { "content": "You are an expert Python programmer. 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 upon a time when people still believed in magic, there was a great wizard Aranyaka Gondlir. After twenty...
[{"input": "8\n-7 9 6 9\n1 5 12 8\n-10 -5 12 -5\n-6 9 -9 -1\n6 13 18 -1\n-1 -2 -4 10\n1 -2 4 10\n0 -3 2 -3\n8\n-7 9 5 7\n-3 5 6 5\n-10 -5 10 -5\n-6 9 -7 -5\n6 5 9 -6\n-1 -2 -3 10\n1 -2 3 10\n-2 -5 2 -3\n0", "output": "no\nyes\n"}, {"input": "8\n-9 9 6 9\n1 5 12 8\n-10 -5 12 -5\n-6 9 -9 -1\n6 13 18 -1\n-1 -2 -4 10\n1 -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\nThe Travelling Salesman spends a lot of time travelling so he tends to get bored. To pass time, he likes to p...
[{"input": "10011010111010010111111110001010001010001010110010110010010111101111000101110101010111100101001100011001001001111011111100011110101011011001101101001111111101010010110011111101110010001000111111100011000000111111111100011000000000110101111000001011101000110000111110110000010000010011000011011110101111111101...
code_stdio
[ { "content": "You are an expert Python programmer. 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 decided to relax on his weekend and visited to the performance of famous ropewalkers: Agafon, Bonifa...
[{"input": "1000000000 1000000000 1000000000 1000000000\n", "output": "2000000000\n"}, {"input": "1000000000 1000000000 1000000000 1000000000\n", "output": "2000000000\n"}, {"input": "1000000000 1000000000 1000000000 1000010000\n", "output": "2000020000\n"}, {"input": "500000000 250000000 750000000 1000000000\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\nIn a flower bed, there are N flowers, numbered 1,2,......,N. Initially, the heights of all flowers are 0.\nYo...
[{"input": "100\n0 100 100 0 100 100 0 100 100 0 100 100 0 100 100 0 100 100 0 100 100 0 100 100 0 100 100 0 100 100 0 100 100 0 100 100 0 100 100 0 100 100 0 100 100 0 100 100 0 100 100 0 100 100 0 100 100 0 100 100 0 100 100 0 100 100 0 100 100 0 100 100 0 100 100 0 100 100 0 100 100 0 100 100 0 100 100 0 100 100 0 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\nArkady owns a non-decreasing array $a_1, a_2, \\ldots, a_n$. You are jealous of its beauty and want to destro...
[{"input": "50\n33938936 37616740 40124673 57563878 69692739 80274059 86990853 92067934 137164958 141525047 145291746 183557477 192615612 213000557 231642778 248293447 271211165 361145892 387507168 418475785 425716910 433349153 443947914 471529381 474531169 490097471 491934162 504402098 522358804 586427592 592754073 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\nGiven a number `n` we will define its scORe to be `0 | 1 | 2 | 3 | ... | n`, where `|` is the [bitwise OR ope...
[{"input": "1000000000000000000", "output": "[1152921504606846975]", "fn_name": "score"}, {"input": "10000000", "output": "[16777215]", "fn_name": "score"}, {"input": "1000000", "output": "[1048575]", "fn_name": "score"}, {"input": "49", "output": "[63]", "fn_name": "score"}, {"input": "0", "output": "[0]", "fn_name": ...
code_functional
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nOmkar is standing at the foot of Celeste mountain. The summit is $n$ meters away from him, and he can see all...
[{"input": "100\n75 122 155 169 264 333 369 416 439 486 503 541 557 635 726 745 814 845 899 914 943 1016 1090 1132 1191 1199 1258 1323 1423 1491 1557 1562 1583 1663 1707 1711 1729 1095 1819 1894 1916 1926 1953 2022 2042 2055 2061 2125 2135 2170 2183 2215 2310 2338 2377 2420 2425 2473 2484 2537 2551 2576 2577 2593 2647 ...
code_stdio
[ { "content": "You are an expert Python programmer. 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 wants to send an email to Miku on her mobile phone.\n\nThe only buttons that can be used for input on m...
[{"input": "5\n110\n100\n222220\n44033055505550666011011111090666077705550301110\n000555555550000330000444000080000200004440000", "output": ",\n.\nb\nhello, world!\nkeitai\n"}, {"input": "5\n40\n220\n222220\n44033055505550666011011111090666077705550301110\n000555555550000330000444000080000200004440000", "output": "g\nb...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nYou are given three integers A, B and C.\nDetermine whether C is not less than A and not greater than B.\n\n-...
[{"input": "-1 2 -1", "output": "Yes\n"}, {"input": "-3 0 -3", "output": "Yes\n"}, {"input": "-5 0 -3", "output": "Yes\n"}, {"input": "-4 2 -3", "output": "Yes\n"}, {"input": "-1 4 -1", "output": "Yes\n"}, {"input": "-1 8 -1", "output": "Yes\n"}, {"input": "-1 3 -1", "output": "Yes\n"}, {"input": "-2 3 -1", "output": "...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nWe have three stones at points (0, 0), (1,0), and (0,1) on a two-dimensional plane.\nThese three stones are s...
[{"input": "1000\n-531569399 91952876 -531569398 91952876 -531569398 91952877\n-692870309 -873246782 -692870308 -873246781 -692870309 -873246781\n-798019330 -828099598 -798019331 -828099598 -798019331 -828099597\n-767791333 22835338 -767791333 22835339 -767791332 22835339\n198497926 64981689 198497925 64981690 19849792...
code_stdio
[ { "content": "You are an expert Python programmer. 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 non-decreasing array of non-negative integers $a_1, a_2, \\ldots, a_n$. Also you are given a ...
[{"input": "6\n4 1\n0 0 0 1\n3 1\n3 3 3\n11 3\n0 1 2 2 3 3 3 4 4 4 4\n5 3\n1 2 3 4 5\n9 4\n2 2 3 5 7 11 13 13 17\n10 7\n0 1 1 2 3 3 4 5 5 6\n", "output": "-1\n1\n2\n2\n2\n1\n"}, {"input": "6\n4 1\n0 0 0 1\n3 1\n3 3 3\n11 3\n0 1 2 2 3 3 3 4 4 4 4\n5 3\n1 2 3 4 5\n9 4\n2 2 3 5 7 11 13 13 17\n10 7\n0 1 1 2 3 3 4 5 5 6\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-----\n\nThe only line of the input is a string of 7 characters. The first character is letter A, f...
[{"input": "A221033\n", "output": "21\n"}, {"input": "A223635\n", "output": "22\n"}, {"input": "A232726\n", "output": "23\n"}, {"input": "A102210\n", "output": "25\n"}, {"input": "A231010\n", "output": "26\n"}, {"input": "A222222\n", "output": "13\n"}, {"input": "A555555\n", "output": "31\n"}, {"input": "A102222\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\nRecently Luba bought a monitor. Monitor is a rectangular matrix of size n × m. But then she started to notice...
[{"input": "29 50 5 29\n21 42 1565821\n21 43 53275635\n21 44 2717830\n21 45 9579585\n21 46 20725775\n22 42 2568372\n22 43 9584662\n22 44 31411635\n22 45 5089311\n22 46 4960702\n23 42 11362237\n23 43 42200296\n23 44 18762146\n23 45 8553819\n23 46 4819516\n24 42 10226552\n24 43 21022685\n24 44 32940182\n24 45 39208099\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\nEmily's birthday is next week and Jack has decided to buy a present for her. He knows she loves books so he g...
[{"input": "100 10\n7 4 5 5 10 10 5 8 5 7 4 5 4 6 8 8 2 6 3 3 10 7 10 8 6 2 7 3 9 7 7 2 4 5 2 4 9 5 10 1 10 3 10 4 1 3 4 2 6 9 9 10 10 6 2 5 6 1 9 10 4 10 3 4 10 5 5 4 10 4 5 3 7 10 2 7 3 6 9 6 1 6 5 2 4 6 6 4 4 1 5 1 6 6 6 8 8 6 2 6\n", "output": "4433\n"}, {"input": "100 10\n7 4 5 5 10 10 5 8 5 7 4 5 4 6 8 8 2 6 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\nRead problems statements in Mandarin Chinese , Russian and Vietnamese as well. \nAkhil comes across a string ...
[{"input": "2\nbabb\n4\ncbbe\n3", "output": "babb\nbbe\n"}, {"input": "2\nbabb\n4\ncbbe\n2", "output": "babb\nbb\n"}, {"input": "2\nabdc\n3\nbcbb\n3", "output": "abc\nbbb\n"}, {"input": "2\ncbda\n3\nbcbb\n3", "output": "bda\nbbb\n"}, {"input": "2\nbbcb\n3\nbbeb\n3", "output": "bbb\nbbb\n"}, {"input": "2\nabdc\n3\nbcab\...
code_stdio
[ { "content": "You are an expert Python programmer. 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 program which replace all the lower-case letters of a given text with the corresponding captital lett...
[{"input": "this is b pen.", "output": "THIS IS B PEN.\n"}, {"input": "tiis is b pen.", "output": "TIIS IS B PEN.\n"}, {"input": "tiis is a pen.", "output": "TIIS IS A PEN.\n"}, {"input": "tiis it a pen.", "output": "TIIS IT A PEN.\n"}, {"input": "tiis it a pem.", "output": "TIIS IT A PEM.\n"}, {"input": "tiis it a .me...
code_stdio
[ { "content": "You are an expert Python programmer. 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, a chaotic virus Hexadecimal advanced a new theorem which will shake the Universe. She thinks that e...
[{"input": "165580141\n", "output": "0 0 165580141\n"}, {"input": "267914296\n", "output": "0 0 267914296\n"}, {"input": "102334155\n", "output": "0 0 102334155\n"}, {"input": "433494437\n", "output": "0 0 433494437\n"}, {"input": "701408733\n", "output": "0 0 701408733\n"}, {"input": "24157817\n", "output": "0 0 24157...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nComplete the function that takes two numbers as input, ```num``` and ```nth``` and return the `nth` digit of ...
[{"input": "-67854\n-57", "output": "[-1]", "fn_name": "find_digit"}, {"input": "678998\n0", "output": "[-1]", "fn_name": "find_digit"}, {"input": "-2825\n3", "output": "[8]", "fn_name": "find_digit"}, {"input": "-1234\n2", "output": "[3]", "fn_name": "find_digit"}, {"input": "-5540\n1", "output": "[0]", "fn_name": "fi...
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\nSquirrel Liss loves nuts. There are n trees (numbered 1 to n from west to east) along a street and there is a...
[{"input": "5\n2\n1\n2\n1\n1\n", "output": "14\n"}, {"input": "5\n2\n1\n2\n2\n1\n", "output": "14\n"}, {"input": "5\n3\n1\n2\n2\n1\n", "output": "16\n"}, {"input": "5\n3\n1\n2\n3\n1\n", "output": "18\n"}, {"input": "5\n2\n1\n2\n3\n0\n", "output": "17\n"}, {"input": "5\n2\n2\n2\n3\n0\n", "output": "15\n"}, {"input": "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\nThere is a square grid with N rows and M columns. Each square contains an integer: 0 or 1. The square at the ...
[{"input": "1 0\n-1 -1 -2\n-1 -1 2", "output": "0\n"}, {"input": "1 0\n-1 -1 -1\n-1 0 2", "output": "0\n"}, {"input": "1 0\n-1 -1 -2\n-1 0 2", "output": "0\n"}, {"input": "1 0\n-1 -2 -2\n-1 0 2", "output": "0\n"}, {"input": "1 0\n-1 -1 -2\n-1 0 9", "output": "0\n"}, {"input": "1 3\n-1 -1 -1\n-1 0 0", "output": "4\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\nGuy-Manuel and Thomas have an array $a$ of $n$ integers [$a_1, a_2, \\dots, a_n$]. In one step they can add $...
[{"input": "1\n100\n64 -64 64 -64 64 -64 64 -64 64 -64 64 -64 64 -64 64 -64 64 -64 64 -64 64 -64 64 -64 64 -64 64 -64 64 -64 64 -64 64 -64 64 -64 64 -64 64 -64 64 -64 64 -64 64 -64 64 -64 64 -64 64 -64 64 -64 64 -64 64 -64 64 -64 64 -64 64 -64 64 -64 64 -64 64 -64 64 -64 64 -64 64 -64 64 -64 64 -64 64 -64 64 -64 64 -64...
code_stdio
[ { "content": "You are an expert Python programmer. 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 program which prints the central coordinate $(p_x, p_y)$ and the radius $r$ of a circumscribed circle...
[{"input": "1\n2.8556561587971867 4.098709639034822 6.878795580867833 3.0145101929316445 3.6376948130130224 3.91920391890877", "output": "-6.763 -39.601 44.746\n"}, {"input": "1\n1.9722767865259834 2.1872698203510574 5.0349339525211345 1.6314771532390826 2.4312803667981866 3.503430391497748", "output": "3.586 2.363 1.6...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nA smelt fishing tournament was held at Lake Hibara. It seems that catch and release is recommended this time....
[{"input": "3 5\n1 14\n2 5\n1 3\n3 4\n2 11", "output": "1 14\n1 14\n1 17\n1 17\n1 17\n"}, {"input": "3 5\n1 4\n2 10\n1 5\n3 4\n3 11", "output": "1 4\n2 10\n2 10\n2 10\n3 15\n"}, {"input": "3 5\n1 4\n2 19\n1 5\n3 4\n3 11", "output": "1 4\n2 19\n2 19\n2 19\n2 19\n"}, {"input": "3 5\n1 4\n2 5\n1 7\n3 4\n3 11", "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\nTenten runs a weapon shop for ninjas. Today she is willing to sell $n$ shurikens which cost $1$, $2$, ..., $n...
[{"input": "10\n+\n- 3\n+\n+\n+\n+\n- 1\n- 7\n- 9\n- 10\n+\n+\n+\n- 4\n- 5\n- 8\n+\n- 6\n+\n- 2\n", "output": "YES\n3 10 9 7 1 8 5 4 6 2 \n"}, {"input": "10\n+\n- 3\n+\n+\n+\n+\n- 1\n- 7\n- 9\n- 10\n+\n+\n+\n- 4\n- 5\n- 8\n+\n- 6\n+\n- 2\n", "output": "YES\n3 10 9 7 1 8 5 4 6 2\n"}, {"input": "10\n+\n- 3\n+\n+\n+\n+\n-...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nOne of the games that uses the Hyakunin Isshu tag is \"Buddhist turning\". It is a simple game that uses only...
[{"input": "2\nSSSSSSSSSSSSSSSLLLLLLLLLLLLLLLLLLLLLMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM\n9\nSSSSSSSSSSSSSSLLLLLLLLLMLLLLLLLLLLMMMMMMMMMMMMMMMMMMMMMMMMMMMMMLMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMSL\n6\nMMMMMMSMSLLMMMSMMSLMMMLMMMMLSLLLLMMSMMLMMLLMSSSLMMMMLMLSMLMSMMMMMMMSMMMMMMLMMMMMSMMMLMMLMMMMMMM...
code_stdio
[ { "content": "You are an expert Python programmer. 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 a biologist working on the amino acid composition of proteins. Every protein consists of a long chai...
[{"input": "\"PLPPLPLLEELELRPFFMAAGGTPLAMMGG\"\n[\"P\", \"E\", \"L\", \"R\", \"F\", \"M\", \"A\", \"G\", \"T\"]", "output": "[100]", "fn_name": "aa_percentage"}, {"input": "\"PLPPLPLLEELELRPFFMAAGGTPLAMMGG\"\n[\"P\", \"L\"]", "output": "[43]", "fn_name": "aa_percentage"}, {"input": "\"RLMADDFFGQTLMAAAAAAQERRR\"\n[\"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\nVus the Cossack has a field with dimensions n × m, which consists of \"0\" and \"1\". He is building an infin...
[{"input": "1 2 10\n01\n4 1 5 1\n1 2 1 16\n3 4 3 5\n1 1 1 5\n4 3 6 5\n1 1 1 3\n1 3 4 5\n3 2 3 6\n3 1 5 2\n3 1 3 5\n", "output": "1\n8\n1\n3\n5\n2\n6\n2\n3\n2\n"}, {"input": "1 2 10\n01\n4 1 5 2\n1 2 1 4\n3 4 3 5\n1 3 1 5\n4 3 5 5\n1 1 3 3\n1 3 4 5\n3 2 3 4\n3 1 5 2\n3 1 3 5\n", "output": "2\n2\n1\n2\n3\n4\n6\n1\n3\n2\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\nMarina loves Sasha. But she keeps wondering whether Sasha loves her. Of course, the best way to know it is fo...
[{"input": "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 99 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\nIn this Kata, you will be given an integer array and your task is to return the sum of elements occupying pri...
[{"input": "[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15]", "output": "[47]", "fn_name": "total"}, {"input": "[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13]", "output": "[33]", "fn_name": "total"}, {"input": "[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11]", "output": "[21]", "fn_name": "total"}, {"input": "[1, 2, 3, 4, 5, 6, 7...
code_functional
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n# Task\n The string is called `prime` if it cannot be constructed by concatenating some (more than one) equal...
[{"input": "\"fdsyffdsyffdsyffdsyffdsyf\"", "output": "[false]", "fn_name": "prime_string"}, {"input": "\"utdutdtdutd\"", "output": "[true]", "fn_name": "prime_string"}, {"input": "\"abab\"", "output": "[false]", "fn_name": "prime_string"}, {"input": "\"aaaa\"", "output": "[false]", "fn_name": "prime_string"}, {"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\nMorning desert sun horizon\n\nRise above the sands of time...\n\nFates Warning, \"Exodus\"\n\nAfter crossing ...
[{"input": "7\n1\na\n2\nab\n2\nab\n2\nba\n2\nbc\n26\nabcdeqghujklmnopfrstivwxyz\n26\nabcdefghijklmnopqrstuvwxyz\n", "output": "1\n3\n3\n2\n3\n296\n351\n"}, {"input": "7\n1\na\n2\nca\n2\nab\n2\nba\n2\nad\n26\nabcdeqghujklmnopfrstivwxyz\n26\nabcdefgpijklmnohqrstuvwxyz\n", "output": "1\n2\n3\n2\n3\n296\n321\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\nThere are a total of W x H squares, with H rows vertically and W columns horizontally. Some squares are marke...
[{"input": "10 10\n...*....**\n..........\n**....**..\n........*.\n..*.......\n**........\n.*........\n..........\n....*..***\n.*....*...\n10 10\n..*....*..\n.*.*...*..\n*****..*..\n*...*..*..\n*...*..*..\n..........\n.***.*..**\n..*..*...*\n.*...*...*\n****..***.\n2 3\n...\n...\n0 0", "output": "28\n12\n6\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\nA very passive-aggressive co-worker of yours was just fired. While he was gathering his things, he quickly in...
[{"input": "\"Uif usjdl up uijt lbub jt tjnqmf\"", "output": "[\"The trick to this kata is simple\"]", "fn_name": "one_down"}, {"input": "\"J ipqf zpv bsf ibwjoh b ojdf ebz\"", "output": "[\"I hope you are having a nice day\"]", "fn_name": "one_down"}, {"input": "[\"Hello there\", \"World\"]", "output": "[\"Input is no...
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 currently in the United States of America. The main currency here is known as the United States Dolla...
[{"input": "730\n\"Bangladeshi Taka\"", "output": "[\"You now have 59860 of Bangladeshi Taka.\"]", "fn_name": "convert_my_dollars"}, {"input": "25\n\"Bangladeshi Taka\"", "output": "[\"You now have 2050 of Bangladeshi Taka.\"]", "fn_name": "convert_my_dollars"}, {"input": "768\n\"Dominican Peso\"", "output": "[\"You no...
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\nAndrewid the Android is a galaxy-famous detective. He is now investigating the case of vandalism at the exhib...
[{"input": "100 19\n6 62 72 83 91 94 97\n3 61 84 99\n1 63\n5 46 53 56 69 78\n5 41 43 49 74 89\n5 55 57 79 85 87\n3 47 59 98\n3 64 76 82\n3 48 66 75\n2 60 88\n2 67 77\n4 40 51 73 95\n41 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 44 71 81\n4 58 65 90 93\n1 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\nMaki is a house cat. One day she fortunately came at a wonderful-looking dried fish. Since she felt not hungr...
[{"input": "3\n0 -1 100 001\n60 100 50\n100 110 10\n25 75 50\n4\n0 0 100 000\n50 50 50\n150 50 50\n50 150 50\n150 117 50\n0", "output": "0\n0\n"}, {"input": "3\n0 0 100 101\n60 100 50\n100 100 10\n80 80 50\n4\n0 0 100 100\n50 50 50\n150 50 50\n50 150 50\n150 150 50\n0", "output": "2\n0\n"}, {"input": "3\n0 0 100 101\n6...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nLast week, Hamed learned about a new type of equations in his math class called Modular Equations. Lets defin...
[{"input": "1000000000 1000000000\n", "output": "infinity\n"}, {"input": "1000000000 1000000000\n", "output": "infinity"}, {"input": "1000000000 1000001000\n", "output": "0\n"}, {"input": "1204165230 1287214915\n", "output": "0\n"}, {"input": "1000000000 1010001000\n", "output": "0\n"}, {"input": "1000000000 333333300\...
code_stdio
[ { "content": "You are an expert Python programmer. 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 write a function that does just what the title suggests (so, fair warning, be aware that you ...
[{"input": "[1, 2, 3, 4, 5]\n5", "output": "[[1, 2, 3, 4, 5]]", "fn_name": "first_n_smallest"}, {"input": "[2, 1, 2, 3, 4, 2]\n4", "output": "[[2, 1, 2, 2]]", "fn_name": "first_n_smallest"}, {"input": "[1, 2, 3, 4, 2]\n4", "output": "[[1, 2, 3, 2]]", "fn_name": "first_n_smallest"}, {"input": "[2, 1, 2, 3, 4, 2]\n3", "o...
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\nLet us consider the following operations on a string consisting of A and B:\n - Select a character in a strin...
[{"input": "AAAAABBBBAAABBBBAAAA\nBBBBAAABBBBBBAAAAABB\n10\n2 15 2 13\n2 13 6 16\n1 13 2 20\n4 20 3 20\n1 18 9 19\n2 14 1 11\n3 20 3 15\n6 16 1 17\n4 18 8 20\n7 20 3 14\n", "output": "YES\nYES\nYES\nYES\nYES\nYES\nNO\nNO\nNO\nNO\n"}, {"input": "AAAAABBBBAAABBBBAAAA\nBBBBAAABBBBBBAAAAABB\n10\n2 15 2 13\n2 13 6 16\n1 13 ...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nThere are N slimes lining up from left to right. The colors of these slimes will be given as a string S of le...
[{"input": "99798\nbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nInternet search engines, such as Google, automatically sort and categorize web pages around the world to crea...
[{"input": "niW todax's premiminary contest `nd eb eqjgilaue ot vhsit Uniwersity of Aizu-", "output": "niW `nd vhsit Aizu-\n"}, {"input": "pUi sod'xsa yqnlibiocro tsfsloc `cn bg fualhgdpj pv hjssv Umjweqsity dn vyjA-", "output": "pUi `cn hjssv vyjA-\n"}, {"input": "Win today's preliminary contest and be qualified to vi...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nMaxim wants to buy an apartment in a new house at Line Avenue of Metropolis. The house has n apartments that ...
[{"input": "1000000000 333333333\n", "output": "1 666666666\n"}, {"input": "1000000000 333333334\n", "output": "1 666666666\n"}, {"input": "1000000000 333333333\n", "output": "1 666666666\n"}, {"input": "1000000000 333333334\n", "output": "1 666666666\n"}, {"input": "1000000000 596874994\n", "output": "1 403125006\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\nComplete the function `scramble(str1, str2)` that returns `true` if a portion of ```str1``` characters can b...
[{"input": "\"cedewaraaossoqqyt\"\n\"codewars\"", "output": "[true]", "fn_name": "scramble"}, {"input": "\"scriptingjava\"\n\"javascript\"", "output": "[true]", "fn_name": "scramble"}, {"input": "\"scriptsjava\"\n\"javascripts\"", "output": "[true]", "fn_name": "scramble"}, {"input": "\"scriptjavx\"\n\"javascript\"", "...
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\nEach student eagerly awaits the day he would pass the exams successfully. Thus, Vasya was ready to celebrate,...
[{"input": "100 100 100 100\n", "output": "-1\n"}, {"input": "101 100 100 100\n", "output": "-1\n"}, {"input": "100 100 100 100\n", "output": "-1"}, {"input": "100 0 100 100\n", "output": "-1\n"}, {"input": "100 100 100 0\n", "output": "-1\n"}, {"input": "0 100 100 100\n", "output": "-1\n"}, {"input": "100 100 0 100\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\nSam has been teaching Jon the Game of Stones to sharpen his mind and help him devise a strategy to fight the ...
[{"input": "124\n34\n44\n21\n55\n1\n36\n53\n31\n58\n59\n11\n40\n20\n32\n43\n48\n16\n5\n35\n20\n21\n36\n15\n2\n11\n56\n58\n2\n40\n47\n29\n21\n4\n21\n1\n25\n51\n55\n17\n40\n56\n35\n51\n1\n34\n18\n54\n44\n1\n43\n16\n28\n21\n14\n57\n53\n29\n44\n59\n54\n47\n21\n43\n41\n11\n37\n30\n4\n39\n47\n40\n50\n52\n9\n32\n1\n19\n30\n20...
code_stdio
[ { "content": "You are an expert Python programmer. 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 tree, which consists of $n$ vertices. Recall that a tree is a connected undirected graph with...
[{"input": "14 2\n3 2 3 1 2 3 6 2 3 1 4 2 1 3\n12 10\n2 7\n13 12\n14 11\n10 5\n1 2\n11 4\n4 9\n14 8\n12 4\n7 14\n13 6\n10 3\n", "output": "15\n"}, {"input": "14 2\n3 2 3 1 2 3 4 2 3 1 4 2 1 3\n12 10\n2 7\n13 12\n14 11\n10 5\n1 2\n11 4\n4 9\n14 8\n12 4\n7 9\n13 6\n10 3\n", "output": "15\n"}, {"input": "14 4\n6 4 1 2 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\nFor a given weighted undirected graph G(V, E), find the distance of the shortest route that meets the followi...
[{"input": "6 5\n0 1 0\n0 2 2\n1 3 3\n1 4 13\n1 0 6", "output": "42\n"}, {"input": "6 5\n0 1 0\n0 2 2\n1 3 3\n1 1 13\n1 0 6", "output": "29\n"}, {"input": "6 5\n0 0 1\n0 2 2\n1 3 3\n1 4 11\n2 0 6", "output": "37\n"}, {"input": "6 5\n0 1 0\n0 2 0\n1 3 3\n1 4 13\n1 0 6", "output": "38\n"}, {"input": "4 5\n0 1 1\n0 2 2\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\nLittle Petya very much likes playing with little Masha. Recently he has received a game called \"Zero-One\" a...
[{"input": "1110110101111111001111111110111011100001110111011001011111111111011010011111?111111?011111110001010110011111010111100111?111101010011101010?011111101010111111111101111010111?1111111100110110001111101111100100110011101111011110111000111?011110?111110?1011010111101111101111010100111110101111011101110011101001...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nWhereas humans nowadays read fewer and fewer books on paper, book readership among marmots has surged. Heidi ...
[{"input": "11 1\n1 2 3 10 1 10 10 1 1 3 5\n", "output": "9\n"}, {"input": "11 1\n1 2 3 5 1 10 10 1 1 3 5\n", "output": "9\n"}, {"input": "11 1\n1 2 3 5 1 10 10 1 1 3 5\n", "output": "9\n"}, {"input": "11 1\n1 4 3 5 1 10 10 1 1 3 5\n", "output": "9\n"}, {"input": "11 1\n1 2 3 5 1 10 8 1 1 3 5\n", "output": "10\n"}, {"i...
code_stdio
[ { "content": "You are an expert Python programmer. 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 (a popular Russian name that means 'Roman') loves the Little Lvov Elephant's lucky numbers.\n\nLet us re...
[{"input": "49 2\n34644511 221617567 136135827 144208961 359490601 86708232 545390603 188605873 64330753 488776302 104482891 112998614 437791390 46521319 70778345 339141601 136198441 292941209 299339510 582531183 555958105 437904637 74219097 135224808 236010407 122674666 438442529 186501223 63932449 407678041 596993853...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nBerPhone X is almost ready for release with n applications being preinstalled on the phone. A category of an ...
[{"input": "3\n11\n2 5 1 10 1 5 1 1 1 1 5\n6\n2 2 2 2 2 1\n5\n4 3 3 1 2\n", "output": "7\n4\n4\n"}, {"input": "3\n11\n2 5 1 10 1 5 1 1 1 1 5\n6\n1 2 2 2 2 1\n5\n4 3 3 1 2\n", "output": "7\n3\n4\n"}, {"input": "3\n11\n4 5 1 10 1 5 1 1 1 1 5\n6\n2 2 2 2 2 1\n5\n4 3 3 1 2\n", "output": "7\n4\n4\n"}, {"input": "3\n11\n4 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\nLittle Petya wanted to give an April Fools Day present to some scientists. After some hesitation he decided t...
[{"input": "13\n", "output": "1\n"}, {"input": "16\n", "output": "0\n"}, {"input": "11\n", "output": "0\n"}, {"input": "10\n", "output": "1\n"}, {"input": "15\n", "output": "1\n"}, {"input": "12\n", "output": "0\n"}, {"input": "14\n", "output": "0\n"}, {"input": "1\n", "output": "1\n"}, {"input": "7\n", "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\nVasya and Petya take part in a Codeforces round. The round lasts for two hours and contains five problems.\n\...
[{"input": "26\n3 -1 71 -1 42\n85 72 48 38 -1\n-1 -1 66 24 -1\n46 -1 60 99 107\n53 106 51 -1 104\n-1 17 98 54 -1\n44 107 66 65 102\n47 40 62 34 5\n-1 10 -1 98 -1\n-1 69 47 85 75\n12 62 -1 15 -1\n48 63 72 32 99\n91 104 111 -1 -1\n92 -1 52 -1 11\n118 25 97 1 108\n-1 61 97 37 -1\n87 47 -1 -1 21\n79 87 73 82 70\n90 108 19 ...
code_stdio
[ { "content": "You are an expert Python programmer. 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 problem differs from the next one only in the presence of the constraint on the equal length of all numb...
[{"input": "100\n463 6421 2912 1546 3999 5175 4357 2259 7380 6081 1148 7857 3532 4168 5643 14175 2568 6681 975 9216 4590 5217 6215 7422 6631 1651 39 4268 8290 2022 3175 8281 1552 980 9314 234 934 5133 6712 1880 2766 5042 5004 5455 6038 6010 6022 1553 4015 4544 3985 4033 223 7682 6302 2121 4832 3956 9872 8340 5327 6763 ...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nLimak is a little polar bear. He doesn't have many toys and thus he often plays with polynomials.\n\nHe consi...
[{"input": "100 1000\n-62 57 -27 -67 49 -10 66 -64 -36 -78 62 -75 -39 75 -47 -36 41 -88 62 -43 22 29 -20 58 40 16 71 -2 -87 12 86 -90 -92 67 -12 -48 -10 -26 78 68 22 -3 66 -95 -81 34 14 -76 -27 76 -60 87 -84 3 35 -60 46 -65 29 -29 2 -44 -55 18 -75 91 36 34 -86 53 59 -54 -29 33 -95 66 9 72 67 -44 37 44 32 -52 -34 -4 -99...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nBear Limak likes watching sports on TV. He is going to watch a game today. The game lasts 90 minutes and ther...
[{"input": "90\n1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90\n", "output": "90\n"}, {"input": "90\n1 2 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\nIgor has been into chess for a long time and now he is sick of the game by the ordinary rules. He is going to...
[{"input": "13\n.............\n.....o.......\n......o......\n.............\n...o........o\no............\n.............\n..o..........\n..........ooo\n.............\n..o...o.....o\n.............\n.o........o..\n", "output": "YES\nxx......................x\nxx.....x........x.......x\n........................x\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 have a grid with `$m$` rows and `$n$` columns. Return the number of unique ways that start from the top-l...
[{"input": "123\n456", "output": "[448843261729071620474858205566477025894357385375655014634306680560209909590802545266425906052279365647506075241055256064119806400]", "fn_name": "number_of_routes"}, {"input": "10\n10", "output": "[184756]", "fn_name": "number_of_routes"}, {"input": "100\n3", "output": "[176851]", "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\nProblem statement\n\nJota knows only the characters from `a` to` z` and the addition symbol `+`. Jota has an ...
[{"input": "5\nb+a+a", "output": "5\n"}, {"input": "5\nb+b+b", "output": "3\n"}, {"input": "5\na+a+b", "output": "5\n"}, {"input": "5\na+b+b", "output": "5\n"}, {"input": "5\nb+b+a", "output": "5\n"}, {"input": "5\nc+a+a", "output": "5\n"}, {"input": "5\nb+a+b", "output": "5\n"}, {"input": "5\nc+a+b", "output": "5\n"},...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nVasya has the square chessboard of size n × n and m rooks. Initially the chessboard is empty. Vasya will cons...
[{"input": "500 43\n176 85\n460 171\n233 260\n73 397\n474 35\n290 422\n309 318\n280 415\n485 169\n106 22\n355 129\n180 301\n205 347\n197 93\n263 318\n336 382\n314 350\n476 214\n367 277\n333 166\n500 376\n236 17\n94 73\n116 204\n166 50\n168 218\n144 369\n340 91\n274 360\n171 360\n41 251\n262 478\n27 163\n151 491\n208 41...
code_stdio
[ { "content": "You are an expert Python programmer. 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, Bob and Charlie are playing Card Game for Three, as below:\n - At first, each of the three players has...
[{"input": "abcb\naacb\nbccc\n", "output": "C\n"}, {"input": "abcb\naabb\nbccc", "output": "B\n"}, {"input": "aaca\naabb\ncccc", "output": "C\n"}, {"input": "abcb\nbbaa\nbccc", "output": "B\n"}, {"input": "aacb\nbbaa\nbccc", "output": "A\n"}, {"input": "aacb\nbbaa\ncccb", "output": "A\n"}, {"input": "aaca\nbbaa\ncccb",...
code_stdio
[ { "content": "You are an expert Python programmer. 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 ladder. He wants to climb this ladder, but being a precocious child, he wonders about exactly how man...
[{"input": "14\n7", "output": "[7936]", "fn_name": "count_ways"}, {"input": "10\n6", "output": "[492]", "fn_name": "count_ways"}, {"input": "5\n3", "output": "[13]", "fn_name": "count_ways"}, {"input": "1\n3", "output": "[1]", "fn_name": "count_ways"}, {"input": "3\n3", "output": "[4]", "fn_name": "count_ways"}, {"inpu...
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\nProblem\n\nNeat lives on the world line for a total of 360 days until the 30th of every month for 1 year and ...
[{"input": "8\n2 9 297 297\n8 6 359 211\n8 16 28 233\n7 9 113 143\n3 18 315 190\n10 18 277 300\n9 5 276 88\n3 5 322 40", "output": "297\n"}, {"input": "8\n2 9 297 297\n8 6 359 211\n8 16 28 288\n7 9 113 143\n3 18 315 190\n10 18 277 300\n9 5 276 88\n3 5 322 40", "output": "297"}, {"input": "2\n2 21 10 13\n2 -1 10 430", "...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nLittle kids, Jack and Evan like playing their favorite game Glass-and-Stone. Today they want to play somethin...
[{"input": "10 6\nCLICK 2\nCLICK 3\nCLICK 3\nCLICK 2\nCLOSEALL\nCLICK 1", "output": "1\n2\n1\n0\n0\n1\n"}, {"input": "16 6\nCLICK 2\nCLICK 1\nCLICK 3\nCLICK 3\nCLOSEALL\nCLICK 1", "output": "1\n2\n3\n2\n0\n1\n"}, {"input": "16 6\nCLICK 2\nCLICK 1\nCLICK 3\nCLICK 6\nCLOSEALL\nCLICK 1", "output": "1\n2\n3\n4\n0\n1\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\nSome days ago, I learned the concept of LCM (least common multiple). I've played with it for several times an...
[{"input": "1559681\n", "output": "3794080223197672320\n"}, {"input": "1362308\n", "output": "2528276952771261580\n"}, {"input": "1165938\n", "output": "1584981275574379920\n"}, {"input": "1001000\n", "output": "1002998992999003000\n"}, {"input": "1601454\n", "output": "4107161482918855956\n"}, {"input": "1292784\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\nMr. Dango's family has extremely huge number of members. Once it had about 100 members, and now it has as man...
[{"input": "3\n1 2 2 3\n0 1 2 2\n1 2 0 3\n7\n1 2 0 1\n0 2 3 1\n0 0 3 1\n2 1 1 2\n5 3 4 2\n4 3 6 0\n4 -1 5 1\n0", "output": "1\n1\n"}, {"input": "3\n1 1 2 3\n0 1 2 2\n1 2 0 3\n7\n1 2 2 1\n0 2 3 2\n0 1 3 -1\n2 1 1 2\n5 3 4 2\n4 3 6 2\n4 2 5 1\n0", "output": "1\n2\n"}, {"input": "3\n1 1 2 3\n0 1 2 2\n1 2 0 3\n7\n1 2 2 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\nOne day Vasya the Hipster decided to count how many socks he had. It turned out that he had a red socks and b...
[{"input": "171 100\n", "output": "100 35\n"}, {"input": "171 110\n", "output": "110 30\n"}, {"input": "287 100\n", "output": "100 93\n"}, {"input": "287 101\n", "output": "101 93\n"}, {"input": "100 100\n", "output": "100 0\n"}, {"input": "100 100\n", "output": "100 0\n"}, {"input": "110 100\n", "output": "100 5\n"}, ...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nThere is a simple directed graph G with N vertices, numbered 1, 2, \\ldots, N.\n\nFor each i and j (1 \\leq i...
[{"input": "10 1000000000000000000\n-1 0 1 1 0 0 0 1 1 0\n0 0 0 0 -1 1 1 2 0 0\n0 1 0 1 0 1 0 1 -1 1\n1 1 1 0 1 1 0 1 1 0\n0 1 1 1 -1 1 0 1 1 1\n0 0 -1 1 0 0 1 0 1 0\n-1 0 0 2 1 0 0 1 0 2\n1 0 0 0 1 0 1 0 0 0\n0 0 0 0 0 1 0 0 0 0\n1 0 1 1 1 0 1 1 0 0", "output": "401226680\n"}, {"input": "10 1000000000000000000\n0 0 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\nA student of z-school found a kind of sorting called z-sort. The array a with n elements are z-sorted if two ...
[{"input": "100\n82 51 81 26 37 17 78 92 68 15 8 86 120 8 87 77 67 10 15 12 100 25 92 47 21 78 20 63 13 49 41 36 41 79 16 76 87 69 3 76 80 60 100 49 70 59 72 8 38 71 45 97 71 14 76 54 81 4 113 44 39 29 92 3 49 22 53 114 86 52 74 12 79 43 26 23 44 9 82 47 19 40 12 9 3 23 37 85 46 22 126 52 98 64 21 77 52 17 62 127\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\nLuba is surfing the Internet. She currently has n opened tabs in her browser, indexed from 1 to n from left t...
[{"input": "100 1 100 100\n", "output": "100\n"}, {"input": "100 1 100 100\n", "output": "100\n"}, {"input": "100 100 2 99\n", "output": "100\n"}, {"input": "100 100 2 99\n", "output": "100\n"}, {"input": "100 50 2 100\n", "output": "49\n"}, {"input": "100 50 49 99\n", "output": "53\n"}, {"input": "100 50 2 99\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\nHigh school student Vasya got a string of length n as a birthday present. This string consists of letters 'a'...
[{"input": "100 10\nbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb\n", "output": "100\n"}, {"input": "100 30\nbbaabaaabbbbbbbbbbaababababbbbbbaabaabbbbbbbbabbbbbabbbbabbbbbbbbaabbbbbbbbbabbbbbabbbbbbbbbaaaaabba\n", "output": "100\n"}, {"input": "100 45\naabababbabbb...
code_stdio
[ { "content": "You are an expert Python programmer. 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 lives in another world. There are slimes (creatures) of 10000 colors in this world. Let us call the...
[{"input": "14\n1 -1 4 2 -1 4 3 3 4 6 0 2 3 4", "output": "1\n"}, {"input": "14\n1 -1 4 2 -1 4 3 3 4 6 1 2 3 4", "output": "1\n"}, {"input": "14\n0 -2 4 2 -1 4 3 2 5 6 1 2 3 4", "output": "0\n"}, {"input": "14\n0 -2 4 2 -1 4 3 4 5 6 1 2 3 4", "output": "0\n"}, {"input": "14\n0 -2 4 2 -1 4 3 4 3 6 1 2 3 4", "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\nProblem\n\nHere is a list of strings. Let's take a break and play with shiritori. Shiritori is performed acco...
[{"input": "7\nshf\nslldr\nsea\nshells\nyb\nteh\nsaeshore", "output": "a\nb\ne\nf\nh\nr\n"}, {"input": "7\nshf\nsller\nsae\nshells\nby\nteh\nsfeshora", "output": "a\ne\nf\nh\nr\ny\n"}, {"input": "7\nshg\nsller\nsae\nshells\nby\nteh\nsfeshora", "output": "a\ne\ng\nh\nr\ny\n"}, {"input": "7\nsfg\nsskle\nscb\nsiflls\nax\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\nDeoxyribonucleic acid, DNA is the primary information storage molecule in biological systems. It is composed ...
[{"input": "\"GAAGCTTATCCGTTCCTGAAGGCTGTGGCATCCTCTAAATCAGACTTGGCTACGCCGTTAGCCGAGGGCTTAGCGTTGAGTGTCATTATATACGCGGCCTGCGACCTGGCCACACAATGCCCTCGAAAATTTTTCTTTCGGTTATACGAGTTGCGAAACCTTTCGCGCGTAGACGAAGAATTTGAAGTGGCCTACACCGTTTGGAAAGCCGTTCTCATTAGAATGGTACCGACTACTCGGCTCGGAGTCATTGTATAGGGAGAGTGTCGTATCAACATCACACACTTTTAGCATTTAAGGTCCATG...
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\nFor integers b (b \\geq 2) and n (n \\geq 1), let the function f(b,n) be defined as follows:\n - f(b,n) = n, ...
[{"input": "100000000000\n100000000000\n", "output": "100000000001\n"}, {"input": "100000000000\n50000000000\n", "output": "50000000001\n"}, {"input": "99999515529\n49999757765\n", "output": "49999757765\n"}, {"input": "99999999977\n49999999989\n", "output": "49999999989\n"}, {"input": "49234683534\n2461734011\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\nRight now she actually isn't. But she will be, if you don't solve this problem.\n\nYou are given integers n, ...
[{"input": "1999999999\n1000000000\n1385852\n184569875\n", "output": "1385852183184023\n"}, {"input": "1000999777\n1934999345\n2356346\n34534565\n", "output": "2358701818178496\n"}, {"input": "1000999777\n1934999345\n2356346\n34534565\n", "output": "2358701818178496\n"}, {"input": "1000000000\n1999999999\n789987\n18456...
code_stdio
[ { "content": "You are an expert Python programmer. 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 and Aoki are training for long-distance races in an infinitely long straight course running from we...
[{"input": "30901 15700\n2647944172 11366428589\n5864465524 4464634034", "output": "23\n"}, {"input": "30901 15700\n8541952587 11366428589\n5864465524 4464634034", "output": "0\n"}, {"input": "38696 15700\n2647944172 11366428589\n5864465524 4464634034", "output": "0\n"}, {"input": "12000 15700\n3390000000 3810000000\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\nYou are given an array $a_1, a_2 \\dots a_n$. Calculate the number of tuples $(i, j, k, l)$ such that: $1 \...
[{"input": "2\n5\n2 2 2 2 2\n6\n1 3 3 1 2 3\n", "output": "5\n2\n"}, {"input": "2\n5\n2 2 2 4 2\n6\n1 3 3 1 2 3\n", "output": "1\n2\n"}, {"input": "2\n5\n2 2 3 4 2\n6\n2 3 3 1 2 3\n", "output": "0\n2\n"}, {"input": "2\n5\n2 2 3 4 2\n6\n2 4 3 1 2 3\n", "output": "0\n1\n"}, {"input": "2\n5\n2 2 2 2 2\n6\n1 5 3 1 2 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\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": "TFFFTTTFFFFTFFTTFTTFTTFFTFFFTTTTTTFTTTTTTFFFFFFFTFFFFTTTFTFFTTTTTTFFFFFTTFTFTFFFTFTTFFTTFFFTTFFFTTTT\n1\n", "output": "17\n"}, {"input": "TFFFTTTFFFFTFFTTFTTFTTFFTFFFTT...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSereja and his friends went to a picnic. The guys had n soda bottles just for it. Sereja forgot the bottle op...
[{"input": "50\n507 31\n31 250\n414 763\n169 304\n901 9\n592 610\n763 414\n656 789\n411 422\n360 468\n625 504\n538 201\n549 619\n484 797\n596 282\n42 310\n603 656\n351 623\n292 293\n837 180\n375 658\n21 192\n597 729\n22 512\n349 635\n200 56\n669 647\n485 887\n282 939\n735 808\n54 417\n1000 310\n419 652\n939 617\n901 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\nIt has been decided that a programming contest sponsored by company A will be held, so we will post the notic...
[{"input": "100\n-1\n-10", "output": "11322\n"}, {"input": "100\n-1\n-17", "output": "12036\n"}, {"input": "100\n-1\n-11", "output": "11424\n"}, {"input": "100\n-1\n-1", "output": "10404\n"}, {"input": "100\n-2\n-1", "output": "10506\n"}, {"input": "100\n-11\n1", "output": "11200\n"}, {"input": "100\n-1\n-3", "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\nProblem D: Legendary Sword\n\n* This problem contains a lot of two ingredients in the kitchen. Please be care...
[{"input": "10 10\nS . . . . . . . . .\n. . . . . . . . . .\n. . . . 1 . . . . .\n. . . . . . . . . .\n. . . . . . . . . .\n. . . . . . . 3 . .\n. . . . . . . . . .\n. . . . . 4 . . . .\n. . . . . . . . . .\n2 . . . . . . . . G\n10 10\nS . . . . . 3 . . .\n. . 3 . . . . . . .\n. . . . 1 . . . . .\n. . . . . . 4 . . .\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 organizing a boxing tournament, where $n$ boxers will participate ($n$ is a power of $2$), and your f...
[{"input": "128\n-1 37 147 12 24 35 86 39 20 27 86 95 51 8 33 32 55 35 8 75 74 79 64 51 66 32 34 45 39 89 19 11 86 31 69 58 40 58 62 11 99 54 31 10 4 70 88 22 94 23 46 20 65 97 61 39 31 65 23 31 95 78 40 25 51 14 12 55 8 63 18 57 91 75 31 26 22 84 29 22 32 64 20 12 49 92 50 4 97 17 26 88 10 56 73 22 92 94 83 100 97 83 ...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nLuba needs your help again! Luba has n TV sets. She knows that i-th TV set will be working from moment of tim...
[{"input": "3\n999999995 1260814741\n999999998 1000000000\n999999996 1406197446\n", "output": "2\n"}, {"input": "3\n999999995 1260814741\n999999998 1000000000\n999999996 999999999\n", "output": "2\n"}, {"input": "3\n999999995 999999997\n999999998 1000000000\n999999996 999999999\n", "output": "3\n"}, {"input": "8\n13 17...
code_stdio
[ { "content": "You are an expert Python programmer. 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 all the events in Orlando we all know, Sasha and Roma decided to find out who is still the team's bigge...
[{"input": "15 10 15\n1\n2\n3\n4\n5\n6\n12\n8\n9\n10\n11\n12\n13\n14\n15\n", "output": ".X.X.XXX.XXXXXX"}, {"input": "15 10 15\n1\n2\n5\n6\n5\n6\n7\n12\n9\n10\n11\n12\n13\n14\n15\n", "output": ".X.X.X.X.XXXXXX"}, {"input": "17 10 15\n1\n2\n5\n6\n5\n6\n7\n12\n9\n10\n13\n23\n13\n14\n15\n", "output": ".X.X.X.X.X.X.XX"}, {...
code_stdio
[ { "content": "You are an expert Python programmer. 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 large banner with word CODEFORCES was ordered for the 1000-th onsite round of Codeforces^{ω} that takes pla...
[{"input": "CODEFOGSIUZMZCMWAVQHNYFEKIEZQMAZOVEMDRMOEDBHAXPLBLDYYXCVTOOSJZVSQAKFXTBTZFWAYRZEMDEMVDJTDRXXAQBURCES\n", "output": "YES\n"}, {"input": "CODEFOGSIUZMZCMWAVQHNYFEKIEZQMAZOVEMDRMOEDBHAXPLBLDYYXCVTOOSJZVSQAKFXTBTZFWAYRZEMDEMVDJTDRXXAQBURCES\n", "output": "YES\n"}, {"input": "CODEFOGSIUZMZCMWAVQHNYFEKIEZQMAZOVEM...
code_stdio
[ { "content": "You are an expert Python programmer. 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 day, the lord ordered a carpenter to \"build a sturdy and large building where the townspeople could evac...
[{"input": "6\n4\n1,2,2,2\n1,3,4,3\n1,4,4,2\n2,5,3,2\n3,4,4,2\n3,6,1,2\n4,6,1,1\n5,6,1,2\n2,4,50,30", "output": "-11\n"}, {"input": "6\n8\n1,1,2,2\n3,4,3,0\n1,4,4,2\n2,3,5,2\n3,4,4,2\n3,6,1,2\n4,6,1,1\n5,6,2,2\n2,4,5,030", "output": "-36\n"}, {"input": "6\n8\n1,2,2,2\n1,3,4,3\n1,4,4,2\n2,5,3,2\n3,4,4,2\n3,6,1,2\n1,1,6,...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nThere are K nuclear reactor chambers labelled from 0 to K-1. Particles are bombarded onto chamber 0. The part...
[{"input": "1 22 82", "output": "1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0\n"}, {"input": "2 8 47", "output": "2 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nPolycarp analyzes the prices of the new berPhone. At his disposal are the prices for $n$ last days: $a_1, a_2...
[{"input": "5\n6\n3 5 4 12 2 5\n1\n1000000\n2\n2 0\n10\n31 41 59 26 82 66 97 127 23 84\n7\n2 2 1 2 3 4 5\n", "output": "4\n0\n1\n8\n2\n"}, {"input": "5\n6\n3 5 4 12 2 5\n1\n1000000\n2\n2 0\n10\n31 41 50 26 82 66 97 127 23 84\n7\n2 2 1 2 3 4 5\n", "output": "4\n0\n1\n8\n2\n"}, {"input": "5\n6\n3 5 4 12 7 5\n1\n1000000\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\nWrite a program which reads two sequences of nodes obtained by the preorder tree walk and the inorder tree wa...
[{"input": "5\n1 2 3 4 5\n1 2 4 3 5", "output": "4 5 3 2 1\n"}, {"input": "5\n1 3 2 4 5\n3 2 4 1 5", "output": "4 2 3 5 1\n"}, {"input": "5\n1 2 3 4 5\n3 4 2 1 5", "output": "4 3 2 5 1\n"}, {"input": "5\n1 2 3 4 5\n3 2 4 1 5", "output": "3 4 2 5 1"}, {"input": "4\n1 2 3 4\n2 1 3 4", "output": "2 4 3 1\n"}, {"input": "4...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nOur good friend Mole is trying to code a big message. He is typing on an unusual keyboard with characters arr...
[{"input": "L\nxgwurenkxkiau,c,vonei.zltazmnkhqtwuogkgvgckvja,z.rhanuy.ybebmzcfwozkwvuuiolaqlgvvvewnbuinrncgjwjdsfw\n", "output": "cheitrmlclosi.v.bpmro/x;ysx,mljwyeiphlhbhvlbks.x/tjsmiu/unrn,xvgepxlebiiop;sw;hbbbremniomtmvhkekfdge\n"}, {"input": "L\nuoz.vmks,wxrb,nwcvdzh.m,hwsios.lvu,ktes,,ythddhm.sh,d,c,cfj.wqam,bowo...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nZookeeper is playing a game. In this game, Zookeeper must use bombs to bomb a string that consists of letters...
[{"input": "3\nAAA\nBABA\nAABBBABBBB\n", "output": "3\n2\n0\n"}, {"input": "3\nAAA\nAABA\nAABBBABBBB\n", "output": "3\n2\n0\n"}, {"input": "3\nAAB\nBABA\nAABBBABBBB\n", "output": "1\n2\n0\n"}, {"input": "3\nAAB\nBABA\nBBBBABBBAA\n", "output": "1\n2\n2\n"}, {"input": "3\nAAB\nBAAA\nBBBBABBBAA\n", "output": "1\n4\n2\n"},...
code_stdio