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\nThere are several colored cubes. All of them are of the same size but they may be colored differently. Each f...
[{"input": "3\nscarlet green blue yellow magenta cyan\nblue pink green magenta cyan lemon\npurple red blue yellow cyan green\n2\nred green blue yellow magenta cyan\ncyan green blue yellow magenta red\n2\nred green gray gray magenta cyan\ncyan green gray fray magenta red\n2\nred green blue yellow magenta cyan\nmagenta r...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nJohn Smith knows that his son, Thomas Smith, is among the best students in his class and even in his school. ...
[{"input": "18\n68 32 84 6\n44 53 11 21\n61 34 77 82\n19 36 47 58\n47 73 31 96\n17 50 82 16\n57 90 64 8\n14 37 45 69\n48 1 18 58\n42 34 96 14\n56 82 33 77\n40 66 30 53\n33 31 44 95\n0 90 24 8\n7 85 39 1\n76 77 93 35\n98 9 62 13\n24 84 60 51\n", "output": "8\n"}, {"input": "18\n68 32 84 6\n44 53 11 21\n61 34 77 82\n19 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\nThere are $n$ shovels in the nearby shop. The $i$-th shovel costs $a_i$ bourles.\n\nMisha has to buy exactly ...
[{"input": "9 4 8\n12 13 5 1 12 1 2 2 2\n9 4\n8 4\n5 3\n9 7\n", "output": "28\n"}, {"input": "9 4 8\n6 13 5 1 10 1 1 2 1\n9 4\n8 4\n5 3\n9 7\n", "output": "19\n"}, {"input": "9 4 8\n6 13 5 1 12 1 1 2 2\n9 4\n8 4\n5 3\n9 5\n", "output": "21\n"}, {"input": "9 4 8\n6 13 5 1 12 1 2 2 2\n9 4\n8 4\n5 3\n9 5\n", "output": "22...
code_stdio
[ { "content": "You are an expert Python programmer. 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 with $n$ rows (numbered from $1$ to $n$) and $m$ columns (numbered from $1$ to $m$). A...
[{"input": "4\n2 2\n1 1\n0 1\n2 3\n1 1 0\n1 0 0\n3 7\n1 0 1 1 1 1 1\n0 0 0 0 0 0 0\n1 0 1 1 1 0 1\n2 5\n1 0 1 0 0\n1 1 1 1 0\n-1 1 1 0 0\n", "output": "0\n3\n5\n4\n"}, {"input": "4\n2 2\n1 1\n0 1\n2 3\n1 1 1\n1 0 0\n3 7\n1 0 1 1 1 1 1\n0 0 1 0 0 1 0\n1 0 1 0 1 0 1\n2 5\n1 0 1 0 0\n1 1 1 1 0\n-1 1 2 0 0\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\nSalem gave you $n$ sticks with integer positive lengths $a_1, a_2, \\ldots, a_n$.\n\nFor every stick, you can...
[{"input": "113\n86 67 31 33 72 100 88 63 16 12 79 80 76 45 31 96 44 10 24 33 53 11 56 100 23 57 9 48 28 73 18 48 12 89 73 9 51 11 82 94 90 92 34 99 54 58 33 67 35 87 58 90 94 64 57 80 87 99 84 99 20 1 63 12 16 40 50 95 33 58 7 23 71 89 53 15 95 29 71 16 65 21 66 89 82 30 6 45 6 66 58 32 27 78 28 42 8 61 10 26 7 55 76 ...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nEmergency Evacuation\n\nThe Japanese government plans to increase the number of inbound tourists to forty mil...
[{"input": "0 1 3\n1 1\n-2 18\n0 4\n3 -1\n1 3\n0 1\n2 0", "output": "20\n"}, {"input": "0 1 3\n0 1\n-2 35\n0 3\n5 -1\n1 2\n0 1\n5 0", "output": "37\n"}, {"input": "0 3 3\n1 1\n-2 18\n0 3\n5 -1\n1 2\n0 1\n5 0", "output": "18\n"}, {"input": "0 3 3\n1 1\n-2 18\n0 3\n5 -1\n1 3\n0 1\n5 0", "output": "18\n"}, {"input": "0 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\nPolycarpus likes studying at school a lot and he is always diligent about his homework. Polycarpus has never ...
[{"input": "10\n58 22116\n112840 772160\n127432 399484\n182031 255417\n459340 548097\n603984 739189\n606173 663033\n280170 366159\n779239 906234\n874623 155443\n", "output": "7\n"}, {"input": "10\n58 22116\n112840 772160\n122094 399484\n182031 255417\n459340 548097\n603984 739189\n606173 663033\n280170 366159\n779239 9...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n#### Task:\n\nYour job here is to write a function (`keepOrder` in JS/CoffeeScript, `keep_order` in Ruby/Crys...
[{"input": "[1, 2, 3, 4, 7]\n5", "output": "[4]", "fn_name": "keep_order"}, {"input": "[1, 2, 3, 4, 7]\n0", "output": "[0]", "fn_name": "keep_order"}, {"input": "[1, 1, 2, 2, 2]\n2", "output": "[2]", "fn_name": "keep_order"}, {"input": "[1, 2, 3, 4]\n-1", "output": "[0]", "fn_name": "keep_order"}, {"input": "[1, 2, 3, ...
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\nFrom beginning till end, this message has been waiting to be conveyed.\n\nFor a given unordered multiset of n...
[{"input": "100110\n", "output": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa...
code_stdio
[ { "content": "You are an expert Python programmer. 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 bags. Each bag contains a non-empty multiset of numbers. You can perform a number of oper...
[{"input": "3 3 3\n1000 1000 1000\n1000 1000 1000\n1 1 -1\n", "output": "5999\n"}, {"input": "3 3 3\n1010 1000 1000\n1000 1000 1000\n1 1 -1\n", "output": "6009\n"}, {"input": "3 3 3\n1010 1000 1000\n1000 1100 1000\n1 1 -1\n", "output": "6109\n"}, {"input": "3 3 3\n1010 1000 1010\n1000 1100 1000\n1 1 -1\n", "output": "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\nYou are given set of n points in 5-dimensional space. The points are labeled from 1 to n. No two points coinc...
[{"input": "11\n358 -724 -232 53 -520\n486 -554 -328 53 -220\n358 -554 -232 -372 -520\n358 -554 -232 308 -520\n868 -554 448 53 -520\n478 -554 -322 53 -600\n358 296 -232 53 -520\n256 -554 -368 53 -520\n230 -554 -136 53 -820\n-182 -554 173 53 -160\n358 -554 -232 53 -520\n", "output": "1\n11\n"}, {"input": "11\n358 -724 -...
code_stdio
[ { "content": "You are an expert Python programmer. 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 make function, which returns the sum of a sequence of integers.\n\nThe sequence is defined by...
[{"input": "2\n24\n22", "output": "[26]", "fn_name": "sequence_sum"}, {"input": "0\n15\n3", "output": "[45]", "fn_name": "sequence_sum"}, {"input": "16\n15\n3", "output": "[0]", "fn_name": "sequence_sum"}, {"input": "1\n15\n3", "output": "[35]", "fn_name": "sequence_sum"}, {"input": "2\n6\n2", "output": "[12]", "fn_nam...
code_functional
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nInnokentiy decides to change the password in the social net \"Contact!\", but he is too lazy to invent a new ...
[{"input": "114 14\n", "output": "abcdefghijklmnabcdefghijklmnabcdefghijklmnabcdefghijklmnabcdefghijklmnabcdefghijklmnabcdefghijklmnabcdefghijklmnab"}, {"input": "113 3\n", "output": "abcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcab"}, {"input": "113 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\nA Pythagorean triple is a triple of integer numbers $(a, b, c)$ such that it is possible to form a right tria...
[{"input": "3\n2131\n21165\n6666\n", "output": "32\n102\n57\n"}, {"input": "3\n2131\n21165\n6666\n", "output": "32\n102\n57\n"}, {"input": "3\n2131\n38301\n6666\n", "output": "32\n137\n57\n"}, {"input": "3\n1625\n38301\n6666\n", "output": "28\n137\n57\n"}, {"input": "3\n2570\n38301\n6666\n", "output": "35\n137\n57\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 thief sneaked into a museum with a lot of treasures with only one large furoshiki. There are many things I ...
[{"input": "50\n5\n60,10\n100,10\n03,022\n210,45\n10,4\n162\n5\n60,10\n100,20\n120,30\n210,45\n10,4\n0", "output": "Case 1:\n220\n49\nCase 2:\n500\n109\n"}, {"input": "50\n5\n60,20\n100,20\n03,021\n210,45\n10,4\n143\n5\n60,10\n100,20\n120,30\n200,45\n10,4\n0", "output": "Case 1:\n220\n49\nCase 2:\n490\n109\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\n## Emotional Sort ( οΈΆοΈΏοΈΆ)\n\nYou'll have a function called \"**sortEmotions**\" that will return an array of *...
[{"input": "[\":)\", \"T_T\", \":)\", \":D\", \":D\"]\nfalse", "output": "[[\"T_T\", \":)\", \":)\", \":D\", \":D\"]]", "fn_name": "sort_emotions"}, {"input": "[\":)\", \"T_T\", \":)\", \":D\", \":D\"]\ntrue", "output": "[[\":D\", \":D\", \":)\", \":)\", \"T_T\"]]", "fn_name": "sort_emotions"}, {"input": "[\":D\", \"T_...
code_functional
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nKaavi, the mysterious fortune teller, deeply believes that one's fate is inevitable and unavoidable. Of cours...
[{"input": "babbaaababbbbabbaaaababbbaabababbaabbaababbaaabaabbabaabbaababababbaabaaabaaaaababbaabaaaaabaabbabaaababbbb\nbbaabbbbabbbbaaaaaababbbabaaabbbbabababbbaabbbbbabaababbaabaaabaabbababababaaaaabaabbabaaabaaaaaaaaaaaaabbb\n", "output": "284471294"}, {"input": "bbbbabaaababbaabaaaaabaabbabaaaaabaaabaabbabababaabb...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nKolya is going to make fresh orange juice. He has n oranges of sizes a_1, a_2, ..., a_{n}. Kolya will put the...
[{"input": "100 1000 1083\n992 616 818 359 609 783 263 989 501 929 362 394 919 1081 870 830 1097 975 62 346 531 367 323 457 707 360 949 334 867 116 478 417 961 963 1029 114 867 1008 988 916 983 1077 959 1322 572 961 579 318 721 337 488 717 111 70 416 685 987 130 353 107 61 191 827 849 106 815 211 953 111 398 889 860 80...
code_stdio
[ { "content": "You are an expert Python programmer. 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 studies divisibility rules at school. Here are some of them:\n\n * Divisibility by 2. A number is divi...
[{"input": "30 100\n", "output": "2-type\n2\n"}, {"input": "10 100\n", "output": "2-type\n2\n"}, {"input": "10 25\n", "output": "2-type\n2\n"}, {"input": "70 14\n", "output": "2-type\n1\n"}, {"input": "10 16\n", "output": "2-type\n4\n"}, {"input": "91 49\n", "output": "2-type\n2\n"}, {"input": "10 40\n", "output": "2-t...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nYou are standing on the $\\mathit{OX}$-axis at point $0$ and you want to move to an integer point $x > 0$.\n\...
[{"input": "12\n1\n2\n3\n4\n5\n1\n2\n3\n4\n5\n1\n2\n", "output": "1\n3\n2\n3\n4\n1\n3\n2\n3\n4\n1\n3\n"}, {"input": "12\n1\n2\n3\n4\n5\n1\n2\n3\n4\n5\n1\n2\n", "output": "1\n3\n2\n3\n4\n1\n3\n2\n3\n4\n1\n3\n"}, {"input": "12\n1\n2\n3\n4\n5\n2\n2\n3\n4\n5\n1\n2\n", "output": "1\n3\n2\n3\n4\n3\n3\n2\n3\n4\n1\n3\n"}, {"in...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nTwo famous competing companies ChemForces and TopChemist decided to show their sets of recently discovered ch...
[{"input": "10\n598654597 975579682\n117777072 31932499\n223851456 1477480177\n988262691 654502493\n967529230 543358150\n835120075 101574205\n809901567 613170206\n152157661 479980560\n859252956 158469817\n614959273 735298093\n10\n1156316033 361325206\n341655282 740807372\n239996693 809030434\n813199219 765838311\n12755...
code_stdio
[ { "content": "You are an expert Python programmer. 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 undirected graph G consisting of N vertices numbered 1 through N and M edges numbered 1 through M...
[{"input": "3\n3 0\n6 2\n1 2\n2 3\n15 10\n12 14\n8 3\n10 1\n14 6\n12 6\n1 9\n13 1\n2 5\n3 9\n7 2\n", "output": "First\nSecond\nFirst\n"}, {"input": "1\n100000 0\n", "output": "First\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\nIvan has a robot which is situated on an infinite grid. Initially the robot is standing in the starting cell ...
[{"input": "100\nUDRLRRLLRRLRRRDDLLDDDLULLDDLURUURUULUDDDRDDLLRDLLUURLRDRLRRLRLLLULDUDDUURRLRDULDRDURRRRRRULDRRDLDRRL\n", "output": "88\n"}, {"input": "100\nUDRLRRLLRRLRRRDDLLDDDLULLDDLURUURUULUDDDRDDLLRDLLUURLRDRLRRLRLLLULDUDDUURRLRDULDRDURRRRRRULDRRDLDRRL\n", "output": "88\n"}, {"input": "100\nLRRDLDRRDLURRRRRRUDRDLU...
code_stdio
[ { "content": "You are an expert Python programmer. 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 problem, a $n \\times m$ rectangular matrix $a$ is called increasing if, for each row of $i$, when go...
[{"input": "10 4\n4 9 11 12\n8 11 13 18\n13 16 18 21\n15 21 0 24\n17 0 21 29\n21 26 0 33\n26 31 33 35\n30 32 35 37\n33 37 40 43\n34 41 46 51\n", "output": "-1\n"}, {"input": "10 4\n4 9 11 12\n8 11 13 18\n13 16 18 21\n15 21 0 24\n17 0 21 29\n21 26 0 33\n26 31 33 35\n30 32 35 37\n33 37 40 43\n34 41 46 51\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\nIahub is a big fan of tourists. He wants to become a tourist himself, so he planned a trip. There are n desti...
[{"input": "50\n3987477 8934938 4067156 6712855 7269334 5039822 9533601 9335400 5992073 2619268 438734 8620973 4347619 4307947 2249161 815221 7615258 8244100 8341666 5908546 6646952 4812769 6215114 7479369 6290438 5623785 6466133 9953199 3525873 4326034 3510072 8117068 2342953 1717542 9766539 651627 9541804 4518782 704...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nFarmer Feb has three fields with potatoes planted in them. He harvested x potatoes from the first field, y po...
[{"input": "2\n3 20\n27 15", "output": "6\n1\n"}, {"input": "2\n3 20\n63 22", "output": "6\n4\n"}, {"input": "2\n3 20\n58 22", "output": "6\n3\n"}, {"input": "2\n5 19\n58 22", "output": "5\n3\n"}, {"input": "2\n2 1\n11 12", "output": "2\n6\n"}, {"input": "2\n2 6\n14 10", "output": "3\n5\n"}, {"input": "2\n24 7\n3 18", ...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nPupils decided to go to amusement park. Some of them were with parents. In total, n people came to the park a...
[{"input": "100 1000 1000\n0000010100101100110100101111001111111111100101111100111011110001011110110111111010000000101000111000\n", "output": "100000\n"}, {"input": "100 1000 1000\n0000010100101100110100101111001111111111100101111100111011110001011110110111111010000000101000111000\n", "output": "100000\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 have array a that contains all integers from 1 to n twice. You can arbitrary permute any numbers in a.\n\...
[{"input": "1376\n", "output": "1 3 5 7 9 11 13 15 17 19 21 23 25 27 29 31 33 35 37 39 41 43 45 47 49 51 53 55 57 59 61 63 65 67 69 71 73 75 77 79 81 83 85 87 89 91 93 95 97 99 101 103 105 107 109 111 113 115 117 119 121 123 125 127 129 131 133 135 137 139 141 143 145 147 149 151 153 155 157 159 161 163 165 167 169 171...
code_stdio
[ { "content": "You are an expert Python programmer. 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\n\n```python\nhas_two_cube_sums(n)\n```\n\nwhich checks if a given number `n` can be writte...
[{"input": "46163", "output": "[false]", "fn_name": "has_two_cube_sums"}, {"input": "4103", "output": "[false]", "fn_name": "has_two_cube_sums"}, {"input": "4102", "output": "[false]", "fn_name": "has_two_cube_sums"}, {"input": "4105", "output": "[false]", "fn_name": "has_two_cube_sums"}, {"input": "4106", "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\nYou have an array of numbers. \nYour task is to sort ascending odd numbers but even numbers must be on their...
[{"input": "[1, 2, 3, 4, 5, 6, 7, 8, 9, 0]", "output": "[[1, 2, 3, 4, 5, 6, 7, 8, 9, 0]]", "fn_name": "sort_array"}, {"input": "[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]", "output": "[[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]]", "fn_name": "sort_array"}, {"input": "[0, 1, 2, 3, 4, 9, 8, 7, 6, 5]", "output": "[[0, 1, 2, 3, 4, 5, 8, 7, 6, 9]]...
code_functional
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nChilly Willy loves playing with numbers. He only knows prime numbers that are digits yet. These numbers are 2...
[{"input": "99993\n", "output": "10000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000...
code_stdio
[ { "content": "You are an expert Python programmer. 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 simply to count the total number of lowercase letters in a string.\n\n## Examples### Format: You...
[{"input": "\"abcABC123!@#$%^&*()_-+=}{[]|':;?/>.<,~\"", "output": "[3]", "fn_name": "lowercase_count"}, {"input": "\"ABC123!@#$%^&*()_-+=}{[]|':;?/>.<,~\"", "output": "[0]", "fn_name": "lowercase_count"}, {"input": "\"abcdefghijklmnopqrstuvwxyz\"", "output": "[26]", "fn_name": "lowercase_count"}, {"input": "\"abcABC12...
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 integers a and b. Determine if a+b=15 or a\\times b=15 or neither holds.\n\nNote that a+b=1...
[{"input": "-3 -5", "output": "*\n"}, {"input": "11 -1", "output": "x\n"}, {"input": "15 -1", "output": "x\n"}, {"input": "29 -1", "output": "x\n"}, {"input": "13 -1", "output": "x\n"}, {"input": "17 -1", "output": "x\n"}, {"input": "16 -1", "output": "+\n"}, {"input": "16 -2", "output": "x\n"}, {"input": "-1 -3", "out...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nThree people, A, B and C, are trying to communicate using transceivers.\nThey are standing along a number lin...
[{"input": "-1 000 -1 15", "output": "Yes\n"}, {"input": "-1 100 -1 15", "output": "Yes\n"}, {"input": "-1 100 -1 12", "output": "Yes\n"}, {"input": "-1 100 -1 13", "output": "Yes\n"}, {"input": "-1 100 -1 24", "output": "Yes\n"}, {"input": "-1 100 -2 24", "output": "Yes\n"}, {"input": "-2 011 -1 24", "output": "Yes\n"...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nPetya is the most responsible worker in the Research Institute. So he was asked to make a very important expe...
[{"input": "20\n100 200 100 1 100 100\n100 200 1 100 100 100\n2 2 1 1 2 2\n100 100 50 50 1 1\n10 10 5 5 1 1\n100 100 99 1 1 99\n100 100 1 99 99 1\n100 100 1 10 10 1\n100 100 1 1 10 10\n9 6 1 3 3 1\n1000000000 1000000000 1 1 1000000000 1000000000\n9 4 1 4 4 1\n6 4 1 1 5 4\n6 2 1 1 5 2\n8 2 1 1 5 2\n10 2 1 1 5 2\n10 2 1 ...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nValera the Horse is going to the party with friends. He has been following the fashion trends for a while, an...
[{"input": "133315691 1002877005 1237779669 265159773\n", "output": "0\n"}, {"input": "133315691 1002877005 1237779669 207655879\n", "output": "0\n"}, {"input": "111229995 1002877005 1237779669 207655879\n", "output": "0\n"}, {"input": "133315691 265159773 1237779669 265159773\n", "output": "1\n"}, {"input": "391958720...
code_stdio
[ { "content": "You are an expert Python programmer. 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 the function unique_in_order which takes as argument a sequence and returns a list of items without...
[{"input": "\"AAAABBBCCDAABBB\"", "output": "[[\"A\", \"B\", \"C\", \"D\", \"A\", \"B\"]]", "fn_name": "unique_in_order"}, {"input": "\"ABBCcAD\"", "output": "[[\"A\", \"B\", \"C\", \"c\", \"A\", \"D\"]]", "fn_name": "unique_in_order"}, {"input": "[\"a\", \"b\", \"b\"]", "output": "[[\"a\", \"b\"]]", "fn_name": "unique...
code_functional
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nTakahashi will do a tap dance. The dance is described by a string S where each character is L, R, U, or D. Th...
[{"input": "UUULRUUDRURLDDRLRLRURLUDRLUURDDUULRUULRDRDULUUDLRLRUDLUDRLULULRUDURURDRLUURLULRUULDURDUUUDULRDRLRLDL\n", "output": "Yes\n"}, {"input": "UDUDRDDLRDDDRUDURUULULDUUURLDLDLRURLDDRDDDRUUDRUUDDDDUUURLDLULUDRUDDDUULDDLURDRDRUUURLUDUUDLRUUDULRD\n", "output": "No\n"}, {"input": "UUULRULUUDDLDDULRDRDDDRLDLULRDDLDLRUR...
code_stdio
[ { "content": "You are an expert Python programmer. 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\n8\n-10 0\n-10 5\n-5 5\n-5 0\n10 0\n10 -5\n5 -5\n5 0\n\n\nOutput\n\n50### Format: Read the...
[{"input": "8\n-18 1\n-10 2\n-10 8\n-27 -1\n11 0\n22 -5\n4 -8\n5 0", "output": "137\n"}, {"input": "8\n-18 1\n-10 2\n-10 8\n-27 -1\n11 0\n22 -7\n4 -8\n5 0", "output": "144\n"}, {"input": "8\n-18 1\n-10 2\n-10 8\n-7 -1\n11 0\n22 -14\n4 -8\n5 0", "output": "155\n"}, {"input": "8\n-1 0\n-10 10\n-4 8\n-5 -1\n19 0\n10 -5\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\nproblem\n\nThere are n cards with one integer from 1 to n and one blank card. Of these n + 1 cards, k cards a...
[{"input": "14 5\n6\n2\n4\n10\n1\n15 5\n5\n2\n0\n4\n7\n0 0", "output": "2\n4\n"}, {"input": "33 5\n5\n0\n4\n7\n0\n20 5\n10\n3\n2\n4\n7\n0 0", "output": "4\n3\n"}, {"input": "14 5\n6\n0\n4\n14\n1\n8 5\n5\n2\n0\n0\n7\n0 0", "output": "3\n3\n"}, {"input": "33 5\n5\n3\n4\n7\n0\n10 5\n5\n2\n1\n4\n7\n0 0", "output": "5\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\n$N$ sages are sitting around a round table with $N$ seats. Each sage holds chopsticks with his dominant hand ...
[{"input": "5\n1 1 0 1 0\n1 3 1 -2 4", "output": "-1\n"}, {"input": "5\n1 1 0 1 0\n1 3 1 -1 4", "output": "0\n"}, {"input": "5\n1 1 0 0 2\n1 3 0 2 13", "output": "1\n"}, {"input": "5\n1 0 0 1 0\n2 3 6 1 2", "output": "3\n"}, {"input": "5\n1 1 0 1 0\n4 3 5 1 4", "output": "5\n"}, {"input": "5\n1 1 0 1 0\n4 3 0 1 4", "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\nIt's New Year's Eve soon, so Ivan decided it's high time he started setting the table. Ivan has bought two ca...
[{"input": "100 100 100\n", "output": "2\n"}, {"input": "100 100 100\n", "output": "2\n"}, {"input": "100 100 10\n", "output": "1\n"}, {"input": "17 100 79\n", "output": "10\n"}, {"input": "17 100 79\n", "output": "10\n"}, {"input": "100 100 10\n", "output": "1\n"}, {"input": "5 122 100\n", "output": "40\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\nSereja has got an array, consisting of n integers, a_1, a_2, ..., a_{n}. Sereja is an active boy, so he is no...
[{"input": "6 6\n202714501 613423725 367325359 862808465 196327629 745008828\n2 492\n2 1943\n1 3 173984392\n1 5 17007494\n3 4\n1 5 472683539\n", "output": "862810900\n\n"}, {"input": "6 6\n202714501 613423725 367325359 862808465 196327629 745008828\n2 492\n2 1943\n1 3 173984392\n1 5 17007494\n3 4\n1 5 650027606\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\nYou are given a permutation of the numbers 1, 2, ..., n and m pairs of positions (a_{j}, b_{j}).\n\nAt each s...
[{"input": "83 8\n54 3 52 12 61 36 65 62 69 49 47 77 31 15 21 14 73 29 6 26 37 17 81 75 43 30 58 76 16 8 11 5 27 35 7 66 50 67 2 39 45 28 60 71 38 82 53 1 42 13 44 72 22 4 9 25 19 57 10 70 18 68 32 34 20 80 23 79 24 63 64 51 59 41 74 48 40 33 46 83 55 56 78\n48 80\n1 8\n71 54\n15 59\n72 46\n36 9\n64 29\n55 58\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\nStepan is a very experienced olympiad participant. He has n cups for Physics olympiads and m cups for Informa...
[{"input": "20 10 761\n66 41\n47 7\n35 6\n22 40\n15 2\n47 28\n46 47\n3 45\n12 19\n44 41\n46 2\n49 23\n9 8\n7 41\n5 3\n16 42\n12 50\n17 22\n25 9\n45 12\n56 44\n34 47\n33 35\n32 47\n119 6\n27 18\n43 36\n23 6\n39 22\n38 45\n", "output": "1009\n"}, {"input": "20 10 761\n66 41\n47 7\n35 6\n22 40\n15 2\n47 28\n46 47\n3 45\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\nThere are N strings arranged in a row. It is known that, for any two adjacent strings, the string to the left...
[{"input": "5\n11 1 2 2 2", "output": "3"}, {"input": "5\n14 1 2 2 2", "output": "3"}, {"input": "5\n28 1 2 2 2", "output": "3"}, {"input": "5\n3 1 2 1 13", "output": "3"}, {"input": "5\n11 1 2 2 1", "output": "3"}, {"input": "5\n14 1 2 2 3", "output": "2"}, {"input": "5\n23 1 2 2 2", "output": "3"}, {"input": "5\n2 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\nAn accordion is a string (yes, in the real world accordions are musical instruments, but let's forget about i...
[{"input": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa[\n", "output": "-1\n"}, {"input": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSomeone give a strange birthday present to Ivan. It is hedgehog β€” connected undirected graph in which one ver...
[{"input": "33 2\n3 13\n17 3\n2 6\n5 33\n4 18\n1 2\n31 5\n4 19\n3 16\n1 3\n9 2\n10 3\n5 1\n5 28\n21 4\n7 2\n1 4\n5 24\n30 5\n14 3\n3 11\n27 5\n8 2\n22 4\n12 3\n20 4\n26 5\n4 23\n32 5\n25 5\n15 3\n29 5\n", "output": "Yes\n"}, {"input": "25 2\n1 2\n1 3\n1 4\n2 5\n2 6\n2 7\n3 8\n3 9\n3 10\n4 11\n4 12\n4 13\n4 14\n14 15\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\nSanta Claus has Robot which lives on the infinite grid and can move along its lines. He can also, having a se...
[{"input": "26\nRURULRRURUDLULDLDLDURLRDDL\n", "output": "10\n"}, {"input": "26\nRURULRRLRUDUULLLDLDURDRDLD\n", "output": "11\n"}, {"input": "26\nLDDRLRUDLDLDLULDURURRLURUR\n", "output": "10\n"}, {"input": "26\nLDDRLRLDLDLDLUUDURURRLURUR\n", "output": "10\n"}, {"input": "26\nRURULRRURUDUULDLDLDLRLRDDL\n", "output": "10...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nThe only difference between easy and hard versions is the maximum value of $n$.\n\nYou are given a positive i...
[{"input": "100\n1\n2\n3\n4\n5\n6\n7\n8\n14\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n29\n30\n31\n32\n33\n34\n35\n36\n37\n38\n39\n40\n41\n42\n43\n44\n45\n46\n47\n48\n49\n50\n51\n52\n53\n54\n55\n56\n57\n58\n59\n60\n61\n62\n63\n64\n65\n66\n67\n68\n69\n70\n71\n72\n73\n74\n75\n76\n77\n78\...
code_stdio
[ { "content": "You are an expert Python programmer. 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 matrix (H Γ— W) which contains only 1 and 0, find the area of the largest rectangle which only contain...
[{"input": "1 5\n1 0 1 0 0\n2 0 -1 -1 0\n0 -1 0 -1 0\n0 0 0 1 0", "output": "2\n"}, {"input": "1 3\n1 1 1 0 0\n2 0 -1 0 1\n1 -1 0 0 0\n-1 0 1 2 -1", "output": "0\n"}, {"input": "1 5\n0 0 0 0 0\n2 0 -1 -1 0\n0 0 0 0 0\n0 2 1 1 -1", "output": "5\n"}, {"input": "1 5\n1 0 1 0 0\n2 0 -1 -1 0\n0 -1 0 0 0\n0 0 0 1 0", "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\nLittle Elephant from the Zoo of Lviv likes cards. He has N cards, each of which has one of 1000 colors. The c...
[{"input": "2\n15\n-1 1 7\n35\n-1 -3 8 8", "output": "16384\n179869065\n"}, {"input": "2\n15\n-1 1 7\n38\n-1 -3 8 8", "output": "16384\n766320739\n"}, {"input": "2\n15\n-1 1 7\n47\n-1 -3 8 8", "output": "16384\n743685088\n"}, {"input": "2\n25\n0 -1 1\n15\n2 -1 -1 3", "output": "16777216\n16384\n"}, {"input": "2\n12\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\nAn expedition group flew from planet ACM-1 to Earth in order to study the bipedal species (its representative...
[{"input": "602799218 494169337\n", "output": "105935725\n"}, {"input": "523061914 144515354\n", "output": "127493116\n"}, {"input": "622152471 448257864\n", "output": "210299666\n"}, {"input": "549662082 945236243\n", "output": "239869294\n"}, {"input": "868095112 994962872\n", "output": "606909752\n"}, {"input": "296...
code_stdio
[ { "content": "You are an expert Python programmer. 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 telephone number is a sequence of exactly 11 digits, where the first digit is 8. For example, the sequence ...
[{"input": "2\n13\n7818005553535\n11\n31415926535\n", "output": "YES\nNO\n"}, {"input": "2\n13\n14222439333841\n11\n31415926535\n", "output": "NO\nNO\n"}, {"input": "2\n13\n3872943379171\n11\n45489461254\n", "output": "YES\nNO\n"}, {"input": "2\n13\n14222439333841\n11\n45489461254\n", "output": "NO\nNO\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 an upcoming movie director, and you have just released your first movie. You have also launched a sim...
[{"input": "9\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n", "output": "1\n1\n1\n1\n1\n1\n1\n1\n1\n"}, {"input": "9\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n", "output": "1\n1\n1\n1\n1\n1\n1\n1\n1\n"}, {"input": "9\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n2\n1\n1\n1\n1\n", "output": "1\n1\n1\n1\...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nVasya plays the Need For Brake. He plays because he was presented with a new computer wheel for birthday! Now...
[{"input": "20\ng 1000000\nibb 1000000\nidj 1000000\nkccg 1000000\nbbe 1000000\nhjf 1000000\na 1000000\nf 1000000\niij 1000000\nakgf 1000000\nkdkhj 1000000\ne 1000000\nh 1000000\nhb 1000000\nfaie 1000000\nj 1000000\ni 1000000\nhgg 1000000\nfi 1000000\nicf 1000000\n12\n1000000 1000000 1000000 1000000 1000000 1000000 100...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nA positive integer is called a 2-3-integer, if it is equal to 2^{x}Β·3^{y} for some non-negative integers x an...
[{"input": "1088391168 1934917632\n", "output": "17\n"}, {"input": "1088391167 1934917632\n", "output": "17\n"}, {"input": "1088391169 1934917632\n", "output": "16\n"}, {"input": "1088391168 1934917631\n", "output": "16\n"}, {"input": "1088391168 1934917633\n", "output": "17\n"}, {"input": "1088391167 1934917632\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\nYou are given a permutation $p$ of $n$ integers $1$, $2$, ..., $n$ (a permutation is an array where each elem...
[{"input": "5\n3 4 1 5 2\n", "output": "2\n"}, {"input": "5\n4 5 1 3 2\n", "output": "2\n"}, {"input": "5\n5 4 1 3 2\n", "output": "1\n"}, {"input": "5\n3 4 2 5 1\n", "output": "1\n"}, {"input": "5\n3 4 1 5 2\n", "output": "2"}, {"input": "3\n1 3 2\n", "output": "1\n"}, {"input": "3\n2 3 1\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\n# Fourier transformations are hard. Fouriest transformations are harder.\n\nThis Kata is based on the SMBC Co...
[{"input": "2579111107964987025047536361483312385374008248282655401675211033926782006920415224913494809688581314878892733564", "output": "[\"2579111107964987025047536361483312385374008248282655401675211033926782006920415224913494809688581314878892733564 is the fouriest (4444444444444444444444444444444444444444444444) 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\nThere is a tree with N vertices, numbered 1, 2, \\ldots, N. For each i (1 \\leq i \\leq N - 1), the i-th edge...
[{"input": "10 2\n8 5\n10 8\n6 5\n1 5\n4 8\n2 10\n3 6\n9 4\n1 7", "output": "0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n"}, {"input": "10 2\n8 5\n10 8\n6 5\n1 5\n4 8\n2 10\n3 6\n9 2\n1 7", "output": "0\n0\n1\n1\n1\n0\n1\n0\n1\n1"}, {"input": "4 101\n1 2\n1 3\n1 4", "output": "8\n5\n5\n5\n"}, {"input": "4 101\n1 2\n1 3\n2 4", "outpu...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nTaro came to a square to look for treasure. There are many treasures buried in this square, but Taro has the ...
[{"input": "5 5\n10 7\n-3 -8\n2 11\n6 0\n-1 3\n-3 1 3 13\n-1 -1 9 5\n-3 -16 10 11\n-1 0 5 4\n-1 -13 15 10", "output": "2\n2\n5\n1\n3\n"}, {"input": "5 5\n10 7\n-3 -8\n2 11\n10 0\n-1 3\n-3 1 3 13\n-1 -1 9 5\n-3 -16 12 11\n0 0 5 4\n-1 -13 15 10", "output": "2\n1\n5\n0\n3\n"}, {"input": "5 5\n10 7\n-3 -8\n2 11\n0 0\n-1 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\nPasser ratings are the generally accepted standard for evaluating NFL quarterbacks.\nI knew a rating of 100 i...
[{"input": "432\n3554\n291\n28\n2", "output": "[112.2]", "fn_name": "passer_rating"}, {"input": "48\n192\n19\n2\n3", "output": "[39.6]", "fn_name": "passer_rating"}, {"input": "34\n172\n20\n1\n1", "output": "[69.7]", "fn_name": "passer_rating"}, {"input": "5\n76\n4\n1\n0", "output": "[158.3]", "fn_name": "passer_rating...
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\nIn Berland recently a new collection of toys went on sale. This collection consists of 10^9 types of toys, nu...
[{"input": "5 100000000\n100000000 999999999 1 2 3\n", "output": "14138\n4 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 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\nDecimal numbers are a common notation system currently in use and use ten symbols 0, 1, 2, 3, 4, 5, 6, 7, 8, ...
[{"input": "7\n4\n0\n24\n10\n10010\n-1", "output": "13\n10\n0\n120\n22\n2130122\n"}, {"input": "7\n4\n1\n24\n10\n10010\n-1", "output": "13\n10\n1\n120\n22\n2130122\n"}, {"input": "7\n4\n0\n12\n16\n10000\n-1", "output": "13\n10\n0\n30\n100\n2130100\n"}, {"input": "7\n4\n0\n24\n10\n11010\n-1", "output": "13\n10\n0\n120\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 an infinitely long street that runs west to east, which we consider as a number line.\nThere are N r...
[{"input": "4 6\n1 3 2\n2 13 10\n18 20 22\n4 4 2\n1\n1\n2\n3\n5\n8", "output": "10\n10\n10\n-1\n-1\n-1\n"}, {"input": "4 6\n2 1 0\n2 13 10\n18 20 22\n7 4 1\n1\n1\n4\n3\n5\n8", "output": "10\n10\n-1\n-1\n-1\n-1\n"}, {"input": "4 6\n1 3 2\n7 13 10\n18 20 13\n3 4 2\n0\n1\n2\n3\n5\n8\n", "output": "2\n2\n10\n-1\n13\n-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\nFind places where a string P is found within a text T. Print all indices of T where P found. The indices of T...
[{"input": "aaaaab\naa", "output": "0\n1\n2\n3\n"}, {"input": "baaaaa\naa", "output": "1\n2\n3\n4\n"}, {"input": "aaabaa\naa", "output": "0\n1\n4\n"}, {"input": "baaaab\naa", "output": "1\n2\n3\n"}, {"input": "aaaabb\naa", "output": "0\n1\n2\n"}, {"input": "b`aaaa\naa", "output": "2\n3\n4\n"}, {"input": "``a```\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\nThe Smart Beaver from ABBYY began to develop a new educational game for children. The rules of the game are f...
[{"input": "120\n242 524 420 973 816 432 247 666 134 849 145 366 608 930 613 315 863 628 97 109 65 704 741 314 736 17 872 971 559 648 223 771 171 327 782 837 303 393 292 339 730 834 794 868 540 251 789 893 23 305 116 220 699 863 580 992 861 393 98 253 544 171 336 207 348 496 316 285 286 727 613 616 304 811 592 916 91 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\nSakuzyo - Imprinting\n\nA.R.C. Markland-N is a tall building with $n$ floors numbered from $1$ to $n$. Betwee...
[{"input": "1\n100 52 99\n51 69 42 32 34 62 12 75 88 18 57 47 40 91 100 81 72 15 26 14 93 68 6 50 5 24 97 52 10 20 54 9 56 39 21 55 7 98 59 87 77 17 29 13 30 46 37 76 71 78 96 82 49 64 84 60 67 19 2 25 85 89 38 41 11 90 35 48 27 28 70 65 66 16 79 3 80 44 36 43 61 99 22 33 86 4 83 94 74 31 73 95 58 53 8 63 92 45 23\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### Task\n\nYes, your eyes are no problem, this is toLoverCase (), not toLowerCase (), we want to make the wo...
[{"input": "\"Hello World!\"", "output": "[\"ELEEV VVOEE!\"]", "fn_name": "to_lover_case"}, {"input": "\"jrvz,\"", "output": "[\"OOOO,\"]", "fn_name": "to_lover_case"}, {"input": "\"LOVE\"", "output": "[\"EVOL\"]", "fn_name": "to_lover_case"}, {"input": "\"love\"", "output": "[\"EVOL\"]", "fn_name": "to_lover_case"}, {...
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\nWe have a tree with N vertices. The i-th edge connects Vertex A_i and B_i bidirectionally.\nTakahashi is stan...
[{"input": "9626 1978 3170\n4041 8502\n9589 1770\n3880 9265\n3674 287\n5843 6458\n4211 4202\n1543 3712\n2171 8104\n6298 1286\n702 6013\n5943 5185\n570 8388\n328 3661\n4012 7110\n5999 5207\n4151 4634\n1287 1773\n8991 1892\n6828 7699\n6330 2869\n8268 6633\n3292 1018\n7016 6679\n8643 7852\n7834 6467\n4894 2098\n2936 460\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\nJon Snow is on the lookout for some orbs required to defeat the white walkers. There are k different types of...
[{"input": "8 10\n100\n200\n300\n400\n500\n600\n700\n800\n900\n1000\n", "output": "11\n13\n14\n15\n16\n16\n17\n18\n19\n20\n"}, {"input": "8 10\n100\n200\n300\n400\n500\n600\n700\n862\n900\n1000\n", "output": "11\n13\n14\n15\n16\n16\n17\n19\n19\n20\n"}, {"input": "7 10\n100\n200\n300\n400\n500\n600\n700\n800\n900\n1000\...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nYou have to create a method \"compoundArray\" which should take as input two int arrays of different length a...
[{"input": "[2147483647, 2147483646, 2147483645, 2147483644, 2147483643]\n[9]", "output": "[[2147483647, 9, 2147483646, 2147483645, 2147483644, 2147483643]]", "fn_name": "compound_array"}, {"input": "[0, 1, 2]\n[9, 8, 7, 6, 5, 4, 3, 2, 1, 0]", "output": "[[0, 9, 1, 8, 2, 7, 6, 5, 4, 3, 2, 1, 0]]", "fn_name": "compound_...
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\nPiegirl has found a monster and a book about monsters and pies. When she is reading the book, she found out t...
[{"input": "11 10\n1 9 -1 -1 -1 -1 -1 -1 -1 -1 -1\n1 10 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1\n2 11 1 1 1 1 1 1 1 1 1 1 -1\n3 11 2 2 2 2 2 2 2 2 2 2 -1\n4 11 3 3 3 3 3 3 3 3 3 3 -1\n5 11 4 4 4 4 4 4 4 4 4 4 -1\n6 11 5 5 5 5 5 5 5 5 5 5 -1\n7 11 6 6 6 6 6 6 6 6 6 6 -1\n8 11 7 7 7 7 7 7 7 7 7 7 -1\n9 11 8 8 8 8 8 8 8 8 8 8 -1\n1...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nTakahashi has an empty string S and a variable x whose initial value is 0.\n\nAlso, we have a string T consis...
[{"input": "0111101111", "output": "28\n"}, {"input": "0111001111", "output": "27\n"}, {"input": "1010011111", "output": "29\n"}, {"input": "0010001111", "output": "23\n"}, {"input": "0010001011", "output": "21\n"}, {"input": "0010001001", "output": "18\n"}, {"input": "0110001001", "output": "19\n"}, {"input": "0010001...
code_stdio
[ { "content": "You are an expert Python programmer. 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 2 elevators (named \"left\" and \"right\") in a building with 3 floors (numbered `0` to `2`), write a f...
[{"input": "0\n1\n1", "output": "[\"right\"]", "fn_name": "elevator"}, {"input": "0\n1\n2", "output": "[\"right\"]", "fn_name": "elevator"}, {"input": "0\n0\n0", "output": "[\"right\"]", "fn_name": "elevator"}, {"input": "0\n2\n1", "output": "[\"right\"]", "fn_name": "elevator"}, {"input": "0\n0\n1", "output": "[\"righ...
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\nGiven the integer n, output the smallest m such that nCm (the number of combinations that choose m...
[{"input": "127", "output": "128\n"}, {"input": "255", "output": "256\n"}, {"input": "175", "output": "16\n"}, {"input": "101", "output": "2\n"}, {"input": "15", "output": "16\n"}, {"input": "31", "output": "32\n"}, {"input": "63", "output": "64\n"}, {"input": "110", "output": "1\n"}, {"input": "010", "output": "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\nWrite a function that accepts two parameters (a and b) and says whether a is smaller than, bigger than, or eq...
[{"input": "100\n80", "output": "[\"100 is greater than 80\"]", "fn_name": "no_ifs_no_buts"}, {"input": "45\n51", "output": "[\"45 is smaller than 51\"]", "fn_name": "no_ifs_no_buts"}, {"input": "100\n100", "output": "[\"100 is equal to 100\"]", "fn_name": "no_ifs_no_buts"}, {"input": "20\n19", "output": "[\"20 is grea...
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 are N balls in the xy-plane. The coordinates of the i-th of them is (x_i, i).\nThus, we have one ball o...
[{"input": "5\n20\n11 12 9 17 12\n", "output": "74\n"}, {"input": "5\n20\n14 12 16 17 15", "output": "52\n"}, {"input": "5\n20\n14 10 16 17 15", "output": "56\n"}, {"input": "5\n20\n14 10 20 17 15", "output": "48\n"}, {"input": "5\n20\n14 18 20 17 15", "output": "32\n"}, {"input": "5\n20\n14 18 20 17 19", "output": "24...
code_stdio
[ { "content": "You are an expert Python programmer. 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 phone numbers in Polycarp's contacts on his phone. Each number is a 9-digit integer, starting wit...
[{"input": "9\n111111111\n111111110\n111111100\n111111000\n111110000\n111100000\n111000000\n110000000\n100000000\n", "output": "111111111\n111111110\n111111100\n111111000\n111110000\n111100000\n111000000\n110000000\n00000000\n"}, {"input": "10\n302417715\n621211824\n474451896\n961495400\n633841010\n839982537\n797812119...
code_stdio
[ { "content": "You are an expert Python programmer. 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 and Russian. \n\nYou are given an array A of integers of size N...
[{"input": "1\n3 3\n3 5 17\n1 2\n0 1\n-1 0", "output": "17\n1\n1\n"}, {"input": "1\n3 3\n3 9 23\n3 0\n1 2\n-1 0", "output": "1\n23\n1\n"}, {"input": "1\n3 3\n5 10 10\n4 0\n0 0\n4 0", "output": "5\n5\n5\n"}, {"input": "1\n3 3\n3 6 19\n1 2\n0 0\n4 0", "output": "19\n1\n1\n"}, {"input": "1\n3 3\n2 2 16\n1 1\n1 2\n2 3", "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\nAs you must know, the maximum clique problem in an arbitrary graph is NP-hard. Nevertheless, for some graphs ...
[{"input": "50\n1 2 5 7 9 14 19 24 25 29 31 34 37 40 43 44 46 53 54 57 58 59 60 61 62 64 66 68 69 70 72 75 78 79 80 81 82 84 85 86 87 88 89 90 91 92 93 94 96 98\n", "output": "4\n"}, {"input": "50\n1 2 5 7 9 14 19 24 25 29 31 34 37 40 43 44 46 53 54 57 58 59 60 61 62 64 66 68 69 70 72 75 78 79 80 81 82 84 85 86 87 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\nWe're giving away nice huge bags containing number tiles! A bag we want to present to you contains n tiles. E...
[{"input": "214\n1 2 2 1 1 1 2 2 2 2 1 1 1 2 2 2 2 2 2 1 2 1 1 2 2 1 1 2 2 2 2 1 2 2 2 1 1 2 2 2 1 1 2 2 1 2 2 2 1 1 2 1 1 2 1 1 1 2 2 2 2 1 2 2 2 1 2 1 2 1 1 2 2 1 1 2 1 2 2 2 2 2 2 2 1 2 1 2 2 1 2 2 2 1 2 2 1 2 2 1 2 2 2 2 1 2 2 2 1 1 2 2 2 2 2 2 1 2 2 2 2 1 1 1 2 2 2 1 2 1 2 1 1 2 1 1 1 2 2 2 1 2 2 2 2 2 2 2 1 2 2 1...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nMultiple polygonal lines are given on the xy-plane. Given a list of polygonal lines and a template, you must ...
[{"input": "5\n5\n0 0\n2 0\n2 1\n4 1\n4 0\n5\n0 0\n0 2\n-1 2\n-1 4\n0 4\n5\n0 0\n0 1\n-2 1\n-2 2\n0 2\n5\n0 0\n0 -1\n2 -1\n2 0\n4 0\n5\n0 0\n2 0\n2 -1\n4 -1\n4 0\n5\n0 0\n2 0\n2 1\n4 1\n4 0\n4\n4\n-60 -75\n-60 -78\n-42 -78\n-42 -6\n4\n10 3\n10 7\n-4 7\n-4 40\n4\n-74 66\n-74 63\n-92 63\n-92 135\n4\n-12 22\n-12 25\n-30 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\nYou are given $n$ numbers $a_1, a_2, \\dots, a_n$. With a cost of one coin you can perform the following oper...
[{"input": "22\n99039804 -580368436 -694542422 231508622 -490965348 958087037 -570157955 560902976 -840005981 -1381720926 -708462966 639575552 119982241 -631099451 -154223559 102960509 -225552439 507250810 -712228569 989896753 1574991855 1\n", "output": "12773524192\n"}, {"input": "22\n99039804 -580368436 -694542422 23...
code_stdio
[ { "content": "You are an expert Python programmer. 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 times you recall a good old friend and everything you've come through together. Luckily there are s...
[{"input": "100 7\n0 1 1 1 0 5 6 6 8 8 9 11 12 11 8 0 0 14 6 16 7 21 15 23 15 24 0 0 0 28 0 29 26 27 19 1 0 21 37 32 40 30 37 34 39 38 34 38 0 0 41 24 45 47 0 33 46 26 31 0 21 57 57 18 63 63 20 59 65 56 68 0 30 55 55 0 70 43 59 49 59 79 66 74 0 11 65 0 80 63 0 84 73 49 73 81 0 86 76 20\n", "output": "8 9 10 11 12 13 14...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nVanya has a table consisting of 100 rows, each row contains 100 cells. The rows are numbered by integers from...
[{"input": "5\n4 11 20 20\n6 11 20 16\n5 1 33 15\n11 3 18 21\n3 2 14 21\n", "output": "1087\n"}, {"input": "5\n4 11 20 22\n6 11 20 16\n5 1 34 15\n11 3 18 21\n3 1 14 11\n", "output": "1028\n"}, {"input": "5\n4 11 20 38\n6 11 20 16\n5 2 19 15\n11 3 18 15\n3 2 14 11\n", "output": "1000\n"}, {"input": "5\n4 11 20 20\n6 11 ...
code_stdio
[ { "content": "You are an expert Python programmer. 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, print \"1\" if g is a convex polygon, \"0\" otherwise. Here, in a convex polygon, all ...
[{"input": "4\n-1 1\n25 -3\n1 0\n-1 -1", "output": "0\n"}, {"input": "4\n-1 1\n25 -3\n1 -1\n-1 0", "output": "0\n"}, {"input": "4\n-1 1\n25 -3\n1 -1\n-1 1", "output": "0\n"}, {"input": "4\n-1 2\n25 -3\n1 -1\n-1 1", "output": "0\n"}, {"input": "4\n-1 2\n25 -3\n0 -1\n-1 1", "output": "0\n"}, {"input": "4\n-1 4\n25 -3\n0 ...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nAndryusha goes through a park each day. The squares and paths between them look boring to Andryusha, so he de...
[{"input": "50\n8 37\n40 8\n38 40\n10 38\n29 10\n33 29\n17 33\n25 17\n19 25\n3 19\n13 3\n24 13\n12 24\n5 12\n41 5\n11 41\n27 11\n45 27\n6 45\n35 6\n9 35\n50 9\n32 50\n21 32\n22 21\n1 22\n31 1\n28 31\n4 28\n30 4\n7 30\n48 7\n46 48\n16 46\n49 16\n39 49\n18 39\n14 18\n34 14\n23 34\n20 23\n15 20\n44 15\n42 44\n2 42\n36 2\n...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nA string of length 6 consisting of lowercase English letters is said to be coffee-like if and only if its 3-r...
[{"input": "sippuu\n", "output": "Yes\n"}, {"input": "coffee\n", "output": "Yes\n"}, {"input": "dceett\n", "output": "Yes\n"}, {"input": "otjjmm\n", "output": "Yes\n"}, {"input": "zkrrcc\n", "output": "Yes\n"}, {"input": "abcccc\n", "output": "Yes\n"}, {"input": "iphone\n", "output": "No\n"}, {"input": "mdihxy\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\nTakahashi has decided to work on K days of his choice from the N days starting with tomorrow.\nYou are given ...
[{"input": "16 4 3\noxxoxoxxxxxooxoo", "output": "1\n6\n12\n16\n"}, {"input": "16 4 3\nooxxoxnyxxoxoxwo", "output": "1\n5\n11\n16\n"}, {"input": "16 4 3\npoxxoxoxxyoxoxxo", "output": "2\n7\n11\n16\n"}, {"input": "16 4 3\nooxxnxoxxyoxxxop", "output": "7\n11\n15\n"}, {"input": "16 4 3\nooxxoxoxxxoxoxxo\n", "output": "11\...
code_stdio
[ { "content": "You are an expert Python programmer. 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 Floral Clock has been standing by the side of Mirror Lake for years. Though unable to keep time, it remin...
[{"input": "23333\n", "output": "259575428\n"}, {"input": "49997\n", "output": "645043850\n"}, {"input": "10492\n", "output": "914991759\n"}, {"input": "30000\n", "output": "583465411\n"}, {"input": "10001\n", "output": "552705744\n"}, {"input": "49999\n", "output": "791828238\n"}, {"input": "10000\n", "output": "93853...
code_stdio
[ { "content": "You are an expert Python programmer. 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\nYou have to write a function **pattern** which returns the following Pattern(See Examples) upto n...
[{"input": "8", "output": "[\" 12345678\\n 12345678 \\n 12345678 \\n 12345678 \\n 12345678 \\n 12345678 \\n 12345678 \\n12345678 \"]", "fn_name": "pattern"}, {"input": "5", "output": "[\" 12345\\n 12345 \\n 12345 \\n 12345 \\n12345 \"]", "fn_name": "pattern"}, {"inp...
code_functional
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nIn telecomunications we use information coding to detect and prevent errors while sending data. \n\nA parity ...
[{"input": "\"10100011 00111001 11001100 01010100 10110110 00111111\"", "output": "[\"1010001 0011100 1100110 error error 0011111\"]", "fn_name": "parity_bit"}, {"input": "\"01101110 01100000 01010110 10001111 01100011\"", "output": "[\"error 0110000 0101011 error 0110001\"]", "fn_name": "parity_bit"}, {"input": "\"111...
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\nLittle Artem found a grasshopper. He brought it to his house and constructed a jumping area for him.\n\nThe a...
[{"input": "10\n>>>>>>>>><\n1 1 1 1 1 1 1 1 1 5\n", "output": "INFINITE\n"}, {"input": "10\n>>>>>>>>><\n1 1 1 1 1 1 1 1 1 1\n", "output": "INFINITE\n"}, {"input": "10\n>>>>>>>>>>\n1 1 1 1 1 1 1 1 1 100\n", "output": "FINITE\n"}, {"input": "10\n>>>>>>>>>>\n1 1 1 1 1 1 1 1 1 100\n", "output": "FINITE\n"}, {"input": "10\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\nGiven a positive number n > 1 find the prime factor decomposition of n.\nThe result will be a string with the...
[{"input": "782611830", "output": "[\"(2)(3**2)(5)(7**2)(11)(13)(17)(73)\"]", "fn_name": "primeFactors"}, {"input": "7775460", "output": "[\"(2**2)(3**3)(5)(7)(11**2)(17)\"]", "fn_name": "primeFactors"}, {"input": "342217392", "output": "[\"(2**4)(3)(11)(43)(15073)\"]", "fn_name": "primeFactors"}, {"input": "775878912"...
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\nAOR Ika made a set $ S = \\\\ {a_1, ..., a_N \\\\} $ and a map $ f: S β†’ S $. $ f (a_i) = b_i $. Fo...
[{"input": "5\n2 1 3 4 5\n3 4 2 5 1", "output": "Yes\n"}, {"input": "5\n1 2 3 4 5\n2 4 3 5 1", "output": "Yes\n"}, {"input": "5\n1 3 2 4 5\n3 4 2 5 1", "output": "Yes\n"}, {"input": "5\n2 1 3 4 5\n2 4 3 5 1", "output": "Yes\n"}, {"input": "5\n1 4 3 2 5\n3 4 2 5 1", "output": "Yes\n"}, {"input": "5\n2 1 3 4 5\n3 4 2 5 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\nGiven a string containing a list of integers separated by commas, write the function string_to_int_list(s) th...
[{"input": "\",,,,,1,2,3,,,4,,5,,,\"", "output": "[[1, 2, 3, 4, 5]]", "fn_name": "string_to_int_list"}, {"input": "\"21,12,23,34,45\"", "output": "[[21, 12, 23, 34, 45]]", "fn_name": "string_to_int_list"}, {"input": "\"-1,-2,3,-4,-5\"", "output": "[[-1, -2, 3, -4, -5]]", "fn_name": "string_to_int_list"}, {"input": "\"1...
code_functional
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nYou are given a sequence of $n$ integers $a_1$, $a_2$, ..., $a_n$. Let us call an index $j$ ($2 \\le j \\le {...
[{"input": "4\n3\n3 14 1\n5\n3 3 2 2 4\n6\n1 6 2 2 2 10\n5\n1 12 1 4 2\n", "output": "0\n0\n0\n0\n"}, {"input": "4\n3\n3 14 1\n5\n3 3 2 1 4\n6\n1 6 2 2 2 10\n5\n1 12 1 4 2\n", "output": "0\n0\n0\n0\n"}, {"input": "4\n3\n1 5 0\n5\n5 4 2 2 -1\n6\n0 8 2 5 4 10\n5\n2 6 1 4 -1\n", "output": "0\n0\n1\n0\n"}, {"input": "4\n3\...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nBandits appeared in the city! One of them is trying to catch as many citizens as he can.\n\nThe city consists...
[{"input": "100\n1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1\n0 0 63 70 92 75 4 96 52 33 86 57 53 85 91 62 23 0 28 37 41 69 26 64 7 100 41 19 70 60 1 50 12 98 62 45 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\nThere are n student groups at the university. During the study day, each group can take no more than 7 classe...
[{"input": "20\n1111111\n1101011\n1111011\n0111111\n1111111\n1110111\n1111111\n1111111\n1111111\n1111111\n1110111\n1111111\n0111111\n1011111\n1111111\n1111111\n1101110\n1111111\n1111111\n1111111\n", "output": "20\n"}, {"input": "20\n1111111\n1101011\n1111011\n0111111\n1111111\n1110111\n1111111\n1111111\n1111111\n111111...
code_stdio