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\nFinish the solution so that it takes an input `n` (integer) and returns a string that is the decimal represen... | [{"input": "1234567890", "output": "[\"1,234,567,890\"]", "fn_name": "group_by_commas"}, {"input": "123456789", "output": "[\"123,456,789\"]", "fn_name": "group_by_commas"}, {"input": "12345678", "output": "[\"12,345,678\"]", "fn_name": "group_by_commas"}, {"input": "1234567", "output": "[\"1,234,567\"]", "fn_name": "g... | 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\nIvan is a student at Berland State University (BSU). There are n days in Berland week, and each of these days... | [{"input": "4 113 370\n01110100100010110100110000000011001111110000100111111001011001110111110111001011010110000110110010101010110001000\n01101001111110001010001100101100111100111001001001001101110101100110110110001110100010111011101011101110011110100\n0110011000100111101000001010110011110001111101000010101001101111111... | code_stdio |
[
{
"content": "You are an expert Python programmer. 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 the big birthday party, Katie still wanted Shiro to have some more fun. Later, she came up with a game ... | [{"input": "727\nbaabbabbbababbbbaaaabaabbaabababaaababaaababbbbababbbbbbbbbbaaabaabbbbbbbbaaaabaabbaaabaabbabaa\nddcdcccccccdccdcdccdddcddcddcddddcdddcdcdccddcdddddccddcccdcdddcdcccdccccccdcdcdccccccdccccccdc\nfffeefeffeefeeeeffefffeeefffeefffefeefefeeeffefefefefefefffffffeeeeeffffeefeeeeffffeeeeeefeffef\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\nVasya is an administrator of a public page of organization \"Mouse and keyboard\" and his everyday duty is to... | [{"input": "2\n#aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaab\n#aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\n", "output": "#aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa... | code_stdio |
[
{
"content": "You are an expert Python programmer. 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 once wrote a sad love song and shared it to Vasya. The song is a string consisting of lowercase English... | [{"input": "13 7\nsonokhisumiwo\n1 5\n2 10\n7 10\n1 13\n1 8\n1 9\n3 6\n", "output": "74\n125\n62\n191\n110\n131\n48\n"}, {"input": "13 7\nowimusihkooos\n1 7\n2 10\n7 8\n2 13\n2 8\n2 4\n6 9\n", "output": "109\n128\n17\n177\n102\n45\n47\n"}, {"input": "13 7\nowimusihkooos\n1 7\n2 10\n7 7\n2 13\n2 8\n2 9\n6 9\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\nYou are given an integer sequence of length N, a_1,a_2,...,a_N.\n\nFor each 1≤i≤N, you have three choices: ad... | [{"input": "10\n-1 1 2 3 2 8 6 7 14 4", "output": "4\n"}, {"input": "10\n-1 2 1 5 8 2 8 4 20 0", "output": "4\n"}, {"input": "10\n-1 2 1 5 8 4 8 4 20 0", "output": "3\n"}, {"input": "10\n-1 2 1 5 8 4 8 4 17 0", "output": "3\n"}, {"input": "10\n-1 2 1 5 4 4 8 4 17 0", "output": "4\n"}, {"input": "10\n-1 2 1 1 4 4 8 4 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\nThe Berland capital is shaken with three bold crimes committed by the Pihsters, a notorious criminal gang.\n\... | [{"input": "99 3\n**.\n...\n...\n...\n...\n...\n...\n...\n...\n...\n...\n...\n...\n...\n...\n...\n...\n...\n...\n...\n...\n...\n...\n...\n...\n...\n...\n...\n...\n...\n...\n...\n...\n...\n...\n...\n...\n...\n...\n...\n...\n...\n...\n...\n...\n...\n...\n...\n...\n...\n...\n...\n...\n...\n...\n...\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\nVasya takes part in the orienteering competition. There are n checkpoints located along the line at coordinat... | [{"input": "97 -13\n-17 -11 -20 -16 -11 -18 -17 -14 -19 -13 -11 -19 -15 -17 -11 -20 -10 -19 -10 -18 -11 -14 -11 -15 -13 -13 -11 -18 -18 -18 -11 -14 -20 -19 -10 -17 -18 -19 -17 -11 -11 -11 -20 -19 -16 -15 -18 -15 -15 -20 -19 -20 -16 -13 -17 -11 -13 -18 -10 -13 -10 -14 -12 -17 -20 -10 -11 -19 -19 -15 -19 -10 -18 -14 -15 ... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nBased on some criterion, Snuke divided the integers from 1 through 12 into three groups as shown in the figur... | [{"input": "12 12", "output": "Yes\n"}, {"input": "1 3\n", "output": "Yes\n"}, {"input": "1 10", "output": "Yes\n"}, {"input": "7 10", "output": "Yes\n"}, {"input": "7 12", "output": "Yes\n"}, {"input": "5 10", "output": "Yes\n"}, {"input": "5 12", "output": "Yes\n"}, {"input": "1 12", "output": "Yes\n"}, {"input": "12... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nN Snukes called Snuke 1, Snuke 2, ..., Snuke N live in a town.\nThere are K kinds of snacks sold in this town... | [{"input": "100 100\n100\n1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100\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\nKuro is living in a country called Uberland, consisting of $n$ towns, numbered from $1$ to $n$, and $n - 1$ b... | [{"input": "70 42 32\n25 50\n51 7\n39 61\n1 33\n20 5\n1 70\n1 63\n42 35\n64 16\n1 11\n39 42\n20 54\n11 14\n57 44\n1 59\n55 40\n25 3\n31 18\n38 68\n57 23\n39 57\n28 10\n39 20\n42 26\n58 6\n20 56\n57 2\n13 21\n15 69\n39 64\n1 39\n62 53\n39 13\n1 41\n22 12\n13 30\n68 67\n20 31\n51 15\n57 32\n59 34\n39 4\n31 65\n58 24\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\nPaul is at the orchestra. The string section is arranged in an r × c rectangular grid and is filled with viol... | [{"input": "10 10 10 1\n8 10\n2 9\n1 10\n3 1\n8 5\n10 1\n4 10\n10 2\n5 3\n9 3\n", "output": "1787\n"}, {"input": "10 10 10 1\n8 10\n2 9\n1 10\n3 1\n8 5\n10 1\n4 10\n10 2\n5 3\n9 3\n", "output": "1787\n"}, {"input": "10 10 10 1\n1 10\n10 8\n7 4\n7 2\n1 3\n6 6\n10 1\n2 7\n9 3\n3 10\n", "output": "1991\n"}, {"input": "10 ... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nYou will receive 3 points for solving this problem.\n\nManao is designing the genetic code for a new type of ... | [{"input": "CCCTTCACCCGGATCCAAATCCCTTAGAAATAATCCCCGACGGCGTTGTATCACCTCTGCACTTGTTAGTAAGGTCAGGCGTCCATTACGGAAGAACGTA\n", "output": "19\n"}, {"input": "GCATTACATGGGGGGGTCCTACGAGCCCGGCATCCCGGAAACTAGCCGGTTAATTTGGTTTAAACCCTCCCACCCCGGATTGTAACCCCCCTCATTGGTT\n", "output": "17\n"}, {"input": "TTCCCAGAGAAAAAAAGGGGCCCAAATGCCCTAAAAAC... | code_stdio |
[
{
"content": "You are an expert Python programmer. 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 programmer on the development team for new recording media. This recording medium can be randomly a... | [{"input": "6\nW 0 2\nW 0 2\nD 0\nW 2 1\nR 3\nR 2\n1\nR 1000000000\n0", "output": "-1\n-1\n\n-1\n\n"}, {"input": "6\nW 0 3\nW 0 2\nD 0\nW 2 1\nR 4\nR 1\n1\nR 1000000000\n0", "output": "-1\n-1\n\n-1\n\n"}, {"input": "6\nW 0 2\nW 0 2\nD 0\nW 3 1\nR 3\nR 2\n1\nR 1000000000\n0", "output": "-1\n-1\n\n-1\n\n"}, {"input": "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\nPasha has two hamsters: Arthur and Alexander. Pasha put n apples in front of them. Pasha knows which apples A... | [{"input": "100 1 100\n84\n1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 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\nThe number \"zero\" is called \"love\" (or \"l'oeuf\" to be precise, literally means \"egg\" in French), for ... | [{"input": "1000000000000000000 1000000000000\n", "output": "20833333333333332\n"}, {"input": "1000000000000000000 1000000000000\n", "output": "20833333333333332\n"}, {"input": "1000000000000000000 470184984576\n", "output": "33333333333333332\n"}, {"input": "1000000000000000000 743008370688\n", "output": "454545454545... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nGo around the Labyrinth\n\nExplorer Taro got a floor plan of a labyrinth. The floor of this labyrinth is in t... | [{"input": "3 3\n...\n.#.\n...\n5 5\n..#..\n.....\n#....\n.....\n.....\n3 8\n..#.....\n........\n.....#..\n3 5\n..#..\n-....\n..#..\n4 4\n....\n....\n..##\n..#.\n0 0", "output": "YES\nNO\nYES\nNO\nNO\n"}, {"input": "3 3\n...\n.#.\n...\n5 5\n..#..\n.....\n...#.\n.....\n.....\n3 8\n.....#..\n........\n.....#..\n3 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\nSome number of chocolate pieces were prepared for a training camp.\nThe camp had N participants and lasted fo... | [{"input": "5\n30 44\n26\n18\n81\n18\n6\n", "output": "56\n"}, {"input": "5\n30 44\n26\n18\n81\n18\n10", "output": "54\n"}, {"input": "5\n30 29\n26\n18\n81\n18\n10", "output": "39\n"}, {"input": "5\n30 29\n26\n18\n81\n18\n19", "output": "38\n"}, {"input": "5\n1 113\n25\n21\n13\n16\n7", "output": "118\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\nThis problem is a version of problem D from the same contest with some additional constraints and tasks.\n\nT... | [{"input": "3\n8\n1 0\n4 1\n2 0\n4 1\n5 1\n6 1\n3 0\n2 0\n4\n1 1\n1 1\n2 1\n2 1\n9\n2 0\n2 0\n4 1\n4 1\n4 1\n7 0\n7 1\n7 0\n7 1\n", "output": "3 3\n3 3\n9 5\n"}, {"input": "3\n8\n1 0\n4 1\n2 0\n4 1\n5 1\n6 1\n3 0\n2 0\n4\n1 1\n1 1\n2 1\n2 1\n9\n2 0\n2 0\n4 1\n4 1\n4 1\n7 0\n9 1\n7 0\n7 1\n", "output": "3 3\n3 3\n6 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: Information Search\n\nproblem\n\nThe posting list is a list in which there is a correspondence between the... | [{"input": "4 4\n0 2 10 11\n1 2 4 14", "output": "1 7\n2\n0\n1\n2\n4\n10\n11\n14\n"}, {"input": "4 4\n1 2 5 12\n2 3 4 13", "output": "1 7\n2\n1\n2\n3\n4\n5\n12\n13\n"}, {"input": "4 4\n1 2 4 12\n2 3 4 13", "output": "2 6\n2\n4\n1\n2\n3\n4\n12\n13\n"}, {"input": "4 4\n0 2 4 10\n0 3 4 13", "output": "2 6\n0\n4\n0\n2\n3\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\nTavas is a strange creature. Usually \"zzz\" comes out of people's mouth while sleeping, but string s of leng... | [{"input": "173700 6\nbcabcbcbcbaaacaccaacaccaabacabaacbcacbbccaccbcacbabcaccccccaacacabbbbbacabbaaacbcbbaccaccabbbbaabbacacbabccaabcabbbcacaaccbabbcaaaaaabccbbcabcacbcbcabcbcbbaabacaaccccabacaaaccacaaabbacacabbcccacbaabcacacbbaaaccaccbaccccccbccaabcacaacabaccababacabcccbcbbacbabacbcbabacbbaccaabcabcbbbaaabbacbbbcacccb... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nThere are $n$ monsters standing in a row numbered from $1$ to $n$. The $i$-th monster has $h_i$ health points... | [{"input": "6 2 3 3\n7 10 50 12 1 8\n", "output": "5\n"}, {"input": "6 2 3 2\n7 10 50 12 1 8\n", "output": "4\n"}, {"input": "6 2 3 2\n5 10 50 12 1 8\n", "output": "3\n"}, {"input": "6 2 2 2\n5 10 50 12 1 8\n", "output": "6\n"}, {"input": "6 2 0 3\n1 9 50 12 1 15\n", "output": "6\n"}, {"input": "6 2 3 3\n7 10 51 12 1 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\nDigits Are Not Just Characters\n\nMr. Manuel Majorana Minore made a number of files with numbers in their nam... | [{"input": "2\nfile10\nfi2el0\nfile3", "output": "-\n-\n"}, {"input": "2\nfjle10\nfi2el0\niele3", "output": "-\n+\n"}, {"input": "2\n01eljf\nfi2el0\niele3", "output": "+\n+\n"}, {"input": "2\nflje10\nif3el0\n2elei", "output": "+\n-\n"}, {"input": "2\nfile10\nfi2el0\neile3", "output": "-\n-\n"}, {"input": "2\nfjle10\nfi... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nThis is a harder version of the problem with bigger constraints.\n\nKorney Korneevich dag up an array a of le... | [{"input": "100\n4845 2410 1317 394 2977 1455 2708 1271 2918 1866 4125 534 4055 1726 1819 790 2526 836 4853 4057 1995 3178 2972 3487 3259 4324 3807 895 2308 1513 3213 3480 1131 2807 1343 3231 1277 2683 1559 825 3667 102 1491 2066 4607 1645 3421 1475 3073 2945 3933 1157 378 3238 4123 2901 2840 483 4274 3463 3676 4011 31... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nYou are given an array $a$ consisting of $n$ ($n \\ge 3$) positive integers. It is known that in this array, ... | [{"input": "4\n4\n11 13 11 11\n5\n1 4 4 4 4\n10\n3 3 3 3 10 3 3 3 3 3\n3\n20 20 10\n", "output": "\n2\n1\n5\n3\n"}, {"input": "4\n4\n11 13 11 11\n5\n1 4 4 4 4\n10\n3 3 3 3 10 3 3 3 3 3\n3\n20 20 10\n", "output": "2\n1\n5\n3\n"}, {"input": "4\n4\n11 20 11 11\n5\n1 4 4 4 4\n10\n3 3 3 3 10 3 3 3 3 3\n3\n20 20 10\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\nFennec is fighting with N monsters.\nThe health of the i-th monster is H_i.\nFennec can do the following two ... | [{"input": "3 0\n1000000000 1000000000 1000000000\n", "output": "3000000000\n"}, {"input": "3 0\n1000000000 1000000000 1010000000", "output": "3010000000\n"}, {"input": "3 0\n1000000000 1000000000 1110000000", "output": "3110000000\n"}, {"input": "3 0\n1100000000 1000000000 1110000000", "output": "3210000000\n"}, {"inp... | code_stdio |
[
{
"content": "You are an expert Python programmer. 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, Twilight Sparkle is interested in how to sort a sequence of integers a_1, a_2, ..., a_{n} in non-dec... | [{"input": "9\n4 5 6 7 1 2 3 4 10\n", "output": "-1\n"}, {"input": "9\n4 5 6 7 1 2 3 4 10\n", "output": "-1\n"}, {"input": "9\n4 5 6 7 1 0 3 4 10\n", "output": "-1\n"}, {"input": "9\n4 5 6 7 1 0 3 4 2\n", "output": "-1\n"}, {"input": "9\n4 5 0 7 1 0 3 4 2\n", "output": "-1\n"}, {"input": "9\n4 5 0 7 1 0 0 4 2\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\nVasya is sitting on an extremely boring math class. To have fun, he took a piece of paper and wrote out n num... | [{"input": "200 100\n56988719755815575893282254081467698462485803782142631369385180999746639622554559884281193367342283559238834106917388166048020056852911293394377949964185368886333934084399980368238188117302968424219707\n", "output": "295455656\n"}, {"input": "200 99\n9999999999999999999999999999999999999999999999999... | code_stdio |
[
{
"content": "You are an expert Python programmer. 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. \nChef has N simple polygons (non self intersectin... | [{"input": "1\n3\n6\n-2 2 -1 1 2 2 2 -1 1 -2 -2 -2\n3\n-1 -1 1 -1 1 1\n4\n3 3 -3 1 -3 -3 3 -3", "output": "1 0 2\n"}, {"input": "1\n3\n6\n-2 2 -1 1 2 2 2 -1 1 -2 -3 -2\n3\n-1 -1 1 -1 1 1\n4\n3 3 -3 1 -3 -3 3 -3", "output": "1 0 2\n"}, {"input": "1\n3\n6\n-2 2 -1 1 2 2 2 -1 1 -2 -3 -2\n3\n-1 -1 1 -1 1 0\n4\n3 3 -3 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\nThe Free Meteor Association (FMA) has got a problem: as meteors are moving, the Universal Cosmic Descriptive ... | [{"input": "6 5 30\n536048 34640 572197 62457 304174\n194764 325606 270468 784237 551632\n10580 294606 63164 543647 531895\n430397 576813 678878 323394 603231\n534567 804015 403517 886087 981939\n518845 962097 609792 877955 88610\nc 1 5\nc 2 5\nc 2 5\nr 5 3\nc 5 2\nc 4 5\nr 6 5\nc 2 1\nr 3 4\nr 4 3\nc 4 5\nc 2 1\nr 1 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\nYou are a lover of bacteria. You want to raise some bacteria in a box. \n\nInitially, the box is empty. Each ... | [{"input": "1000000000\n", "output": "13\n"}, {"input": "1000000000\n", "output": "13\n"}, {"input": "1000100000\n", "output": "13\n"}, {"input": "1034416188\n", "output": "18\n"}, {"input": "1000100100\n", "output": "13\n"}, {"input": "536870911\n", "output": "29\n"}, {"input": "343000816\n", "output": "14\n"}, {"inpu... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n<image>\n\n\nThere is a container that is bifurcated as shown in the figure. Drop 10 balls numbered from 1 to... | [{"input": "2\n1 3 4 0 0 1 17 2 -1 4\n114 21 15 1 1 1 -1 89 2 13", "output": "NO\nNO\n"}, {"input": "2\n1 3 4 1 0 1 17 2 -1 4\n114 21 15 1 1 1 -1 89 2 13", "output": "NO\nNO\n"}, {"input": "2\n1 3 4 1 0 1 17 2 -1 4\n114 21 15 1 1 1 -1 89 2 20", "output": "NO\nNO\n"}, {"input": "2\n1 3 4 1 0 1 17 2 -1 6\n114 21 15 1 1 1... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nLet s be some string consisting of symbols \"0\" or \"1\". Let's call a string t a substring of string s, if ... | [{"input": "99985 45273\n", "output": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000... | code_stdio |
[
{
"content": "You are an expert Python programmer. 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\"QAQ\" is a word to denote an expression of crying. Imagine \"Q\" as eyes with tears and \"A\" as a mouth.\n... | [{"input": "QCQAQAGAWAQQQAQAVQAQQQQAQAQQQAQAAATQAAVAAAQQQQAAAUUQAQQNQQWQQWAQAAQQKQYAQAAQQQAAQRAQQQWBQQQQAPBAQGQA\n", "output": "13174\n"}, {"input": "QQAQQAKQFAQLQAAWAMQAZQAJQAAQQOACQQAAAYANAQAQQAQAAQQAOBQQJQAQAQAQQQAAAAABQQQAVNZAQQQQAMQQAFAAEAQAQHQT\n", "output": "10420\n"}, {"input": "AQEGQHQQKQAQQPQKAQQQAAAAQQQAQEQA... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nPolandBall is a young, clever Ball. He is interested in prime numbers. He has stated a following hypothesis: ... | [{"input": "1447\n", "output": "1\n"}, {"input": "1127\n", "output": "1\n"}, {"input": "1722\n", "output": "2\n"}, {"input": "1332\n", "output": "1\n"}, {"input": "1261\n", "output": "1\n"}, {"input": "1010\n", "output": "1\n"}, {"input": "1901\n", "output": "1\n"}, {"input": "1865\n", "output": "1\n"}, {"input": "1024... | code_stdio |
[
{
"content": "You are an expert Python programmer. 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 nth triangular number is defined as the sum of the first n positive integers. The nth tetrahedral number ... | [{"input": "40\n14\n10\n55\n120\n199\n61\n150\n0", "output": "2 6\n2 14\n1 10\n2 21\n1 18\n4 29\n3 27\n3 14\n"}, {"input": "40\n14\n10\n55\n120\n269\n61\n150\n0", "output": "2 6\n2 14\n1 10\n2 21\n1 18\n3 31\n3 27\n3 14\n"}, {"input": "40\n14\n10\n55\n120\n269\n61\n291\n0", "output": "2 6\n2 14\n1 10\n2 21\n1 18\n3 31\... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nVova is again playing some computer game, now an RPG. In the game Vova's character received a quest: to slay ... | [{"input": "1 1 100\n100 99\n", "output": "9901\nHEAL\nHEAL\nHEAL\nHEAL\nHEAL\nHEAL\nHEAL\nHEAL\nHEAL\nHEAL\nHEAL\nHEAL\nHEAL\nHEAL\nHEAL\nHEAL\nHEAL\nHEAL\nHEAL\nHEAL\nHEAL\nHEAL\nHEAL\nHEAL\nHEAL\nHEAL\nHEAL\nHEAL\nHEAL\nHEAL\nHEAL\nHEAL\nHEAL\nHEAL\nHEAL\nHEAL\nHEAL\nHEAL\nHEAL\nHEAL\nHEAL\nHEAL\nHEAL\nHEAL\nHEAL\nH... | code_stdio |
[
{
"content": "You are an expert Python programmer. 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$ fishermen have just returned from a fishing vacation. The $i$-th fisherman has caught a fish of weight $a... | [{"input": "10\n319645572 758298525 812547177 459359946 355467212 304450522 807957797 916787906 239781206 242840396\n", "output": "0\n"}, {"input": "10\n319645572 758298525 812547177 459359946 355467212 304450522 807957797 916787906 239781206 242840396\n", "output": "0\n"}, {"input": "10\n319645572 758298525 812547177 ... | code_stdio |
[
{
"content": "You are an expert Python programmer. 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 program will receive an array of complex numbers represented as strings. Your task is to write the `com... | [{"input": "[\"-1000i\", \"1000i\", \"1234\"]", "output": "[\"1234\"]", "fn_name": "complexSum"}, {"input": "[\"1\", \"10\", \"100\", \"1000\"]", "output": "[\"1111\"]", "fn_name": "complexSum"}, {"input": "[\"10+5i\", \"1-i\", \"-i\"]", "output": "[\"11+3i\"]", "fn_name": "complexSum"}, {"input": "[\"2+i\", \"3+2i\", ... | 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 playing a computer game, where you lead a party of $m$ soldiers. Each soldier is characterised by his... | [{"input": "53 1 27 3\n44 28 48 60 29 42 59 32 9 58 3 11 7 53 4 19 37 41 36 52 29 9 24 8 31 39 52 41 37 44 26 37 37 48 6 21 20 42 25 3 33 2 35 39 33 23 10 60 48 4 1 28 21\n1 1 11\n1 1 21\n1 1 3\n1 1 42\n1 1 16\n1 1 32\n1 1 52\n1 1 17\n1 1 39\n1 1 22\n1 1 31\n1 1 50\n1 1 23\n1 1 14\n1 1 41\n1 1 53\n1 1 60\n1 1 49\n1 1 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\n# Task\nA masked number is a string that consists of digits and one asterisk (`*`) that should be replaced by... | [{"input": "\"1234567890123456789012345678*0\"", "output": "[[\"123456789012345678901234567800\", \"123456789012345678901234567830\", \"123456789012345678901234567860\", \"123456789012345678901234567890\"]]", "fn_name": "is_divisible_by_6"}, {"input": "\"34234*2\"", "output": "[[\"3423402\", \"3423432\", \"3423462\", \... | 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$ dormitories in Berland State University, they are numbered with integers from $1$ to $n$. Each ... | [{"input": "3 10\n1010000000 1000000000 1000000000\n330201655 567869543 1000000000 1000000001 1500000000 1999999999 2000000000 2000000001 2754432345 3000000000\n", "output": "1 330201655\n1 567869543\n1 1000000000\n1 1000000001\n2 490000000\n2 989999999\n2 990000000\n2 990000001\n3 744432345\n3 990000000\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\nThis night wasn't easy on Vasya. His favorite team lost, and he didn't find himself victorious either — altho... | [{"input": "987654320023456789\n", "output": "29340299842560\n"}, {"input": "987654321123456789\n", "output": "33007837322880\n"}, {"input": "987654321123456780\n", "output": "55657759288320\n"}, {"input": "234906817379759421\n", "output": "22773236965920\n"}, {"input": "978691308972024154\n", "output": "33638772575520... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nKenkoooo is planning a trip in Republic of Snuke. In this country, there are n cities and m trains running. T... | [{"input": "8 12 5 5\n2 8 685087149 1569714306\n6 1 298270585 209942236\n2 4 346080035 234079976\n1 5 131857300 40131411\n1 8 30723332 173476334\n2 6 447829832 706415811\n1 4 181424400 548830121\n4 4 30593148 195056405\n7 8 211146752 588024753\n1 6 127300821 203530153\n3 1 336869679 115858230\n4 4 389775999 199123879",... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nGhosts live in harmony and peace, they travel the space without any purpose other than scare whoever stands i... | [{"input": "10 7 -626288749\n795312099 49439844 266151109\n-1357052512 23740808 624973405\n-513221420 -44452680 -391096559\n-350963348 -5068756 -160670209\n690883790 11897718 3356227\n-509035268 -76541374 -210137445\n-121282138 -32581578 230716703\n491731655 9500548 -13423963\n-665038289 48170248 446577586\n495114076 -... | code_stdio |
[
{
"content": "You are an expert Python programmer. 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 the drawing below we have a part of the Pascal's triangle, lines are numbered from **zero** (top).\nThe le... | [{"input": "1291\n1234", "output": "[15478983586799578981605681450735426444083026237083755223526535252775423299626083333014485638841019200]", "fn_name": "diagonal"}, {"input": "1291\n56", "output": "[15478983586799578981605681450735426444083026237083755223526535252775423299626083333014485638841019200]", "fn_name": "dia... | 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\"Balloons should be captured efficiently\", the game designer says. He is designing an oldfashioned game wit... | [{"input": "2\n10 100\n100 270\n2\n12 100\n100 280\n3\n100 150\n10 360\n40 450\n3\n100 150\n17 360\n40 440\n2\n100 10\n50 200\n2\n100 100\n50 110\n1\n15 10\n4\n1 10\n2 20\n3 100\n90 200\n0", "output": "OK 220\nOK 200\nOK 260\nOK 246\nNG 1\nNG 2\nNG 1\nOK 188\n"}, {"input": "2\n10 100\n100 270\n2\n12 100\n100 280\n3\n10... | code_stdio |
[
{
"content": "You are an expert Python programmer. 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 given tree consist of n vertices. Select a vertex as root vertex that satisfies the condition below.... | [{"input": "14\n10 12\n8 14\n6 8\n4 10\n2 4\n1 2\n2 3\n3 5\n5 13\n7 9\n9 11\n10 14\n9 13\n", "output": "-1\n"}, {"input": "14\n10 12\n8 14\n6 8\n4 6\n2 4\n1 2\n2 3\n3 5\n5 13\n7 9\n9 11\n10 14\n9 13\n", "output": "-1\n"}, {"input": "14\n10 12\n8 10\n6 8\n7 6\n3 4\n1 2\n1 3\n3 5\n5 11\n7 9\n7 11\n10 14\n9 13\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\nAlica and Bob are playing a game.\n\nInitially they have a binary string $s$ consisting of only characters 0 ... | [{"input": "1\n111111111111111110000000000000000\n", "output": "NET\n"}, {"input": "1\n111111111111111110000000000000000\n", "output": "NET\n"}, {"input": "1\n111111111111101110000000000000000\n", "output": "NET\n"}, {"input": "1\n111111111111101100100000000000000\n", "output": "NET\n"}, {"input": "1\n11111111111100100... | code_stdio |
[
{
"content": "You are an expert Python programmer. 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\nTo the west of the Australian continent is the wide Indian Ocean. Marine researcher JOI is studyin... | [{"input": "3 2\n26 58 0 50 135 000\n10 24 20 127 126 60\n40 60 20 90 90 131", "output": "60000\n"}, {"input": "1 1\n20 50 -2 50 70 000\n10 102 11 39 90 40\n75 100 36 102 159 8", "output": "1200\n"}, {"input": "1 1\n20 50 -3 50 70 000\n10 102 11 39 90 40\n72 100 36 167 159 8", "output": "1800\n"}, {"input": "3 1\n20 50... | code_stdio |
[
{
"content": "You are an expert Python programmer. 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 candles placed on a number line.\nThe i-th candle from the left is placed on coordinate x_i.\nHer... | [{"input": "8 5\n-9 -7 -4 -3 1 2 3 4\n", "output": "10\n"}, {"input": "8 4\n-14 -7 -4 -11 1 2 3 4", "output": "4\n"}, {"input": "8 4\n-14 -7 -4 -11 1 2 3 8", "output": "8\n"}, {"input": "8 5\n-14 -7 -1 -11 1 2 3 4", "output": "5\n"}, {"input": "8 4\n-14 -7 -1 -11 1 1 3 8", "output": "3\n"}, {"input": "8 4\n-14 -7 -6 -1... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nToad Ivan has $m$ pairs of integers, each integer is between $1$ and $n$, inclusive. The pairs are $(a_1, b_1... | [{"input": "10 10\n1 3\n1 3\n1 3\n1 3\n1 3\n2 3\n1 5\n2 6\n2 7\n2 9\n", "output": "YES\n"}, {"input": "10 10\n1 3\n1 3\n1 3\n1 3\n1 3\n2 3\n1 5\n2 7\n2 7\n2 9\n", "output": "YES\n"}, {"input": "10 10\n1 3\n1 3\n1 3\n1 3\n1 3\n2 3\n1 5\n2 3\n2 7\n2 9\n", "output": "YES\n"}, {"input": "10 10\n1 3\n1 3\n1 3\n1 4\n1 3\n2 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\nYou are given $n$ strings. Each string consists of lowercase English letters. Rearrange (reorder) the given s... | [{"input": "5\na\naba\nabacaba\nba\naba\n", "output": "YES\na\nba\naba\naba\nabacaba\n"}, {"input": "3\nqwerty\nqwerty\nqwerty\n", "output": "YES\nqwerty\nqwerty\nqwerty\n"}, {"input": "3\nqwerty\nqwerty\nqwerty\n", "output": "YES\nqwerty\nqwerty\nqwerty\n"}, {"input": "5\na\naba\nabacaba\nba\naba\n", "output": "YES\na... | code_stdio |
[
{
"content": "You are an expert Python programmer. 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 is Professor R's last class of his teaching career. Every time Professor R taught a class, he gave a speci... | [{"input": "70 11 17929\n10313 427 268935 211 197219 148 357 179290 97 358580 475 343 175 221 286864 429 304793 179290 189 363 221 340651 376509 453 251006 141 304793 358580 235 107574 141 358580 167 181 101469 335 286864 171 107574 105 449 358580 286864 161 286864 349 89645 197219 395 358580 233077 376509 185 199 3944... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nMishka wants to buy some food in the nearby shop. Initially, he has $s$ burles on his card. \n\nMishka can pe... | [{"input": "6\n1\n10\n19\n9876\n12345\n1000000000\n", "output": "1\n11\n21\n10973\n13716\n1111111111\n"}, {"input": "6\n1\n10\n33\n9876\n12345\n1000000000\n", "output": "1\n11\n36\n10973\n13716\n1111111111\n"}, {"input": "6\n1\n10\n24\n9876\n12345\n1000000000\n", "output": "1\n11\n26\n10973\n13716\n1111111111\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\nYou are given an array $A$, consisting of $n$ positive integers $a_1, a_2, \\dots, a_n$, and an array $B$, co... | [{"input": "52\n197 90 23 11 63 198 24 132 68 58 195 100 101 120 96 77 132 155 62 197 170 117 189 160 194 106 172 124 180 75 124 51 51 93 186 93 79 111 161 67 84 183 150 125 25 46 106 29 170 175 4 122\n18\n95 28 20 190 75 89 193 152 53 79 100 3 154 42 67 5 137 60\n", "output": "198 193\n"}, {"input": "52\n197 90 23 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 police department of your city has just started its journey. Initially, they don’t have any manpower. So,... | [{"input": "146\n4 -1 -1 -1 -1 -1 -1 -1 -1 -1 4 -1 3 -1 3 -1 -1 1 4 -1 2 -1 -1 3 -1 -1 -1 4 1 -1 -1 -1 4 -1 -1 -1 -1 -1 -1 3 2 -1 3 2 4 5 2 4 1 5 -1 -1 2 -1 -1 1 -1 5 3 -1 1 2 2 3 5 3 -1 -1 3 -1 -1 3 5 5 -1 -1 5 -1 4 4 1 -1 -1 -1 2 1 -1 -1 -1 2 5 3 -1 -1 -1 3 -1 5 4 -1 1 -1 -1 3 -1 -1 3 1 1 2 -1 -1 -1 1 3 1 -1 2 -1 -1 ... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nVasya has a pile, that consists of some number of stones. $n$ times he either took one stone from the pile or... | [{"input": "100\n++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\n", "output": "100\n"}, {"input": "100\n++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\n", "output": "100"}, {"input": "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\nIt is known that each weight of 1 gram, 3 gram, 9 gram, and 27 gram can be weighed from 1 gram to 40 gram in ... | [{"input": "1204", "output": "+--00--+\n"}, {"input": "1942", "output": "+0-000-+\n"}, {"input": "384", "output": "+---+-0\n"}, {"input": "567", "output": "+-+0000\n"}, {"input": "397", "output": "+--0-0+\n"}, {"input": "373", "output": "+----++\n"}, {"input": "520", "output": "+-0++-+\n"}, {"input": "438", "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\nNote that this is the first problem of the two similar problems. You can hack this problem only if you solve ... | [{"input": "60\n26 6\n59 30\n31 12\n31 3\n38 23\n59 29\n53 9\n38 56\n53 54\n29 21\n17 55\n59 38\n26 16\n24 59\n24 25\n17 35\n24 41\n30 15\n31 27\n8 44\n26 5\n26 48\n8 32\n53 17\n3 34\n3 51\n30 28\n47 10\n53 60\n36 42\n24 53\n59 22\n53 40\n26 52\n36 4\n59 8\n29 37\n36 20\n17 47\n53 18\n3 50\n30 2\n17 7\n8 58\n59 1\n31 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\nThe number ```89``` is the first integer with more than one digit that fulfills the property partially introd... | [{"input": "1\n100", "output": "[[1, 2, 3, 4, 5, 6, 7, 8, 9, 89]]", "fn_name": "sum_dig_pow"}, {"input": "50\n150", "output": "[[89, 135]]", "fn_name": "sum_dig_pow"}, {"input": "10\n150", "output": "[[89, 135]]", "fn_name": "sum_dig_pow"}, {"input": "89\n135", "output": "[[89, 135]]", "fn_name": "sum_dig_pow"}, {"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\nMishka started participating in a programming contest. There are $n$ problems in the contest. Mishka's proble... | [{"input": "100 90\n90 90 90 90 90 90 55 21 90 90 90 90 90 90 90 90 90 90 69 83 90 90 90 90 90 90 90 90 93 95 92 98 92 97 91 92 92 91 91 95 94 95 100 100 96 97 94 93 90 90 95 95 97 99 90 95 98 91 94 96 99 99 94 95 95 97 99 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 12 90 3 90 90 90 90 90 90 90... | code_stdio |
[
{
"content": "You are an expert Python programmer. 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 string s. Your task is to determine if the given string s contains two non-overlapping substrin... | [{"input": "AABBBACBBBBBBAACBCCACBBAABBBBBCAACABAACABCACCBCBCCCBCBCABCBBCCBCBBAACBACAABACBBCACCBCCACCABBCBABBAAC\n", "output": "YES\n"}, {"input": "AABBBACBBBBBBAACBCCACBBAABBBBBCAACABAACABCACCBCBCCCBCBCABCBBCCBCBBAACBACAABACBBCACCBCCACCABBCBABBAAC\n", "output": "YES\n"}, {"input": "CAABBABCBBACCACCBCCACBBCABAACABCAABB... | code_stdio |
[
{
"content": "You are an expert Python programmer. 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 King of Flatland will organize a knights' tournament! The winner will get half the kingdom and the favor ... | [{"input": "847094637 -152905363 -1000000000 -1000000000\n", "output": "FIRST\n-152905363\n"}, {"input": "-1000000000 1000000000 1230987 17135570\n", "output": "FIRST\n-983588156\n"}, {"input": "547686188 61562151 -496372503 -115242932\n", "output": "FIRST\n61562151\n"}, {"input": "-1000000000 1000000000 1230987 987123... | code_stdio |
[
{
"content": "You are an expert Python programmer. 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, ..., a_{n}. You can perform at most k operations. For each operation you ca... | [{"input": "5 10 8\n1000000000 1000000000 1000000000 1000000000 1000000000\n", "output": "1073741825000000000\n"}, {"input": "5 10 8\n1000000000 1000000000 1000000000 1000000000 1000000000\n", "output": "1073741825000000000\n"}, {"input": "5 10 8\n1000000000 1010000000 1000000000 1000000000 1000000000\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\nSpace Coconut Crab\n\nSpace coconut crab\n\nEnglish text is not available in this practice contest.\n\nKen Ma... | [{"input": "1\n2\n4\n48\n266\n1236\n0", "output": "1\n2\n2\n12\n14\n36\n"}, {"input": "1\n2\n4\n48\n266\n1300\n0", "output": "1\n2\n2\n12\n14\n38\n"}, {"input": "1\n2\n4\n27\n557\n1250\n0", "output": "1\n2\n2\n3\n23\n44\n"}, {"input": "1\n2\n4\n27\n266\n1250\n0", "output": "1\n2\n2\n3\n14\n44\n"}, {"input": "1\n2\n4\n2... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nYou are given a tree (connected graph without cycles) consisting of $n$ vertices. The tree is unrooted — it i... | [{"input": "4\n8 10\n1 2\n1 5\n7 6\n6 8\n3 1\n8 4\n7 1\n10 1\n1 2\n1 10\n2 3\n1 5\n1 6\n2 4\n7 10\n10 9\n8 10\n7 2\n3 1\n1 5\n4 6\n7 4\n1 2\n1 4\n5 1\n1 4\n2 1\n4 3\n5 3\n", "output": "0\n9\n3\n4\n"}, {"input": "4\n8 10\n1 2\n1 5\n7 6\n6 8\n3 1\n8 4\n4 1\n10 3\n1 2\n1 10\n2 3\n1 5\n1 6\n2 4\n7 10\n10 9\n8 10\n7 2\n3 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\nAlex doesn't like boredom. That's why whenever he gets bored, he comes up with games. One long winter evening... | [{"input": "100\n4 8 10 1 8 8 8 1 10 3 1 8 6 8 6 1 10 3 3 3 3 7 2 1 1 6 10 1 7 9 8 10 3 8 6 2 1 6 5 6 10 8 9 7 4 3 10 5 3 9 10 5 10 8 8 5 7 8 9 5 3 18 9 2 7 8 2 10 4 9 2 8 10 10 5 8 5 1 7 3 4 5 2 2 9 3 2 5 6 2 3 10 1 5 9 6 10 4 10 8\n", "output": "392\n"}, {"input": "100\n4 8 10 1 8 8 8 1 10 3 1 8 6 8 6 1 10 3 3 3 3 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\nMany computer strategy games require building cities, recruiting army, conquering tribes, collecting resource... | [{"input": "10\n-260530833 169589238\n-681955770 -35391010\n223450511 24504262\n479795061 -26191863\n-291344265 21153856\n714700263 -328447419\n-858655942 161086142\n-270884153 462537328\n-501424901 977460517\n115284904 -151626824\n", "output": "2475449747812002025\n"}, {"input": "10\n-260530833 169589238\n-681955770 -... | code_stdio |
[
{
"content": "You are an expert Python programmer. 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 $a$ of length $n$. For every positive integer $x$ you are going to perform the following op... | [{"input": "6\n3\n1000000000 -1 -1000000000\n1\n6\n2\n-1000000000 1000000000\n2\n1000000000 -1000000000\n2\n1000000000 1000000000\n2\n-1000000000 -1000000000\n", "output": "31\n0\n0\n31\n0\n0\n"}, {"input": "6\n3\n1000000000 0 -1000000000\n1\n6\n2\n-1000000000 1000000000\n2\n1000000000 -1000000000\n2\n1000000000 100000... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n```if-not:ruby\nCreate a function, that accepts an arbitrary number of arrays and returns a single array gene... | [{"input": "[null]\n[null, null]\n[null, null, null]", "output": "[[null, null, null, null, null, null, null, null, null]]", "fn_name": "interleave"}, {"input": "[1, 2, 3]\n[4, 5, 6]\n[7, 8, 9]", "output": "[[1, 4, 7, 2, 5, 8, 3, 6, 9]]", "fn_name": "interleave"}, {"input": "[1, 2, 3]\n[\"c\", \"d\", \"e\"]", "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\nThe Little Elephant enjoys recursive functions.\n\nThis time he enjoys the sorting function. Let a is a permu... | [{"input": "1001\n", "output": "1001 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 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 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\nA group of n merry programmers celebrate Robert Floyd's birthday. Polucarpus has got an honourable task of po... | [{"input": "100 100\n100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nFind the number of palindromic numbers among the integers between A and B (inclusive).\nHere, a palindromic n... | [{"input": "31415 92653\n", "output": "612\n"}, {"input": "31415 97709", "output": "662\n"}, {"input": "53417 77120", "output": "237\n"}, {"input": "44323 77120", "output": "328\n"}, {"input": "44323 83416", "output": "391\n"}, {"input": "15858 40262", "output": "244\n"}, {"input": "31406 46102", "output": "147\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\nWhile Mike was walking in the subway, all the stuff in his back-bag dropped on the ground. There were several... | [{"input": "uqurdorwgtukbijpzhrpqoazllayzteqmeqhbgwvrgsiegiaaujtnxlzmihqyefraxpgywiauawpexgpazhqblryvremznotyklfiernvusugwlupadltrsbfvezbdbbyeetmwlkblwnidxchmwtzmrwdvlddwzbeswwpkizbqaghtrvalqickozbwfsqbcfjlbgttptlsqitjufjhsnjndvihtcdgsgntlqnzzeqcrmuxmrixmzreysejvrudqurnorhrlseammogstjseshstzxxtfwoajerafngpaalvkpxfimldy... | code_stdio |
[
{
"content": "You are an expert Python programmer. 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 likes everything infinite. Now he is studying the properties of a sequence s, such that its first eleme... | [{"input": "-1000000000 1000000000 1000000000\n", "output": "YES\n"}, {"input": "-1000000000 1000000000 1000000000\n", "output": "YES\n"}, {"input": "-1000000000 1001000000 1000000000\n", "output": "NO\n"}, {"input": "119057893 -516914539 -39748277\n", "output": "YES\n"}, {"input": "479823846 -403424770 -653472589\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\nDr .: Peter. I did.\n\nPeter: See you again? What kind of silly invention is this time?\n\nDr .: You invented... | [{"input": "1\n0 1 0 0 0 0 0 0 0 0\n1 1 1 0 0 0 0 0 0 0\n0 1 0 0 0 0 0 0 0 0\n0 0 0 0 0 1 0 0 0 0\n0 0 0 1 0 0 1 0 0 0\n0 0 0 0 1 1 0 0 0 0\n0 0 0 0 0 0 0 0 0 0\n0 0 0 0 0 0 0 0 1 0\n0 0 0 0 0 0 0 1 1 1\n0 0 0 0 0 0 0 0 1 0", "output": "0 0 0 0 1 0 1 0 0 0\n0 1 0 1 1 0 1 1 0 0\n0 0 1 0 1 0 1 0 1 0\n0 1 1 1 0 0 0 1 1 1\... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nGiven is a positive integer N.\n\nFind the number of pairs (A, B) of positive integers not greater than N tha... | [{"input": "200000\n", "output": "400000008\n"}, {"input": "199972\n", "output": "399904458\n"}, {"input": "199912\n", "output": "399664518\n"}, {"input": "199903\n", "output": "399626757\n"}, {"input": "199927\n", "output": "399715613\n"}, {"input": "199916\n", "output": "399673406\n"}, {"input": "141750", "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\nYou are given two strings $a$ and $b$ consisting of lowercase English letters, both of length $n$. The charac... | [{"input": "7\nabacaba\nbacabaa\n", "output": "4\n"}, {"input": "7\nabacaba\naabacab\n", "output": "4\n"}, {"input": "7\nabacaaa\naabacab\n", "output": "5\n"}, {"input": "7\nabacaaa\naabacaa\n", "output": "4\n"}, {"input": "7\naaacaaa\naabacaa\n", "output": "3\n"}, {"input": "7\naaacaaa\naaaacaa\n", "output": "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\nYou are given a tree that consists of $n$ nodes. You should label each of its $n-1$ edges with an integer in ... | [{"input": "4\n3\n3 1\n2 1\n4\n22861 20707 59627 9293\n3\n3 1\n1 2\n6\n15767 40973 20807 24419 46439 62816\n3\n3 2\n1 2\n6\n31575 54493 10799 37529 59743 30529\n3\n3 1\n2 1\n1\n51618\n", "output": "783349080\n372565328\n603348715\n103238\n"}, {"input": "4\n3\n3 1\n2 1\n4\n22861 20707 59627 9293\n3\n3 1\n1 2\n6\n15767 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\nYelisey has an array $a$ of $n$ integers.\n\nIf $a$ has length strictly greater than $1$, then Yelisei can ap... | [{"input": "8\n1\n10\n2\n0 0\n3\n-1 2 -1\n4\n2 18 1 -1\n2\n3 6\n5\n3 2 -4 -2 0\n2\n-1 -1\n1\n-2\n", "output": "10\n0\n3\n16\n3\n2\n0\n-2\n"}, {"input": "8\n1\n10\n2\n1 0\n3\n-1 2 -1\n4\n2 18 1 -1\n2\n3 6\n5\n3 2 -4 -2 0\n2\n-1 -1\n1\n-2\n", "output": "10\n1\n3\n16\n3\n2\n0\n-2\n"}, {"input": "8\n1\n10\n2\n1 0\n3\n-1 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 only difference between easy and hard versions is constraints.\n\nThe BerTV channel every day broadcasts ... | [{"input": "30\n4 4 1\n3 3 1 2\n4 4 1\n4 1 4 1\n1 1 1\n1\n3 2 1\n2 1 2\n4 4 2\n3 2 2 2\n4 2 4\n1 2 2 2\n1 4 1\n4\n2 3 1\n2 3\n2 2 1\n2 2\n4 4 2\n1 2 4 2\n4 4 1\n2 4 4 3\n4 3 1\n1 3 1 3\n1 1 1\n1\n2 2 2\n2 1\n2 4 1\n1 4\n2 4 1\n3 4\n1 2 1\n1\n2 4 2\n2 1\n3 1 2\n1 1 1\n2 4 1\n1 4\n2 3 1\n3 3\n4 2 2\n2 1 2 2\n3 2 2\n2 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\n# Background\n\nMy TV remote control has arrow buttons and an `OK` button.\n\nI can use these to move a \"cur... | [{"input": "\"The Quick Brown Fox Jumps Over A Lazy Dog.\"", "output": "[306]", "fn_name": "tv_remote"}, {"input": "\"Pack My Box With Five Dozen Liquor Jugs.\"", "output": "[290]", "fn_name": "tv_remote"}, {"input": "\" x X \"", "output": "[34]", "fn_name": "tv_remote"}, {"input": "\"MISSISSIPPI\"", "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\nWrite a function named sumDigits which takes a number as input and returns the sum of the absolute value of e... | [{"input": "1234567890", "output": "[45]", "fn_name": "sum_digits"}, {"input": "800000009", "output": "[17]", "fn_name": "sum_digits"}, {"input": "100000002", "output": "[3]", "fn_name": "sum_digits"}, {"input": "666", "output": "[18]", "fn_name": "sum_digits"}, {"input": "99", "output": "[18]", "fn_name": "sum_digits"... | 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\nCreate a function that accepts 3 inputs, a string, a starting location, and a length. The function needs to ... | [{"input": "\"1x2x3x4x\"\n-1532\n-100", "output": "[\"x2x3x4x1x2x3x4x1x2x3x4x1x2x3x4x1x2x3x4x1x2x3x4x1x2x3x4x1x2x3x4x1x2x3x4x1x2x3x4x1x2x3x4x1x2x3x4x1x2x3\"]", "fn_name": "endless_string"}, {"input": "\"1x2x3x4x\"\n1532\n100", "output": "[\"3x4x1x2x3x4x1x2x3x4x1x2x3x4x1x2x3x4x1x2x3x4x1x2x3x4x1x2x3x4x1x2x3x4x1x2x3x4x1x2... | 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're continuing to enjoy your new piano, as described in Piano Kata, Part 1. You're also continuing the exe... | [{"input": "100", "output": "[\"G#\"]", "fn_name": "which_note"}, {"input": "200", "output": "[\"G#\"]", "fn_name": "which_note"}, {"input": "2017", "output": "[\"F\"]", "fn_name": "which_note"}, {"input": "12", "output": "[\"G#\"]", "fn_name": "which_note"}, {"input": "111", "output": "[\"G\"]", "fn_name": "which_note... | 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\nMaxim loves to fill in a matrix in a special manner. Here is a pseudocode of filling in a matrix of size (m +... | [{"input": "1000000000000 1048576\n", "output": "118606527258\n"}, {"input": "1000000000000 1048576\n", "output": "118606527258\n"}, {"input": "1000000000000 1048576\n", "output": "118606527258\n"}, {"input": "987654321987 1048576\n", "output": "116961880791\n"}, {"input": "987654321987 1048576\n", "output": "116961880... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nDreamoon has a string s and a pattern string p. He first removes exactly x characters from s obtaining string... | [{"input": "a\nbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb... | code_stdio |
[
{
"content": "You are an expert Python programmer. 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 magic number is a number formed by concatenation of numbers 1, 14 and 144. We can use each of these numbers... | [{"input": "1000000000\n", "output": "NO\n"}, {"input": "144144144\n", "output": "YES\n"}, {"input": "141414141\n", "output": "YES\n"}, {"input": "114114144\n", "output": "YES\n"}, {"input": "111111111\n", "output": "YES\n"}, {"input": "141441441\n", "output": "YES\n"}, {"input": "141414144\n", "output": "YES\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\nJack and Jill are playing a game. They have balls numbered from `0` to `n - 1`. Jack looks the other way and ... | [{"input": "20\n10", "output": "[18]", "fn_name": "solve"}, {"input": "20\n8", "output": "[17]", "fn_name": "solve"}, {"input": "20\n9", "output": "[19]", "fn_name": "solve"}, {"input": "4\n1", "output": "[3]", "fn_name": "solve"}, {"input": "4\n2", "output": "[2]", "fn_name": "solve"}, {"input": "4\n3", "output": "[0]... | code_functional |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nWe have a large square grid with H rows and W columns. Iroha is now standing in the top-left cell. She will r... | [{"input": "100000 100000 99999 72298", "output": "471980925\n"}, {"input": "100000 100000 43938 55555", "output": "265769345\n"}, {"input": "100000 100000 99999 39553", "output": "199584029\n"}, {"input": "100000 100000 43938 63714", "output": "333427460\n"}, {"input": "100000 100000 99999 39975", "output": "868453532... | code_stdio |
[
{
"content": "You are an expert Python programmer. 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 smashes potato in a vertical food processor. At each moment of time the height of the potato in the pro... | [{"input": "25 1000000000 1\n1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000\n", "output": "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\nUjan has been lazy lately, but now has decided to bring his yard to good shape. First, he decided to paint th... | [{"input": "930881829259\n", "output": "930881829259\n"}, {"input": "974059904437\n", "output": "974059904437\n"}, {"input": "963201794869\n", "output": "963201794869\n"}, {"input": "912943012301\n", "output": "912943012301\n"}, {"input": "490918125179\n", "output": "490918125179\n"}, {"input": "902076349729\n", "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\n<image>\n\nOne morning the Cereal Guy found out that all his cereal flakes were gone. He found a note instead... | [{"input": "459 16\nTo the right of 15\nTo the right of 148\nTo the left of 406\nTo the left of 335\nTo the right of 240\nTo the left of 409\nTo the left of 365\nTo the left of 426\nTo the left of 416\nTo the right of 247\nTo the left of 284\nTo the right of 187\nTo the right of 134\nTo the right of 128\nTo the right 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 of natural integers from 1 to N, inclusive. Initially, the permutation is 1, 2, 3... | [{"input": "2\n7 1\n5 0 4 7 -1 5 12\n0 2\n2 1\n4 6\n1 3\n11 2\n0 2 2 8\n2 6\n2 3", "output": "Impossible\nImpossible\n"}, {"input": "2\n7 1\n5 0 4 7 -1 5 12\n0 2\n2 1\n4 6\n1 3\n11 2\n0 2 2 8\n2 6\n1 3", "output": "Impossible\nImpossible\n"}, {"input": "2\n7 1\n5 0 4 7 -1 5 12\n0 2\n2 1\n4 6\n1 3\n11 2\n0 2 2 8\n2 6\n0... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nThe Bitlandians are quite weird people. They have very peculiar customs.\n\nAs is customary, Uncle J. wants t... | [{"input": "10\n2 658\n5 29\n2 558\n1 1275\n2 1177\n1 1033\n1 247\n-1 4605\n0 1170\n-1 999\n", "output": "AAAAAAAAAA\n"}, {"input": "10\n2 658\n5 66\n2 784\n1 1275\n2 1177\n1 999\n1 247\n-1 4605\n0 1170\n-1 999\n", "output": "AAAAAAAAAA\n"}, {"input": "10\n2 658\n5 66\n2 460\n1 1275\n2 1177\n1 999\n1 247\n-1 4605\n0 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\n# Task\n\nYour task is to write a function for calculating the score of a 10 pin bowling game. The input for ... | [{"input": "[9, 1, 9, 1, 9, 1, 9, 1, 9, 1, 9, 1, 9, 1, 9, 1, 9, 1, 9, 1, 9]", "output": "[190]", "fn_name": "bowling_score"}, {"input": "[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 1, 0]", "output": "[11]", "fn_name": "bowling_score"}, {"input": "[1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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\n# Story\n\nDue to lack of maintenance the minute-hand has fallen off Town Hall clock face.\n\nAnd because the... | [{"input": "360", "output": "[\"12:00\"]", "fn_name": "what_time_is_it"}, {"input": "180", "output": "[\"06:00\"]", "fn_name": "what_time_is_it"}, {"input": "270", "output": "[\"09:00\"]", "fn_name": "what_time_is_it"}, {"input": "90", "output": "[\"03:00\"]", "fn_name": "what_time_is_it"}, {"input": "30", "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 are given a permutation $p_1, p_2, \\dots, p_n$. Recall that sequence of $n$ integers is called a permuta... | [{"input": "3\n4\n2 1 4 3\n6\n4 12 1 2 5 3\n5\n5 7 1 2 4\n", "output": "YES\n2 3 4\nYES\n1 2 3\nYES\n1 2 3\n"}, {"input": "3\n4\n2 1 4 3\n6\n4 12 1 2 5 3\n5\n5 8 1 2 4\n", "output": "YES\n2 3 4\nYES\n1 2 3\nYES\n1 2 3\n"}, {"input": "3\n4\n2 1 4 3\n6\n4 10 1 2 5 3\n5\n5 3 1 2 4\n", "output": "YES\n2 3 4\nYES\n1 2 3\nNO... | code_stdio |
[
{
"content": "You are an expert Python programmer. 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 rearranges an integer into its largest possible value. \n\n```python\nsuper_size(123456... | [{"input": "700000000001", "output": "[710000000000]", "fn_name": "super_size"}, {"input": "123456789", "output": "[987654321]", "fn_name": "super_size"}, {"input": "608719", "output": "[987610]", "fn_name": "super_size"}, {"input": "666666", "output": "[666666]", "fn_name": "super_size"}, {"input": "2017", "output": "... | code_functional |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.