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\nYou have an array $a_1, a_2, \\dots, a_n$. \n\nLet's call some subarray $a_l, a_{l + 1}, \\dots , a_r$ of thi... | [{"input": "99\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\n", "output": "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\nJzzhu is the president of country A. There are n cities numbered from 1 to n in his country. City 1 is the ca... | [{"input": "3 3 6\n1 2 499999999\n2 3 500000000\n1 3 948187054\n2 499999999\n2 500000000\n2 499999999\n3 999999999\n3 1000000000\n3 1000000000\n", "output": "6\n"}, {"input": "3 3 6\n1 2 499999999\n2 3 500000000\n1 2 999999999\n2 499999999\n2 500000000\n2 499999999\n3 999999999\n3 1000000000\n3 1000000000\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\nIn some country there are exactly n cities and m bidirectional roads connecting the cities. Cities are number... | [{"input": "10 11\n1 3\n2 3\n3 8\n4 5\n4 6\n3 7\n3 8\n4 9\n4 10\n7 9\n8 10\n1 5 3\n6 2 3\n", "output": "-1\n"}, {"input": "10 11\n1 3\n2 3\n3 4\n4 5\n4 6\n3 7\n3 8\n4 9\n4 10\n7 9\n8 10\n1 5 3\n6 2 3\n", "output": "6\n"}, {"input": "9 9\n1 2\n2 3\n2 4\n4 5\n5 7\n5 6\n4 8\n8 9\n9 6\n1 7 4\n3 6 3\n", "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\nGiven a set of $N$ axis-aligned rectangular seals, find the number of overlapped seals on the region which ha... | [{"input": "3\n0 0 1 2\n0 0 2 2\n0 0 2 2", "output": "3\n"}, {"input": "3\n0 0 2 4\n0 0 2 2\n0 0 2 2", "output": "3\n"}, {"input": "3\n0 0 1 2\n0 0 2 3\n0 0 2 2", "output": "3\n"}, {"input": "3\n0 1 2 4\n0 0 2 2\n0 0 2 2", "output": "3\n"}, {"input": "3\n0 0 1 2\n0 0 2 6\n0 0 2 2", "output": "3\n"}, {"input": "3\n0 0 0... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nIt is 2050 and romance has long gone, relationships exist solely for practicality.\n\nMatchMyHusband is a web... | [{"input": "[15, 24, 12]\n4", "output": "[\"No match!\"]", "fn_name": "match"}, {"input": "[11, 25, 36]\n1", "output": "[\"No match!\"]", "fn_name": "match"}, {"input": "[17, 31, 21]\n2", "output": "[\"No match!\"]", "fn_name": "match"}, {"input": "[35, 35, 29]\n0", "output": "[\"No match!\"]", "fn_name": "match"}, {"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\nPolycarpus works as a DJ in the best Berland nightclub, and he often uses dubstep music in his performance. R... | [{"input": "\"WUBWUBWUBWUBWUBWUBWUBWUBWUBWUBWUBWUBWUBWUBWUBWUBWUBWUBWUBWUBWUBWUBWUBWUBWUBWUBWUBWUBWUBWUABWUBWUBWUBWUBWUBWUBWUBWUBWUBWUBWUBWUBWUBWUBWUBWUBWUBWUBWUBWUBWUBWUBWUBWUBWUBWUBWUB\"", "output": "[\"WUAB\"]", "fn_name": "song_decoder"}, {"input": "\"WUBYYRTSMNWUWUBWUBWUBCWUBWUBWUBCWUBWUBWUBFSYUINDWOBVWUBWUBWUBFWU... | 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 final round of Bayan Programming Contest will be held in Tehran, and the participants will be carried aro... | [{"input": "001\n", "output": "+------------------------+\n|O.#.#.#.#.#.#.#.#.#.#.|D|)\n|#.#.#.#.#.#.#.#.#.#.#.|.|\n|#.......................|\n|#.#.#.#.#.#.#.#.#.#.#.|.|)\n+------------------------+\n"}, {"input": "011\n", "output": "+------------------------+\n|O.O.O.O.#.#.#.#.#.#.#.|D|)\n|O.O.O.#.#.#.#.#.#.#.#.|.|\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\nConsider an infinite triangle made up of layers. Let's number the layers, starting from one, from the top of ... | [{"input": "4\n3\n1 10 2\n1 3 1\n2\n4 7\n2 2\n2\n1 1000000000\n1 1000000000\n4\n3 18 5 8\n2 4 2 4\n", "output": "3\n2\n999999999\n7\n"}, {"input": "4\n3\n1 10 2\n1 3 1\n2\n3 2\n2 2\n2\n1 1000000000\n1 1000000000\n4\n3 18 5 9\n2 4 2 4\n", "output": "3\n1\n999999999\n7\n"}, {"input": "4\n3\n1 10 2\n1 3 1\n2\n5 7\n2 2\n2\... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nTakahashi Lake has a perimeter of L. On the circumference of the lake, there is a residence of the lake's own... | [{"input": "314159265 7\n35438742\n77271666\n139044510\n156626166\n160332356\n331169608\n453863319", "output": "1023255587\n"}, {"input": "314159265 7\n35438742\n77271666\n122238627\n156626166\n160332356\n331169608\n453863319", "output": "1040061470\n"}, {"input": "314159265 7\n21662711\n77271666\n89022761\n156626166\n... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nRecently Vasya learned that, given two points with different x coordinates, you can draw through them exactly... | [{"input": "5\n1 0\n1 -1\n0 -1\n-1 0\n-1 -1\n", "output": "1\n"}, {"input": "1\n-751115 -16747294\n", "output": "0\n"}, {"input": "1\n-751115 -11499666\n", "output": "0\n"}, {"input": "1\n-751115 -14990265\n", "output": "0\n"}, {"input": "1\n-867280 -14990265\n", "output": "0\n"}, {"input": "1\n-867280 -20447796\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 string $s$. You have to reverse it — that is, the first letter should become equal to the las... | [{"input": "500\npqmpmpqmppqqmmmqppqmpqqmmmppmmqmqmqpqmmpmmpmqpmqpppmppmqqmmmpmqqqppqpmpqpmppppqqqqpmppqppqpqmpmpmqqmmpmqmmpqqmqpmqpmpmqpmpmmqppmqmpqmmmmmmpmmqmmqmmqqmmqqpmppqmppmpppmmmmppmmpqqqqmppqqqqqmpqpmpqmmpqmqpqpmmqqqqpmqqqppmmppmppppppmmpmqpmqmpmqmmpqqmqqmpqppqpmqqmpqqmpmmmpqmqmqmpqmpppqqmqmpmqmmpqmpqqmmqqpqpqm... | code_stdio |
[
{
"content": "You are an expert Python programmer. 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# Valid HK Phone Number\n\n## Overview\n\nIn Hong Kong, a valid phone number has the format ```xxxx xxxx``` w... | [{"input": "\" 1234 5678 \"", "output": "[false]", "fn_name": "is_valid_HK_phone_number"}, {"input": "\"sklfjsdklfjsf\"", "output": "[false]", "fn_name": "is_valid_HK_phone_number"}, {"input": "\"3857 4756\"", "output": "[false]", "fn_name": "is_valid_HK_phone_number"}, {"input": "\"abcd efgh\"", "output": "[fal... | 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```if-not:sql\nCreate a function (or write a script in Shell) that takes an integer as an argument and return... | [{"input": "1545452", "output": "[\"Even\"]", "fn_name": "even_or_odd"}, {"input": "74156741", "output": "[\"Odd\"]", "fn_name": "even_or_odd"}, {"input": "100000", "output": "[\"Even\"]", "fn_name": "even_or_odd"}, {"input": "-456", "output": "[\"Even\"]", "fn_name": "even_or_odd"}, {"input": "-123", "output": "[\"Odd... | 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\nProfessor GukiZ likes programming contests. He especially likes to rate his students on the contests he prepa... | [{"input": "70\n11 54 37 62 1 46 13 17 38 47 28 29 63 5 61 34 49 66 32 59 3 41 58 28 23 62 41 64 20 5 14 41 10 37 51 32 65 46 61 8 15 19 16 44 31 42 19 46 66 25 26 58 60 5 19 18 69 53 20 40 45 27 24 41 32 23 57 56 62 10\n", "output": "62 18 35 7 70 23 61 57 34 22 43 42 6 66 10 37 21 2 38 13 69 29 14 43 49 7 29 5 51 66 ... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nIn the final of CODE FESTIVAL in some year, there are N participants. The height and power of Participant i i... | [{"input": "10\n1 3\n8 4\n8 3\n10 1\n12 4\n2 3\n4 2\n9 2\n8 3\n0 1", "output": "6\n"}, {"input": "10\n1 3\n0 4\n15 3\n10 1\n8 4\n2 3\n4 2\n9 1\n8 3\n0 1", "output": "7\n"}, {"input": "10\n2 3\n0 4\n15 3\n10 1\n8 4\n2 1\n4 2\n9 1\n8 0\n0 1", "output": "8\n"}, {"input": "10\n2 3\n0 0\n15 3\n10 1\n8 4\n2 1\n4 2\n9 1\n8 0\... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nIn this Kata, you will be given a multi-dimensional array containing `2 or more` sub-arrays of integers. Your... | [{"input": "[[-2, -15, -12, -8, -16], [-4, -15, -7], [-10, -5]]", "output": "[-40]", "fn_name": "solve"}, {"input": "[[-11, -6], [-20, -20], [18, -4], [-20, 1]]", "output": "[17600]", "fn_name": "solve"}, {"input": "[[14, 2], [0, -16], [-12, -16]]", "output": "[3584]", "fn_name": "solve"}, {"input": "[[-1, 2, -3, 4], [... | 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 program which reads the two dices constructed in the same way as Dice I, and determines whether these... | [{"input": "-2 2 -3 -1 461 1\n3 0 4 0 13 -1", "output": "No\n"}, {"input": "-1 2 -3 -1 461 1\n3 0 4 0 13 -1", "output": "No\n"}, {"input": "-1 2 -3 -1 461 1\n3 0 6 0 13 -1", "output": "No\n"}, {"input": "-1 2 -3 -1 461 2\n3 0 6 0 13 -1", "output": "No\n"}, {"input": "0 1 0 -1 197 -1\n10 0 1 1 16 4", "output": "No\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\nEasy and hard versions are actually different problems, so read statements of both problems completely and ca... | [{"input": "27 5 1\n232 0 1\n72 0 1\n235 0 1\n2 0 1\n158 0 -1\n267 0 0\n242 1 1\n1 0 0\n64 0 0\n139 1 1\n250 0 1\n208 0 1\n127 0 1\n29 0 0\n53 0 1\n100 0 1\n52 0 1\n229 0 0\n1 0 1\n29 0 0\n17 0 1\n74 0 1\n211 0 1\n248 0 1\n15 0 0\n252 0 0\n159 0 1\n", "output": "-1\n"}, {"input": "27 5 1\n232 0 1\n72 0 1\n235 0 1\n2 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\nA wildlife study involving ducks is taking place in North America. Researchers are visiting some wetlands in ... | [{"input": "[\"King Eider 20\", \"King Eider 2\", \"Lesser Scaup 25\", \"Masked Duck 2\", \"Mottled Duck 10\", \"Muscovy Duck 1\", \"Northern Pintail 3\", \"Northern Shoveler 30\"]", "output": "[[\"KINEID\", 22, \"LESSCA\", 25, \"MASDUC\", 2, \"MOTDUC\", 10, \"MUSDUC\", 1, \"NORPIN\", 3, \"NORSHO\", 30]]", "fn_name": "... | code_functional |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nPolycarp has a checkered sheet of paper of size n × m. Polycarp painted some of cells with black, the others ... | [{"input": "20 10\nWWBWWWBBWW\nWWWWWBWWWW\nWWWWWWWWWW\nWWWWWWWWWW\nWWWBBBWWWW\nWWWWWWWWWW\nWWWWWWWWWW\nWWWWWWWWWW\nWBWWWWWBWW\nWBWWBWWWBW\nWWBWBWWWWW\nWWWBWWBBWW\nWWBBWBWBWW\nBBWWWWWBWW\nWWBWWBBBWW\nWWWBWBBWWW\nWWWBBWBWWW\nWWWWWWWWWW\nWWWBWWWWWW\nWWWWWWWWWW\n", "output": "-1\n"}, {"input": "20 10\nWWWWWWWWWW\nWWWWWWWWW... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nAmr bought a new video game \"Guess Your Way Out!\". The goal of the game is to find an exit from the maze th... | [{"input": "50 1125899906842624\n", "output": "2251799813685246\n"}, {"input": "50 1125899906842624\n", "output": "2251799813685246"}, {"input": "50 905353992267944\n", "output": "1871650493613618\n"}, {"input": "50 844424930131968\n", "output": "1407374883553280\n"}, {"input": "50 865276010242491\n", "output": "190973... | code_stdio |
[
{
"content": "You are an expert Python programmer. 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 card game called Splay the Sire. Currently you are struggling to defeat the final ... | [{"input": "5\n3\n1 1\n1 1\n1 1\n3\n1 1\n1 1\n1 1\n3\n1 1\n1 1\n1 1\n3\n1 1\n1 1\n1 1\n3\n1 100\n1 1\n1 1\n", "output": "211\n"}, {"input": "5\n3\n1 1\n1 1\n1 1\n3\n1 1\n1 1\n1 1\n3\n1 1\n1 1\n1 1\n3\n1 1\n1 1\n1 1\n3\n1 100\n1 1\n1 1\n", "output": "211\n"}, {"input": "5\n3\n1 1\n1 1\n1 1\n3\n1 1\n1 1\n1 1\n3\n1 1\n1 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 triangle of consecutive odd numbers:\n\n```\n 1\n 3 5\n 7 9 11\... | [{"input": "93", "output": "[[8557, 8559, 8561, 8563, 8565, 8567, 8569, 8571, 8573, 8575, 8577, 8579, 8581, 8583, 8585, 8587, 8589, 8591, 8593, 8595, 8597, 8599, 8601, 8603, 8605, 8607, 8609, 8611, 8613, 8615, 8617, 8619, 8621, 8623, 8625, 8627, 8629, 8631, 8633, 8635, 8637, 8639, 8641, 8643, 8645, 8647, 8649, 8651, 86... | 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\nSereja is a coder and he likes to take part in Codesorfes rounds. However, Uzhland doesn't have good internet... | [{"input": "1122 54\n2 1031\n1 363 364\n1 14 15\n1 902 903\n1 1052 1053\n2 170\n2 36\n2 194\n1 340 341\n1 1018 1019\n1 670 671\n1 558 559\n2 431\n2 351\n2 201\n1 1104 1105\n2 1056\n2 823\n1 274 275\n2 980\n1 542 543\n1 807 808\n2 157\n2 895\n1 505 506\n2 658\n1 484 485\n1 533 534\n1 384 385\n2 779\n2 888\n1 137 138\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\nThis problem is different from the hard version. In this version Ujan makes exactly one exchange. You can hac... | [{"input": "10\n11\nartiovnldnp\nartiovsldsp\n2\naa\nzz\n2\naa\nxy\n2\nab\nba\n2\nza\nzz\n3\nabc\nbca\n16\naajjhdsjfdsfkadf\naajjhjsjfdsfkajf\n2\nix\nii\n2\noo\nqo\n2\npp\npa\n", "output": "Yes\nYes\nNo\nNo\nNo\nNo\nYes\nNo\nNo\nNo\n"}, {"input": "10\n11\nartiovnldnp\nartiovsldsp\n2\naa\nzz\n2\naa\nxy\n2\nab\nba\n2\nza... | code_stdio |
[
{
"content": "You are an expert Python programmer. 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, \\ldots, p_n$ of integers from $1$ to $n$ and an integer $k$, such tha... | [{"input": "100 77\n59 92 18 16 45 82 63 43 50 68 19 13 53 79 48 28 94 49 25 77 54 8 61 66 40 100 99 20 35 14 52 56 22 17 57 36 23 90 4 65 84 42 30 27 3 15 87 32 93 74 46 91 41 9 34 12 11 7 10 86 78 72 81 73 51 55 58 97 39 31 5 24 29 88 95 6 44 37 60 62 83 33 47 21 2 38 26 98 71 75 96 70 76 69 64 89 67 1 80 85\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\nDima and Seryozha live in an ordinary dormitory room for two. One day Dima had a date with his girl and he as... | [{"input": "50\n384672 661179 -775591 -989608 611120 442691 601796 502406 384323 -315945 -934146 873993 -156910 -94123 -930137 208544 816236 466922 473696 463604 794454 -872433 -149791 -858684 -467655 -555239 623978 -217138 -408658 493342 -733576 -350871 711210 884148 -426172 519986 -356885 527171 661680 977247 141654 ... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nNatasha's favourite numbers are $n$ and $1$, and Sasha's favourite numbers are $m$ and $-1$. One day Natasha ... | [{"input": "2000 2000\n", "output": "674532367\n"}, {"input": "1134 1092\n", "output": "134680101\n"}, {"input": "1087 1050\n", "output": "973930225\n"}, {"input": "1994 1981\n", "output": "596939902\n"}, {"input": "1891 1294\n", "output": "696966158\n"}, {"input": "1132 1727\n", "output": "878164775\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 should write a simple function that takes string as input and checks if it is a valid Russian postal code... | [{"input": "\"\\n245980\"", "output": "[false]", "fn_name": "zipvalidate"}, {"input": "\"245980\\n\"", "output": "[false]", "fn_name": "zipvalidate"}, {"input": "\" 310587 \"", "output": "[false]", "fn_name": "zipvalidate"}, {"input": "\"1111111\"", "output": "[false]", "fn_name": "zipvalidate"}, {"input": "\"245980a\"... | 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\nWelcome to Innopolis city. Throughout the whole year, Innopolis citizens suffer from everlasting city constru... | [{"input": "100\n1777 339 1249 1644 785 810 228 549 1892 464 1067 639 65 1653 981 1858 863 1980 1174 427 1710 345 309 826 31 1898 255 661 1836 443 802 195 177 752 979 1842 1689 399 568 1906 129 1571 1263 696 911 810 1877 1932 1389 1128 112 619 184 434 22 1269 386 324 1635 1440 705 300 455 1635 1069 1660 1174 572 1237 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\nWe call a string good, if after merging all the consecutive equal characters, the resulting string is palindr... | [{"input": "bbabaaabaaaabaabbababbbabababaabaaaaabbaabbbbbaababaabbbaabaabaaaababaabaabbabaaabaabbbabbaaaaaaabaabababaaabaaabbbabbabbaabaaabaabbbbbabbababbbbbbbababbababbbabbbbbababaaaababaabbabaaabbaaabaabbbbabbaaababbbbbbaaabbaaabbaaabaaaaaababaabababaabaaabaaaabaabbabbabbbbabbaaabaabbaababaaabbbbbaabbbbabbbabaabaaab... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nMad scientist Mike is busy carrying out experiments in chemistry. Today he will attempt to join three atoms i... | [{"input": "1000000 1000000 1000000\n", "output": "500000 500000 500000\n"}, {"input": "1000000 1000000 1000000\n", "output": "500000 500000 500000\n"}, {"input": "688348 726472 442198\n", "output": "486311 240161 202037\n"}, {"input": "602752 645534 784262\n", "output": "232012 413522 370740\n"}, {"input": "602752 645... | code_stdio |
[
{
"content": "You are an expert Python programmer. 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 remote island chain contains n islands, labeled 1 through n. Bidirectional bridges connect the islands to f... | [{"input": "12\n0 1 2 3 4 5 6 7 8 9 10 11\n1 2 9 8 6 4 5 10 3 7 0 11\n1 2\n2 3\n3 4\n4 5\n4 6\n6 7\n3 8\n8 9\n9 10\n2 11\n11 12\n", "output": "NO\n"}, {"input": "12\n0 1 2 3 4 5 6 7 8 9 10 11\n1 2 9 8 6 4 5 10 3 7 0 11\n1 2\n2 3\n3 4\n4 5\n4 6\n6 7\n3 8\n8 9\n9 10\n8 11\n11 12\n", "output": "NO"}, {"input": "10\n2 7 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\nOne day Polycarpus got hold of two non-empty strings s and t, consisting of lowercase Latin letters. Polycarp... | [{"input": "pfdempfohomnpgbeegikfmflnalbbajpnpgeacaicoehopgnabnklheepnlnflohjegcciflmfjhachnhekckfjgoffhkblncidn\nidlhklpclcghngeggpjdgefccihndpoikojdjnbkdfjgaanoolfmnifnmbpeeghpicehjdiipnlfnjpglidpnnnjfmjfhbcogojkcfflmmfcgajbjbfaikhmjofbnjnaolbcdkelcieeodbfjcfiblhhmeelmpcmmcdhjcnnfklgedjjbaljndjonanlojclboeelkab\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\nMichael and Joe are playing a game. The game is played on a grid with $n$ rows and $m$ columns, filled with d... | [{"input": "18\n1 1\n-37\n1 2\n47 0\n1 2\n-48 -7\n2 1\n37\n-8\n2 1\n-3\n27\n2 2\n46 36\n-33 -9\n2 2\n-20 24\n-6 -33\n2 2\n-50 -45\n50 10\n2 2\n-38 -12\n1 8\n3 3\n42 4 -29\n-27 28 -16\n-35 -13 26\n3 3\n-46 40 -27\n-32 28 -24\n37 13 -13\n3 3\n-38 -17 30\n22 -50 7\n-26 18 -3\n3 3\n-2 26 29\n41 11 28\n-31 -16 1\n3 3\n-25 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\nDuring a recent research Berland scientists found out that there were n cities in Ancient Berland, joined by ... | [{"input": "183\n", "output": "8372\n1 92\n1 93\n1 94\n1 95\n1 96\n1 97\n1 98\n1 99\n1 100\n1 101\n1 102\n1 103\n1 104\n1 105\n1 106\n1 107\n1 108\n1 109\n1 110\n1 111\n1 112\n1 113\n1 114\n1 115\n1 116\n1 117\n1 118\n1 119\n1 120\n1 121\n1 122\n1 123\n1 124\n1 125\n1 126\n1 127\n1 128\n1 129\n1 130\n1 131\n1 132\n1 13... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nThor is getting used to the Earth. As a gift Loki gave him a smartphone. There are n applications on this pho... | [{"input": "10 85\n2 2\n1 10\n1 1\n2 6\n1 2\n1 4\n1 7\n2 1\n1 1\n3 3\n1 9\n1 6\n1 8\n1 10\n3 8\n2 8\n1 6\n1 3\n1 9\n1 6\n1 3\n1 8\n1 1\n1 6\n1 10\n2 1\n2 10\n1 10\n1 1\n1 10\n1 6\n2 2\n1 8\n1 3\n1 4\n1 9\n1 5\n1 5\n2 2\n2 4\n1 7\n1 1\n2 4\n2 9\n1 1\n1 7\n1 8\n3 14\n1 10\n2 2\n1 3\n1 10\n1 6\n3 32\n2 3\n1 5\n2 10\n2 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\nThe employees of the F company have lots of ways to entertain themselves. Today they invited a famous magicia... | [{"input": "100 50\n11 28\n11 1\n98 58\n38 27\n24 27\n67 37\n90 48\n91 14\n43 29\n3 64\n24 6\n53 19\n97 65\n13 27\n75 53\n37 82\n69 75\n94 99\n1 26\n95 60\n45 27\n100 82\n71 49\n86 99\n74 58\n88 68\n39 63\n38 23\n22 39\n29 58\n62 83\n62 1\n61 58\n2 30\n41 48\n83 90\n1 17\n73 81\n23 53\n71 16\n43 29\n27 78\n54 48\n6 89\... | code_stdio |
[
{
"content": "You are an expert Python programmer. 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 In your favorite game, you must shoot a target with a water-gun to gain points. Each target can be ... | [{"input": "[26, 54, 36, 35, 63, 58, 31, 80, 59, 61, 34, 54, 62, 73, 89, 7, 98, 91, 78]", "output": "[615]", "fn_name": "target_game"}, {"input": "[73, 80, 40, 86, 14, 96, 10, 56, 61, 84, 82, 36, 85]", "output": "[490]", "fn_name": "target_game"}, {"input": "[36, 42, 93, 29, 0, 33, 15, 84, 14, 24, 81, 11]", "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\nPolycarp has $x$ of red and $y$ of blue candies. Using them, he wants to make gift sets. Each gift set contai... | [{"input": "9\n10 12 1 5\n1 2 2 2\n52 109 13 53\n1000000000 1000000000 1 1\n1000100000 1 1 1000000000\n1 1000000000 1000000001 2\n1 2 1 1\n14 11 2 2\n4 1 2 5\n", "output": "3\n0\n2\n1000000000\n1\n0\n1\n5\n0\n"}, {"input": "9\n10 12 1 16\n1 2 2 3\n52 474 13 53\n1000000000 1001000001 2 1\n1000100000 1 1 1100000000\n1 10... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nYou are given an array consisting of all integers from $[l, r]$ inclusive. For example, if $l = 2$ and $r = 5... | [{"input": "5\n1 1\n1 8\n7 10\n1 10\n100000 186611\n", "output": "0\n4\n1\n5\n31072\n"}, {"input": "5\n1 2\n1 13\n4 5\n4 10\n110000 200000\n", "output": "1\n6\n0\n3\n21072\n"}, {"input": "5\n1 2\n1 13\n4 5\n1 10\n110000 200000\n", "output": "1\n6\n0\n5\n21072\n"}, {"input": "5\n1 1\n1 8\n7 14\n2 16\n100010 186611\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\nDescription\n\nSince the cubic equation: ax ^ 3 + bx ^ 2 + cx + d = 0 is given, please check the number of po... | [{"input": "2\n1 -1 4 -1\n-1 -10 -2 2", "output": "1 0\n1 2\n"}, {"input": "2\n1 -1 -1 1\n-1 -10 3 1", "output": "2 1\n1 2\n"}, {"input": "2\n1 -2 -1 2\n-2 -10 3 0", "output": "2 1\n1 1\n"}, {"input": "2\n2 -1 -2 0\n-2 -10 1 1", "output": "1 1\n1 2\n"}, {"input": "2\n1 -2 -1 -1\n-5 0 -1 0", "output": "1 0\n0 0\n"}, {"i... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nLet's denote the median of a sequence $s$ with odd length as the value in the middle of $s$ if we sort $s$ in... | [{"input": "4\n3 5 1\n1\n13 3 3\n1 4 7\n15 5 3\n2 5 10\n17 18 7\n2 3 5 7 5 11 12\n", "output": "NO\nYES\nYES\nNO\n"}, {"input": "4\n3 5 1\n1\n11 3 3\n1 3 7\n15 5 3\n4 5 6\n13 7 7\n2 3 5 7 9 11 12\n", "output": "NO\nYES\nYES\nYES\n"}, {"input": "4\n3 5 1\n1\n7 3 3\n1 3 7\n15 5 3\n4 5 10\n13 11 7\n2 3 5 7 9 11 12\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\nAlternate Escape\n\nAlice House\n\nAlice and Bob are playing board games. This board game is played using a b... | [{"input": "3 3 2 2\n 1 1 1\n0 0 0 0\n 1 1 1\n0 0 0 0\n 1 1 1\n0 0 0 0\n 1 1 1\n3 3 2 1\n 1 0 1\n1 0 1 1\n 1 0 0\n0 0 0 0\n 0 0 1\n1 1 0 1\n 1 0 1\n1 3 1 1\n 1 1 1\n1 0 0 1\n 1 0 1\n2 2 1 1\n 1 0\n1 0 0\n 0 0\n0 0 0\n 0 0\n0 0 0 0", "output": "Yes\nYes\nYes\nNo\n"}, {"input": "3 3 2 3\n 1 1 1\n0 0 0 0\n 1 1 1\n0 0 0 0\... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nYou are given a number $n$ and an array $b_1, b_2, \\ldots, b_{n+2}$, obtained according to the following alg... | [{"input": "1\n12\n400000000 400000000 400000000 400000000 400000000 400000000 400000000 400000000 400000000 400000000 400000000 400000000 400000000 505032704\n", "output": "-1\n"}, {"input": "1\n12\n400000000 400000000 400000000 400000000 400000000 400000000 400000000 400000000 400000000 400000000 400000000 400000000 ... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nOsaki\n\nOsaki\n\nEnglish text is not available in this practice contest.\n\nThe Yamanote Line is a circular ... | [{"input": "3\n05:47:15 04:45:90\n12:12:59 12:13:00\n16:30:20 21:18:53\n6\n00:00:00 03:00:00\n01:00:00 03:00:00\n02:00:00 03:00:00\n03:00:00 04:00:00\n03:00:00 05:00:00\n03:00:00 06:00:00\n0", "output": "1\n3\n"}, {"input": "3\n05:47:15 09:54:40\n12:12:59 12:13:00\n16:30:20 21:18:53\n6\n00:00:00 03:00:00\n01:00:00 03:0... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nIn the beginning, Takahashi has A cookies, and Aoki has B cookies. They will perform the following operation ... | [{"input": "231274241 358979323 84", "output": "393502366 196751183\n"}, {"input": "377378637 358979323 84", "output": "490905292 245452646\n"}, {"input": "7425724 358979323 157", "output": "122135010 244270020\n"}, {"input": "314159265 358979323 84", "output": "448759046 224379523"}, {"input": "7425724 358979323 84", ... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nYou are fishing with polar bears Alice and Bob. While waiting for the fish to bite, the polar bears get bored... | [{"input": "0\n00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nKaren is getting ready for a new school day!\n\n [Image] \n\nIt is currently hh:mm, given in a 24-hour format... | [{"input": "05:51\n", "output": "250\n"}, {"input": "15:52\n", "output": "250\n"}, {"input": "06:59\n", "output": "182\n"}, {"input": "17:31\n", "output": "151\n"}, {"input": "07:59\n", "output": "122\n"}, {"input": "07:10\n", "output": "171\n"}, {"input": "06:00\n", "output": "241\n"}, {"input": "06:01\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\nDuring the archaeological research in the Middle East you found the traces of three ancient religions: First ... | [{"input": "2 12\naa\n+ 1 a\n+ 2 a\n+ 3 a\n- 1\n+ 1 a\n- 2\n+ 2 a\n- 3\n+ 3 a\n+ 2 a\n- 1\n- 3\n", "output": "YES\nYES\nNO\nYES\nNO\nYES\nNO\nYES\nNO\nNO\nNO\nYES\n"}, {"input": "2 12\naa\n+ 1 a\n+ 2 a\n+ 3 a\n- 1\n+ 1 a\n- 2\n+ 2 a\n- 3\n+ 3 a\n+ 2 a\n- 1\n- 3\n", "output": "YES\nYES\nNO\nYES\nNO\nYES\nNO\nYES\nNO\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\nWe have a string S of length N consisting of uppercase English letters.\nHow many times does ABC occur in S a... | [{"input": "50\nABCABCABCABCABCABCABCABCABCABCABCABCABCABCABCABCAB\n", "output": "16\n"}, {"input": "50\nBMZBMWEYYDIADTLCOUEGMDBYFWURPWBPUVHIFNUAPWYNDMHTQV\n", "output": "0\n"}, {"input": "50\nKGKBHTYTSZOTWFLEGSJZZSZFWTZFPNSCGUEMWRCZQXYCIVDQNK\n", "output": "0\n"}, {"input": "50\nABBCACBCCACAAACAACACBCACABBAAABBBBCBAAB... | code_stdio |
[
{
"content": "You are an expert Python programmer. 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# How many urinals are free?\nIn men's public toilets with urinals, there is this unwritten rule that you lea... | [{"input": "\"1011000001\"", "output": "[-1]", "fn_name": "get_free_urinals"}, {"input": "\"10001\"", "output": "[1]", "fn_name": "get_free_urinals"}, {"input": "\"00000\"", "output": "[3]", "fn_name": "get_free_urinals"}, {"input": "\"01000\"", "output": "[1]", "fn_name": "get_free_urinals"}, {"input": "\"00010\"", "o... | code_functional |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nDreamoon is a big fan of the Codeforces contests.\n\nOne day, he claimed that he will collect all the places ... | [{"input": "5\n6 2\n3 1 1 5 7 10\n1 100\n100\n11 1\n1 1 1 1 1 1 1 1 1 1 1\n1 1\n1\n4 57\n80 60 40 20\n", "output": "5\n101\n2\n2\n60\n"}, {"input": "5\n6 2\n3 1 1 5 7 10\n1 100\n100\n11 1\n1 1 1 1 1 1 1 1 1 1 1\n1 1\n1\n4 57\n61 60 40 20\n", "output": "5\n101\n2\n2\n61\n"}, {"input": "5\n6 2\n3 1 1 5 7 10\n1 100\n100\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\nReminder: the median of the array $[a_1, a_2, \\dots, a_{2k+1}]$ of odd number of elements is defined as foll... | [{"input": "3\n1\n1 1\n3\n6 5 4 1 2 3\n5\n13 4 10 22 2 5 10 3 16 16\n", "output": "0\n1\n0\n"}, {"input": "3\n1\n-1 2\n3\n11 1 0 2 2 5\n5\n13 2 7 13 1 5 1 3 23 14\n", "output": "3\n0\n2\n"}, {"input": "3\n1\n1 2\n3\n6 5 4 1 2 1\n5\n13 4 7 14 2 10 14 3 34 16\n", "output": "1\n2\n3\n"}, {"input": "3\n1\n1 -1\n3\n6 5 4 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 arrange a deck of cards. Your task is to sort totally n cards. A card consists of a part of a suit (S, ... | [{"input": "6\nD 3\nH 2\nD 1\nS 3\nC 2\nC 1", "output": "Not stable\nD 1\nC 1\nC 2\nH 2\nD 3\nS 3\n"}, {"input": "6\nD 3\nH 2\nD 1\nS 3\nD 2\nC 0", "output": "Not stable\nC 0\nD 1\nH 2\nD 2\nS 3\nD 3\n"}, {"input": "6\nD 3\nH 0\nD 1\nS 3\nC 2\nC 1", "output": "Not stable\nH 0\nD 1\nC 1\nC 2\nS 3\nD 3\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\nGiven a string, swap the case for each of the letters.\n\ne.g. CodEwArs --> cODeWaRS\n\n### Examples\n\n```\n... | [{"input": "\"ThIs iS A l0NG sENTence witH nUMbERs in IT 123 456\"", "output": "[\"tHiS Is a L0ng SentENCE WITh NumBerS IN it 123 456\"]", "fn_name": "swap"}, {"input": "\"H_E_l-l_0 WO|||Rld\"", "output": "[\"h_e_L-L_0 wo|||rLD\"]", "fn_name": "swap"}, {"input": "\"EeEEeeEEEeee\"", "output": "[\"eEeeEEeeeEEE\"]", "fn_n... | code_functional |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nThe Cartesian coordinate system is set in the sky. There you can see n stars, the i-th has coordinates (x_{i}... | [{"input": "3 4 5\n1 1 2\n2 3 0\n3 3 1\n0 1 1 100 100\n1 2 2 4 4\n2 2 1 4 7\n1 50 50 51 51\n", "output": "3\n3\n5\n0\n"}, {"input": "3 4 5\n1 1 2\n2 3 0\n3 3 1\n0 1 1 100 100\n1 2 2 4 4\n2 2 1 4 7\n1 60 50 51 51\n", "output": "3\n3\n5\n0\n"}, {"input": "3 4 5\n1 1 2\n2 3 0\n3 3 1\n0 1 1 100 100\n0 2 2 4 4\n2 2 1 4 7\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\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 1119 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 ... | code_stdio |
[
{
"content": "You are an expert Python programmer. 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 now in a bookshop with your friend Alice to buy a book, \"The Winning Strategy for the Programming Ko... | [{"input": "0111 12618 3831", "output": "3720\n"}, {"input": "0101 15626 3831", "output": "3730\n"}, {"input": "0110 15626 3831", "output": "3721\n"}, {"input": "0111 27455 5699", "output": "5588\n"}, {"input": "0111 27455 8862", "output": "8751\n"}, {"input": "0111 27455 1408", "output": "1297\n"}, {"input": "0111 294... | code_stdio |
[
{
"content": "You are an expert Python programmer. 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 the sum of divisors of an integer N excluding the number itself. When N = S, N is called a perfect n... | [{"input": "1\n2\n2\n1\n1\n14\n16\n27\n66290451\n187711252\n124798312\n100001000\n0", "output": "deficient number\ndeficient number\ndeficient number\ndeficient number\ndeficient number\ndeficient number\ndeficient number\ndeficient number\ndeficient number\ndeficient number\ndeficient number\nabundant number\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\nRecently Max has got himself into popular CCG \"BrainStone\". As \"BrainStone\" is a pretty intellectual game... | [{"input": "10 9 0\n620118469 704168608\n528098892 341451371\n15150469 449838744\n960504540 722185004\n271837337 344050133\n940943201 419522619\n85569623 788965215\n161962866 563795701\n943389281 445744350\n610994199 473866838\n", "output": "5253588583\n"}, {"input": "10 9 0\n620118469 704168608\n528098892 341451371\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\nAlyona's mother wants to present an array of n non-negative integers to Alyona. The array should be special. ... | [{"input": "10 10\n1 5\n7 10\n2 10\n2 5\n2 9\n5 9\n3 10\n4 9\n6 9\n2 7\n", "output": "4\n0 1 2 3 0 1 2 3 0 1\n"}, {"input": "10 10\n1 34\n4 4\n4 8\n5 17\n1 9\n3 8\n1 6\n1 9\n1 6\n6 9\n", "output": "1\n0 0 0 0 0 0 0 0 0 0 \n"}, {"input": "10 10\n1 17\n4 8\n4 8\n5 9\n1 9\n3 8\n1 6\n1 9\n1 6\n6 9\n", "output": "4\n0 1 2 3... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nYou are given n segments on the Ox-axis. You can drive a nail in any integer point on the Ox-axis line nail s... | [{"input": "35\n-47 61\n-73 -15\n9 43\n43 -4\n13 -6\n48 -65\n49 -84\n-6 76\n40 6\n-41 11\n-63 -42\n-7 -7\n47 -98\n-17 61\n79 99\n47 -98\n61 31\n85 72\n-50 -17\n-67 45\n14 -50\n-45 61\n-6 -96\n-47 -83\n56 -58\n-24 -15\n14 20\n-95 -82\n47 93\n-4 -7\n70 9\n91 -18\n-71 31\n55 -20\n81 -8\n", "output": "8\n-82 -42 -15 -7 13 ... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nIn this problem you will write a simple generator of Brainfuck (https://en.wikipedia.org/wiki/Brainfuck) calc... | [{"input": "0-255-255-255-255+255+255+255+255+255\n", "output": "++++++++++++++++++++++++++++++++++++++++++++++++++.>\n+++++++++++++++++++++++++++++++++++++++++++++++++++++.>\n+++++++++++++++++++++++++++++++++++++++++++++++++++++.>\n"}, {"input": "0-255-255-255-255+255+255+255+255+255\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\nOn February, 30th n students came in the Center for Training Olympiad Programmers (CTOP) of the Berland State... | [{"input": "185\n28 4 4 26 15 21 14 35 22 28 26 24 2 35 21 34 1 23 35 10 6 16 31 0 30 9 18 33 1 22 24 26 22 10 8 27 14 33 16 16 26 22 1 28 32 1 35 12 31 0 21 6 6 5 29 27 1 29 23 22 30 19 37 17 2 2 2 25 3 23 28 0 3 31 34 5 2 23 27 7 26 25 33 27 15 31 31 4 3 21 1 1 23 30 0 13 24 33 26 5 1 17 23 25 36 0 20 0 32 2 2 36 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\nAn abundant number or excessive number is a number for which the sum of its proper divisors is greater than t... | [{"input": "14771", "output": "[false]", "fn_name": "abundant_number"}, {"input": "11410", "output": "[true]", "fn_name": "abundant_number"}, {"input": "11690", "output": "[true]", "fn_name": "abundant_number"}, {"input": "118", "output": "[false]", "fn_name": "abundant_number"}, {"input": "5830", "output": "[true]", "... | 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've got array A, consisting of n integers and a positive integer k. Array A is indexed by integers from 1 ... | [{"input": "40 4\n600000080 -199999981 -599999907 -199999935 -199999904 -599999919 200000022 600000032 600000046 -999999980 -199999917 600000027 200000075 -999999949 -599999911 -999999969 600000017 -199999999 -999999923 -599999924 600000091 -599999973 -599999936 600000011 -199999951 600000030 -199999900 -1114561877 200... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nOne day Vasya came across three Berland coins. They didn't have any numbers that's why Vasya didn't understan... | [{"input": "A>B\nC<B\nC;tg&A\n", "output": "Impossible\n"}, {"input": "A<:B\nB>C\nC>A\n", "output": "Impossible\n"}, {"input": "&Agt;B\nC<B\nC;tg&A\n", "output": "Impossible\n"}, {"input": "B:tl&A\nB>C\nC>A\n", "output": "Impossible\n"}, {"input": "&Agt;B\nC<B\nCgt;&A\n", "output": "Impossible... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nYou have an array a consisting of n distinct positive integers, numbered from 1 to n. Define p_k as $$$p_k = ... | [{"input": "100\n15 37 41 48 50 55 62 81 82 101 129 139 141 143 146 154 163 169 170 218 220 237 240 247 249 258 266 271 281 286 288 295 308 328 330 332 338 341 349 392 394 396 408 424 436 440 443 451 452 463 465 469 472 483 484 496 506 512 524 542 550 551 570 574 586 604 610 612 618 629 635 637 638 643 652 672 673 678 ... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nVery simple, given a number, find its opposite.\n\nExamples:\n```\n1: -1\n14: -14\n-34: 34\n```\n\n~~~if:sql\... | [{"input": "-95858588225", "output": "[95858588225]", "fn_name": "opposite"}, {"input": "1425.2222", "output": "[-1425.2222]", "fn_name": "opposite"}, {"input": "-3.1458", "output": "[3.1458]", "fn_name": "opposite"}, {"input": "25.6", "output": "[-25.6]", "fn_name": "opposite"}, {"input": "1", "output": "[-1]", "fn_na... | code_functional |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nIn Absurdistan, there are n towns (numbered 1 through n) and m bidirectional railways. There is also an absur... | [{"input": "4 6\n1 2\n1 3\n1 4\n2 3\n2 4\n3 4\n", "output": "-1\n"}, {"input": "10 5\n2 5\n1 2\n1 4\n1 3\n3 2\n", "output": "-1\n"}, {"input": "4 5\n1 3\n2 1\n3 4\n4 2\n2 3\n", "output": "2\n"}, {"input": "5 5\n2 5\n1 2\n1 4\n1 3\n3 2\n", "output": "2\n"}, {"input": "5 5\n4 5\n1 2\n2 4\n1 3\n3 2\n", "output": "3\n"}, {... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nConsider writing each of the integers from 1 to N \\times M in a grid with N rows and M columns, without dupl... | [{"input": "14 13\n158 167 181 147 178 151 179 182 176 169 180 129 175 168\n181 73 178 179 167 180 176 169 182 177 175 159 173", "output": "146891838\n"}, {"input": "14 13\n158 167 181 147 178 151 179 182 176 169 180 129 175 168\n181 150 178 179 167 180 176 169 182 177 175 159 173", "output": "343772227"}, {"input": "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\nA continued fraction of height n is a fraction of form $a_{1} + \\frac{1}{a_{2} + \\frac{1}{\\ldots + \\frac{... | [{"input": "633468529243155234 4\n90\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\n", "output": "NO\n"}, {"input": "742143496299253703 2\n90\n1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 ... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nRead problems statements in Mandarin Chinese and Russian. \n\nChef is judging a game called \"Broken telepho... | [{"input": "3\n7\n1 1 2 3 3 3 2\n5\n1 -1 1 1 1\n4\n5 5 5 5", "output": "5\n3\n0\n"}, {"input": "3\n7\n1 1 1 3 3 5 3\n5\n1 3 1 1 -1\n4\n1 5 9 5", "output": "5\n5\n4\n"}, {"input": "3\n7\n1 1 2 3 3 3 2\n5\n1 -1 1 1 1\n4\n1 5 5 5", "output": "5\n3\n2\n"}, {"input": "3\n7\n1 1 2 3 3 3 2\n5\n1 -2 1 1 1\n4\n1 7 5 5", "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\nNeko loves divisors. During the latest number theory lesson, he got an interesting exercise from his math tea... | [{"input": "1000000000 264865600\n", "output": "102701600\n"}, {"input": "1000000000 264865600\n", "output": "102701600"}, {"input": "999999973 800000007\n", "output": "199999823\n"}, {"input": "159488527 938932258\n", "output": "100326050\n"}, {"input": "179237079 691088384\n", "output": "332614226\n"}, {"input": "112... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nMike has n strings s1, s2, ..., sn each consisting of lowercase English letters. In one move he can choose a ... | [{"input": "33\nnkgcmrfvxe\nvxenkgcmrf\nrfvxenkgcm\nvxenkgcmrf\nxenkgcmrfv\nenkgcmrfvx\nenkgcmrfvx\nnkgcmrfvxe\nkgcmrfvxen\ncmrfvxenkg\ncmrfvxenkg\nxenkgcmrfv\nrfvxenkgcm\nrfvxenkgcm\nnkgcmrfvxe\nxenkgcmrfv\nrfvxenkgcm\nxenkgcmrfv\nxenkgcmrfv\ngcmrfvxenk\nmrfvxenkgc\nfvxenkgcmr\nvxenkgcmrf\nenkgcmrfvx\ncmrfvxenkg\ncmrf... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nArkady decides to observe a river for n consecutive days. The river's water level on each day is equal to som... | [{"input": "100\n0 1 2 2 3 0 1 5 6 6 0 0 8 7 1 9 9 4 10 11 12 2 12 12 12 12 9 13 14 8 15 15 15 19 15 7 17 17 18 19 9 10 21 0 22 9 2 24 24 4 24 7 25 14 5 8 28 29 30 31 31 31 0 3 15 31 8 33 6 35 35 35 36 36 37 37 38 39 28 0 2 23 75 9 9 0 6 25 41 41 12 42 43 43 36 44 51 45 43 4\n", "output": "2385\n"}, {"input": "100\n0 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\nToday Adilbek is taking his probability theory test. Unfortunately, when Adilbek arrived at the university, t... | [{"input": "20 25\n1 1 1 1 1 1 2 2 1 1 2 1 2 2 1 2 1 1 2 2\n", "output": "846324940\n"}, {"input": "20 26\n1 2 1 1 1 2 1 1 2 2 2 1 2 1 2 1 1 2 2 1\n", "output": "509799974\n"}, {"input": "20 27\n1 2 1 2 1 2 1 2 2 1 2 2 1 2 2 2 1 1 2 1\n", "output": "867942829\n"}, {"input": "20 29\n2 2 1 2 2 1 1 1 2 2 2 2 2 2 1 1 2 2 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\nA lot of frogs want to cross a river. A river is $w$ units width, but frogs can only jump $l$ units long, whe... | [{"input": "100 34\n16 0 10 11 12 13 0 5 4 14 6 15 4 9 1 20 19 14 1 7 14 11 10 20 6 9 12 8 3 19 20 4 17 17 8 11 14 18 5 20 17 0 3 18 14 12 11 12 5 5 11 7 9 17 4 8 4 10 0 0 12 9 15 3 15 14 19 12 6 8 17 19 4 18 19 3 8 3 9 1 6 15 4 16 1 18 13 16 3 5 20 11 10 9 9 17 20 15 12\n", "output": "312\n"}, {"input": "100 34\n16 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\nYou are given a string S of length n with each character being one of the first m lowercase English letters. ... | [{"input": "100 26\njysrixyptvsesnapfljeqkytlpeepjopspmkviqdqbdkylvfiawhdjjdvqqvcjmmsgfdmpjwahuwhgsyfcgnefzmqlvtvqqfbfsf\n", "output": "237400\n"}, {"input": "100 27\njysrixyptvsesnapfljeqkytlpeepjopspmkviqdqbdkylvfiawhdjjdvqqvcjmmsgfdmpjwahuwhgsyfcgnefzmqlvtvqqfbfsf\n", "output": "246900\n"}, {"input": "100 30\njysrix... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nPolycarp has recently got himself a new job. He now earns so much that his old wallet can't even store all th... | [{"input": "69\n+ 1 2\n+ 1 2\n+ 1 2\n+ 1 2\n+ 1 2\n+ 1 2\n+ 1 2\n+ 1 2\n+ 1 2\n+ 1 2\n+ 1 2\n+ 1 2\n+ 1 2\n+ 1 2\n+ 1 2\n+ 1 2\n+ 1 2\n+ 1 2\n+ 1 2\n+ 1 2\n+ 1 2\n+ 1 2\n+ 1 2\n+ 1 2\n+ 1 2\n+ 1 2\n+ 1 2\n+ 1 2\n+ 1 2\n+ 1 2\n+ 1 2\n+ 1 2\n+ 1 2\n+ 1 2\n+ 1 2\n+ 1 2\n+ 1 2\n+ 1 2\n+ 1 2\n+ 1 2\n+ 1 2\n+ 1 2\n+ 1 2\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\nChef has a sequence of $N$ integers, $A_1, A_2, ... , A_N$. He likes this sequence if it contains a subseque... | [{"input": "2\n6\n0 2 2 1 11 6\n3\n2 3 0\n6\n22 5 12 19 1 4\n2\n4 15", "output": "No\nNo\n"}, {"input": "2\n6\n1 2 3 4 7 6\n3\n2 3 4\n6\n22 5 6 33 1 4\n2\n4 15", "output": "Yes\nNo\n"}, {"input": "2\n6\n1 2 3 4 5 6\n3\n2 3 4\n6\n22 5 1 33 1 4\n2\n4 15", "output": "Yes\nNo\n"}, {"input": "2\n6\n0 2 3 4 7 6\n3\n2 3 4\n6\... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nYou are given an undirected weighted connected graph with $n$ vertices and $m$ edges without loops and multip... | [{"input": "8 10\n1 2 1\n2 3 2\n2 4 5\n1 4 2\n6 3 3\n6 1 3\n3 5 2\n3 7 1\n4 8 1\n6 2 4\n", "output": "1\n"}, {"input": "8 10\n1 2 1\n2 3 4\n2 4 5\n1 4 2\n6 3 3\n6 1 3\n3 5 2\n3 7 1\n4 8 1\n6 2 4\n", "output": "0\n"}, {"input": "8 10\n1 2 1\n2 3 2\n2 4 5\n1 4 2\n6 3 3\n6 1 3\n3 5 2\n3 7 1\n4 8 2\n6 2 4\n", "output": "1\... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nProblem\n\nGiven $ N $ a pair of non-negative integers $ (a_i, b_i) $ and non-negative integers $ A $, $ B $.... | [{"input": "10 1 12\n15 70\n36 -1\n18 43\n26 46\n33 20\n58 10\n0 -1\n80 5\n98 32\n23 84", "output": "1\n"}, {"input": "10 1 12\n15 70\n36 -1\n18 43\n26 46\n33 20\n58 10\n0 -1\n80 5\n98 32\n23 30", "output": "1\n"}, {"input": "10 1 12\n15 70\n58 -1\n18 43\n26 46\n33 20\n58 10\n0 -1\n80 5\n98 32\n23 30", "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\nTaro's summer vacation starts tomorrow, and he has decided to make plans for it now.\n\nThe vacation consists... | [{"input": "7\n3 1 176\n0 1 0\n-2 2 0\n2 4 2\n-1 12 1\n0 1 22\n0 1 -4", "output": "215\n"}, {"input": "7\n6 2 176\n1 3 -1\n-2 0 0\n3 9 3\n-1 4 2\n-4 1 4\n0 1 -5", "output": "192\n"}, {"input": "7\n6 2 176\n2 3 -3\n0 0 -1\n6 9 4\n-1 7 2\n-4 1 7\n0 1 -8", "output": "199\n"}, {"input": "7\n9 1 66\n-1 1 2\n-1 2 0\n2 4 1\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\nOverall there are m actors in Berland. Each actor has a personal identifier — an integer from 1 to m (distinc... | [{"input": "50 25\n8 18 41 25 16 39 2 47 49 37 40 23 3 35 15 7 11 28 22 48 10 17 38 46 44\n4\nswyzirxhx\n28\n43 32 14 5 0 17 25 39 0 0 36 0 0 34 27 22 6 13 26 0 0 41 12 16 0 0 0 23\nzyn\n3\n36 12 47\np\n33\n38 0 35 0 6 20 43 9 15 37 17 23 2 0 0 0 0 0 34 0 28 10 33 0 5 4 7 12 36 46 0 0 45\nycaqpkbu\n31\n41 26 16 0 0 36 ... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nGildong has an interesting machine that has an array $a$ with $n$ integers. The machine supports two kinds of... | [{"input": "7\n2\n0 1\n3\n-1 0 2\n4\n110 133 106 95\n4\n-3 -5 -2 1\n6\n1 8 3 8 4 1\n5\n5 0 0 0 5\n9\n-367741579 319422997 -415264583 -125558838 -300860379 721691728 294512916 -383235489 425814447\n", "output": "0\n1\n15\n4\n14\n5\n3449059550\n"}, {"input": "7\n2\n0 1\n3\n-1 0 2\n4\n110 133 106 49\n4\n-3 -5 -2 1\n6\n1 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\nCaisa is going to have a party and he needs to buy the ingredients for a big chocolate cake. For that he is g... | [{"input": "69 9\n39 15\n70 44\n90 89\n84 58\n83 97\n24 28\n90 18\n7 96\n43 86\n99 50\n77 12\n12 34\n100 19\n21 86\n55 30\n99 29\n26 92\n82 67\n78 14\n64 16\n98 12\n31 39\n36 86\n73 36\n87 29\n42 23\n58 15\n35 52\n91 56\n39 6\n88 45\n38 36\n57 12\n79 71\n40 33\n98 42\n34 36\n23 79\n69 68\n50 47\n23 6\n22 90\n96 79\n88 ... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nLunar New Year is approaching, and Bob is planning to go for a famous restaurant — \"Alice's\".\n\nThe restau... | [{"input": "10 15\n132 138 38 75 14 115 129 68 119 118\n728344 513371 120930 757031 137753 453796 348671 185533 966778 521678\n4 58\n1 8\n8 22\n3 98\n2 111\n6 158\n2 82\n1 170\n1 26\n1 4\n4 76\n10 106\n5 100\n4 116\n7 62\n", "output": "43907798\n5826752\n4081726\n15058400\n56984181\n67179393\n33037922\n108948627\n13563... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nMedicine faculty of Berland State University has just finished their admission campaign. As usual, about $80\... | [{"input": "10\n5620 2478 4051 7060 10510 2170 6912 2031 1781 7454\n1 1 1 1 1 1 1 1 1 1\n", "output": "5620\n"}, {"input": "10\n5620 1555 4051 7060 10510 2170 6912 2031 1781 7454\n1 1 1 1 1 1 1 1 1 1\n", "output": "5620\n"}, {"input": "10\n7846 8354 1188 6898 8046 7561 8043 8588 8684 3699\n1 1 2 3 4 5 6 7 8 9\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\nCount how often sign changes in array.\n\n### result\nnumber from `0` to ... . Empty array returns `0`\n\n###... | [{"input": "[1, -2, -7, -4, 4, -2, 0, -3, 3]", "output": "[6]", "fn_name": "catch_sign_change"}, {"input": "[-2, -2, -5, -4, 5, 2, 0, 6, 0]", "output": "[1]", "fn_name": "catch_sign_change"}, {"input": "[-8, 4, -1, 5, -3, -3, -2, -2]", "output": "[4]", "fn_name": "catch_sign_change"}, {"input": "[13, -7, -6, 2, -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\nYou have $n$ gifts and you want to give all of them to children. Of course, you don't want to offend anyone, ... | [{"input": "5\n3\n3 5 12\n3 2 3\n5\n1 2 3 4 5\n5 4 1 2 1\n3\n1 1 1\n2 2 2\n6\n1 1000000000 1000000000 1000000000 1000000000 1000000000\n1 1 2 1 1 1\n3\n10 24 8\n7 5 4\n", "output": "12\n16\n0\n4999999995\n19\n"}, {"input": "5\n3\n3 5 12\n3 2 3\n5\n1 2 6 4 5\n5 4 1 2 1\n3\n1 1 1\n2 2 2\n6\n1 1000000000 1000000000 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- Kids drink toddy.\n- Teens drink coke.\n- Young adults drink beer.\n- Adults drink whisky.\n\nMake a functi... | [{"input": "22", "output": "[\"drink whisky\"]", "fn_name": "people_with_age_drink"}, {"input": "21", "output": "[\"drink whisky\"]", "fn_name": "people_with_age_drink"}, {"input": "13", "output": "[\"drink toddy\"]", "fn_name": "people_with_age_drink"}, {"input": "0", "output": "[\"drink toddy\"]", "fn_name": "people_... | 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\nYae joins a journey plan, in which parties will be held several times during the itinerary. She wants to part... | [{"input": "1 118", "output": "118\n"}, {"input": "1 -11", "output": "-11\n"}, {"input": "1 -12", "output": "-12\n"}, {"input": "1 -21", "output": "-21\n"}, {"input": "10 10", "output": "1\n"}, {"input": "1 26", "output": "26\n"}, {"input": "1 43", "output": "43\n"}, {"input": "1 65", "output": "65\n"}, {"input": "1 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\nDee is lazy but she's kind and she likes to eat out at all the nice restaurants and gastropubs in town. To ma... | [{"input": "125\n1", "output": "[14]", "fn_name": "calc_tip"}, {"input": "125\n0", "output": "[12]", "fn_name": "calc_tip"}, {"input": "125\n-1", "output": "[5]", "fn_name": "calc_tip"}, {"input": "144\n1", "output": "[15]", "fn_name": "calc_tip"}, {"input": "144\n0", "output": "[13]", "fn_name": "calc_tip"}, {"input":... | code_functional |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nFor a sequence of integers $A = \\\\{a_0, a_1, ..., a_{n-1}\\\\}$ which is sorted by ascending order, elimina... | [{"input": "4\n-2 -1 1 2", "output": "-2 -1 1 2\n"}, {"input": "4\n-2 -1 0 2", "output": "-2 -1 0 2\n"}, {"input": "4\n-2 -1 0 4", "output": "-2 -1 0 4\n"}, {"input": "4\n-1 0 1 10", "output": "-1 0 1 10\n"}, {"input": "4\n-4 -1 0 1", "output": "-4 -1 0 1\n"}, {"input": "4\n-4 -2 0 1", "output": "-4 -2 0 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\nThe vowel substrings in the word `codewarriors` are `o,e,a,io`. The longest of these has a length of 2. Given... | [{"input": "\"ultrarevolutionariees\"", "output": "[3]", "fn_name": "solve"}, {"input": "\"chrononhotonthuooaos\"", "output": "[5]", "fn_name": "solve"}, {"input": "\"iiihoovaeaaaoougjyaw\"", "output": "[8]", "fn_name": "solve"}, {"input": "\"strengthlessnesses\"", "output": "[1]", "fn_name": "solve"}, {"input": "\"cub... | 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\nAndrew often reads articles in his favorite magazine 2Char. The main feature of these articles is that each o... | [{"input": "31\nfml\nfml\nfml\nfml\nfml\nfml\nfml\nfml\nfml\nfml\nfml\nfml\nfml\nfml\nfml\nfml\nfml\nfml\nfml\nfml\nfml\nfml\nfml\nfml\nfml\nfml\nfml\nfml\nfml\nfml\nfml\n", "output": "0\n"}, {"input": "31\nfml\nfml\nfml\nfml\nfml\nfml\nfml\nfml\nfml\nfml\nfml\nfml\nfml\nfml\nfml\nfml\nfml\nfml\nfml\nfml\nfml\nfml\nfml... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nPolygons are the most fundamental objects in geometric processing. Complex figures are often represented and ... | [{"input": "3\n1 1\n3 4\n6 -1\n\n7\n1 -1\n10 10\n-1 20\n3 33\n0 70\n100 40\n100 -1\n\n0", "output": "1 9.5\n2 5426.0\n"}, {"input": "3\n1 1\n3 4\n6 -1\n\n7\n1 -1\n10 10\n-1 20\n3 33\n0 40\n100 40\n100 0\n\n0", "output": "1 9.5\n2 3921.5\n"}, {"input": "3\n2 1\n2 4\n11 0\n\n7\n2 -2\n0 14\n0 28\n3 33\n-2 41\n100 49\n110 ... | code_stdio |
[
{
"content": "You are an expert Python programmer. 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, …, p_n.\n\nImagine that some positions of the permutation contain bomb... | [{"input": "10\n7 10 1 8 3 9 2 4 6 5\n7 6 5 3 8 10 4 1 9 2\n", "output": "10 9 8 7 6 6 5 5 5 1 \n"}, {"input": "10\n7 10 1 8 3 9 2 4 6 5\n7 6 5 3 8 10 2 1 9 2\n", "output": "10 9 8 7 6 6 5 5 5 2\n"}, {"input": "10\n7 10 1 8 3 9 2 4 6 5\n7 6 5 3 8 10 4 1 2 2\n", "output": "10 9 8 7 6 6 5 5 5 5\n"}, {"input": "10\n7 10 1... | code_stdio |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.