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\nQwerty the Ranger took up a government job and arrived on planet Mars. He should stay in the secret lab and c... | [{"input": "1000000 1000000 1000000 1000000\n", "output": "1000000\n"}, {"input": "1000000 1001000 1000000 1000000\n", "output": "1000000\n"}, {"input": "100000 100000 1000010 1000000\n", "output": "1000009\n"}, {"input": "100000 100000 1000000 1000000\n", "output": "999999\n"}, {"input": "722229 410423 118215 838505\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\nRead problems statements in Mandarin Chinese . \n\nYou are given two strings A and B of the same length. Each... | [{"input": "5\nccade\nbddcc", "output": "3\n"}, {"input": "5\nccade\nccdcb", "output": "0\n"}, {"input": "5\nddacc\nbddcc", "output": "1\n"}, {"input": "5\nddacc\nccddb", "output": "2\n"}, {"input": "5\nccade\nbcdcc", "output": "3\n"}, {"input": "5\ncacde\nccdcb", "output": "0\n"}, {"input": "5\nc`cde\nccdcb", "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\nTakahashi is now competing in a programming contest, but he received TLE in a problem where the answer is YES... | [{"input": "5 13", "output": "195788800\n"}, {"input": "100 5\n", "output": "608000\n"}, {"input": "3 10", "output": "18739200\n"}, {"input": "10 7", "output": "1740800\n"}, {"input": "110 5", "output": "640000\n"}, {"input": "15 7", "output": "1804800\n"}, {"input": "111 4", "output": "292800\n"}, {"input": "111 3", "... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nRead problems statements in Mandarin Chinese and Russian. \n\nAlok-nath is man of equality. He needs your he... | [{"input": "2\n6 3\n1 4 14 4 11\n5 2\n-1 2 0 14 4", "output": "no\nno\n"}, {"input": "2\n6 3\n1 4 14 4 11\n5 4\n-1 2 0 14 4", "output": "no\nno\n"}, {"input": "2\n5 3\n1 2 14 4 11\n5 2\n-1 2 0 8 7", "output": "no\nno\n"}, {"input": "2\n5 3\n1 4 14 4 11\n5 2\n-1 2 0 8 7", "output": "no\nno\n"}, {"input": "2\n1 3\n0 2 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\nCodehorses has just hosted the second Codehorses Cup. This year, the same as the previous one, organizers are... | [{"input": "43\nL\nXXXL\nM\nXS\nL\nXXL\nS\nL\nM\nXXXL\nXXS\nS\nXS\nS\nXS\nXL\nXXL\nXXL\nXS\nXXS\nXXL\nL\nXXXL\nL\nL\nXXL\nXXL\nM\nXXXS\nM\nXXL\nXXXS\nXXXL\nXXS\nL\nL\nXS\nL\nXS\nXS\nL\nXXL\nM\nXXXL\nXXL\nXXL\nXL\nL\nXS\nM\nXL\nXXXS\nXXXS\nS\nXXL\nXXXL\nXXL\nXS\nXXS\nL\nS\nXXXS\nXL\nL\nXL\nXXXS\nM\nL\nXXL\nL\nXL\nM\nM\n... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n# Description\n\"It's the end of trick-or-treating and we have a list/array representing how much candy each ... | [{"input": "[17, 20, 50, 61, 42, 44]", "output": "[132]", "fn_name": "candies"}, {"input": "[1, 2, 4, 6]", "output": "[11]", "fn_name": "candies"}, {"input": "[1, 3, 3, 7]", "output": "[14]", "fn_name": "candies"}, {"input": "[5, 8, 6, 4]", "output": "[9]", "fn_name": "candies"}, {"input": "[7, 7, 7, 7]", "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\nYou are given three integers $a$, $b$ and $x$. Your task is to construct a binary string $s$ of length $n = a... | [{"input": "80 242 40\n", "output": "1010101010101010101010101010101010101010000000000000000000000000000000000000000000000000000000000000111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nEverybody knows the classic [\"half your age plus seven\"](https://en.wikipedia.org/wiki/Age_disparity_in_sex... | [{"input": "17", "output": "[\"15-20\"]", "fn_name": "dating_range"}, {"input": "40", "output": "[\"27-66\"]", "fn_name": "dating_range"}, {"input": "15", "output": "[\"14-16\"]", "fn_name": "dating_range"}, {"input": "35", "output": "[\"24-56\"]", "fn_name": "dating_range"}, {"input": "53", "output": "[\"33-92\"]", "f... | 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\nThis time the Berland Team Olympiad in Informatics is held in a remote city that can only be reached by one s... | [{"input": "1 1000000000 1000000000\n100000\n", "output": " 0"}, {"input": "5 3 2\n1 1 2 1 1\n", "output": " 7"}, {"input": "5 3 3\n1 2 2 1 1\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\nE869120 has A 1-yen coins and infinitely many 500-yen coins.\n\nDetermine if he can pay exactly N yen using o... | [{"input": "2018\n218\n", "output": "Yes\n"}, {"input": "2018\n113", "output": "Yes\n"}, {"input": "2018\n111", "output": "Yes\n"}, {"input": "2018\n101", "output": "Yes\n"}, {"input": "2018\n100", "output": "Yes\n"}, {"input": "2018\n110", "output": "Yes\n"}, {"input": "2763\n-113", "output": "No\n"}, {"input": "2763\... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nThere is a square grid of size $n \\times n$. Some cells are colored in black, all others are colored in whit... | [{"input": "1000 24\n190 39 552 958\n539 146 763 587\n31 526 423 673\n208 432 953 442\n263 69 719 635\n162 428 623 797\n49 126 94 963\n749 623 979 919\n190 461 367 855\n211 240 939 914\n169 80 336 203\n684 546 829 582\n80 218 324 327\n560 452 656 637\n316 534 982 642\n521 634 758 686\n514 324 753 437\n342 395 384 995\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\nAuction\n\nsquare1001 You were watching a certain auction.\n\nAn auction is a transaction in which when there... | [{"input": "5\n-1 -1 -2 -2 3", "output": "4\n5\n"}, {"input": "5\n-1 -1 -3 -2 3", "output": "3\n5\n"}, {"input": "5\n-1 -1 -3 -1 3", "output": "3\n5\n"}, {"input": "5\n-1 -1 -6 -1 3", "output": "3\n5\n"}, {"input": "5\n-1 -2 -6 -1 3", "output": "3\n5\n"}, {"input": "5\n-1 -1 -6 -2 3", "output": "3\n5\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\nTomya is a girl. She loves Chef Ciel very much.\n\nToday, too, Tomya is going to Ciel's restaurant.\nOf cours... | [{"input": "2\n3 3\n1 2 3\n2 3 11\n1 2 14\n3 3\n2 2 3\n2 3 1\n2 3 9", "output": "1\n0\n"}, {"input": "2\n3 3\n1 1 3\n3 3 11\n1 2 7\n3 3\n2 2 3\n2 3 1\n2 1 9", "output": "0\n1\n"}, {"input": "2\n3 3\n1 2 1\n2 3 6\n1 3 7\n3 3\n2 3 4\n2 3 6\n1 3 12", "output": "2\n1\n"}, {"input": "2\n3 3\n1 2 3\n2 3 4\n1 3 7\n6 3\n2 3 3\... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nDevu is a renowned classical singer. He is invited to many big functions/festivals. Recently he was invited t... | [{"input": "100 6000\n41 31 23 17 24 78 26 96 93 48 46 2 49 33 35 9 73 100 34 48 83 36 33 69 43 24 3 74 8 81 27 33 94 38 77 9 76 90 62 90 21 67 22 22 12 2 17 27 102 18 72 85 59 65 71 38 90 75 74 66 60 47 58 50 90 95 75 10 5 100 97 29 83 88 65 26 93 90 22 98 36 55 70 38 50 92 88 72 99 96 25 14 74 16 25 92 67 94 77 96\n"... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nIn the $2022$ year, Mike found two binary integers $a$ and $b$ of length $n$ (both of them are written only b... | [{"input": "5\n1\n0\n3\n011\n3\n110\n6\n111000\n6\n001011\n", "output": "\n1\n110\n100\n101101\n101110\n"}, {"input": "5\n1\n0\n3\n011\n3\n110\n6\n111000\n6\n001011\n", "output": "1\n110\n100\n101101\n101110\n"}, {"input": "5\n1\n0\n3\n011\n3\n110\n6\n111100\n6\n001011\n", "output": "1\n110\n100\n101001\n101110\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 a simplified penalty phase at the end of a football match.\n\nA penalty phase consists of at most $1... | [{"input": "4\n1001???0?1\n1111111111\n??????????\n0100001000\n", "output": "8\n10\n6\n10\n"}, {"input": "4\n1?0???1001\n1111111111\n??????????\n0000000000\n", "output": "7\n10\n6\n10\n"}, {"input": "4\n1001?1?0??\n0111111011\n??????????\n1100011000\n", "output": "9\n10\n6\n10\n"}, {"input": "4\n0?0???1001\n1111111111\... | code_stdio |
[
{
"content": "You are an expert Python programmer. 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 an array $a$ of length $n$ and an integer $k$, find the number of indices $1 \\leq i \\leq n - k$ such ... | [{"input": "1\n40 39\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 1000000000 1000000000 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\nTakahashi has a string S consisting of lowercase English letters.\nStarting with this string, he will produce... | [{"input": "a\n6\n2 2 a\n2 1 b\n1\n2 2 c\n1\n1\n", "output": "aabc\n"}, {"input": "a\n6\n2 2 a\n2 1 b\n1\n2 2 d\n1\n1", "output": "aabd\n"}, {"input": "a\n6\n2 2 b\n2 1 b\n1\n2 2 d\n1\n1", "output": "babd\n"}, {"input": "a\n6\n2 2 a\n2 1 b\n1\n2 1 c\n1\n1", "output": "caab\n"}, {"input": "a\n6\n2 2 a\n2 1 b\n1\n2 1 b\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\nLet's consider a table consisting of n rows and n columns. The cell located at the intersection of i-th row a... | [{"input": "100000 1000000000\n", "output": "16\n"}, {"input": "100000 183783600\n", "output": "438\n"}, {"input": "100000 551350800\n", "output": "392\n"}, {"input": "100000 479001600\n", "output": "254\n"}, {"input": "100000 1000000000\n", "output": "16\n"}, {"input": "100000 479001600\n", "output": "254\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\nVasily has a deck of cards consisting of n cards. There is an integer on each of the cards, this integer is b... | [{"input": "100\n12 9 97 55 14 8 55 34 35 67 3 18 73 92 41 49 15 60 18 66 9 26 97 47 43 88 71 97 19 63 48 96 79 53 8 47 69 49 21 23 77 12 21 176 66 9 29 13 61 69 54 77 10 13 4 68 37 74 7 6 29 76 55 72 89 4 78 27 29 82 18 83 12 4 32 69 89 85 66 13 92 54 38 5 26 56 17 55 29 4 17 39 29 94 3 67 85 79 21 14\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\n# Do you ever wish you could talk like Siegfried of KAOS ?\n\n## YES, of course you do!\n\nhttps://en.wikiped... | [{"input": "5\n\"And another thing Mr Smart, I want no more trouble!\"", "output": "[\"Und unozer zink Mr Schmart, I vunt no mor trubl!\"]", "fn_name": "siegfried"}, {"input": "5\n\"You ought to behave yourself Smart!\"", "output": "[\"Yu ught to behav yurself Schmart!\"]", "fn_name": "siegfried"}, {"input": "5\n\"Smar... | 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\nRecall that MEX of an array is a minimum non-negative integer that does not belong to the array. Examples: f... | [{"input": "7 3\n0\n1\n2\n2\n0\n0\n10\n", "output": "1\n2\n3\n3\n4\n4\n7\n"}, {"input": "7 5\n0\n1\n2\n2\n0\n0\n10\n", "output": "1\n2\n3\n3\n3\n3\n3\n"}, {"input": "7 3\n0\n1\n2\n2\n0\n0\n10\n", "output": "1\n2\n3\n3\n4\n4\n7\n"}, {"input": "4 4\n0\n1\n2\n2\n0\n0\n10\n", "output": "1\n2\n3\n3\n"}, {"input": "3 3\n0\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\nWrite a function \n\n`titleToNumber(title) or title_to_number(title) or titleToNb title ...`\n\n(depending on... | [{"input": "\"UNFORGIVABLE\"", "output": "[79089429845931757]", "fn_name": "title_to_number"}, {"input": "\"LONELINESS\"", "output": "[68400586976949]", "fn_name": "title_to_number"}, {"input": "\"CODEWARS\"", "output": "[28779382963]", "fn_name": "title_to_number"}, {"input": "\"ZZZTOP\"", "output": "[321268054]", "fn... | code_functional |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nFriends are going to play console. They have two joysticks and only one charger for them. Initially first joy... | [{"input": "100 100\n", "output": "197\n"}, {"input": "100 100\n", "output": "197\n"}, {"input": "100 25\n", "output": "122\n"}, {"input": "100 25\n", "output": "122\n"}, {"input": "100 26\n", "output": "124\n"}, {"input": "155 25\n", "output": "178\n"}, {"input": "155 18\n", "output": "171\n"}, {"input": "131 18\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 Polycarpus has learned the \"bitwise AND\" operation (which is also called \"AND\") of non-negative ... | [{"input": "7\n-1 1000000000 999999488 999999488 1000000000 1000000000 999999488\n1000000000 -1 999999488 999999488 1000000000 1000000000 999999488\n999999488 999999488 -1 999999999 999999488 999999488 999999999\n999999488 999999488 999999999 -1 999999488 999999488 999999999\n1000000000 1000000000 999999488 999999488 -... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nGiven are two strings S and T consisting of lowercase English letters. Concatenate T and S in this order, wit... | [{"input": "oekdkfjdjgjknbfkwnfnhaoekdkfjdjgjknbfkwnfnhahjekkengkfoekdkfjdjgjknbfkwnfnhaoekdkfjdjgjknbfkwnfnhahj yowkymbmhkkgjjeokdlakbndkkworqotkfnblgpnkkrogjrfnvmbjisnbkzvmbnrrrigeoibgpefjobvmovpqosqoqrgrkengrlk\n", "output": "yowkymbmhkkgjjeokdlakbndkkworqotkfnblgpnkkrogjrfnvmbjisnbkzvmbnrrrigeoibgpefjobvmovpqosqoqr... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nYet another Armageddon is coming! This time the culprit is the Julya tribe calendar. \n\nThe beavers in this ... | [{"input": "1000000000000000000\n", "output": "113502443819651915\n"}, {"input": "999999899799299198\n", "output": "113502432686240713\n"}, {"input": "999999999999999998\n", "output": "113502443819651913\n"}, {"input": "999999999999999999\n", "output": "113502443819651914\n"}, {"input": "999999999999999997\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\nLittle girl Alyona is in a shop to buy some copybooks for school. She study four subjects so she wants to hav... | [{"input": "999999999 1000000000 1000000000 1000000000\n", "output": "1000000000\n"}, {"input": "1714658473 1000000000 999999990 1000000000\n", "output": "1000000000\n"}, {"input": "999999999 1000000000 1000000100 1000000000\n", "output": "1000000000\n"}, {"input": "999999999 1000000000 1000000000 1000000000\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\nGiven an array containing only integers, add all the elements and return the binary equivalent of that sum.\n... | [{"input": "[1, 10, 100, 1000]", "output": "[\"10001010111\"]", "fn_name": "arr2bin"}, {"input": "[1, 2, 3, 4, 5]", "output": "[\"1111\"]", "fn_name": "arr2bin"}, {"input": "[1, 2, -1, -2, 1]", "output": "[\"1\"]", "fn_name": "arr2bin"}, {"input": "[1, 2, -1, -2]", "output": "[\"0\"]", "fn_name": "arr2bin"}, {"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\nCreatnx has $n$ mirrors, numbered from $1$ to $n$. Every day, Creatnx asks exactly one mirror \"Am I beautifu... | [{"input": "100\n60 79 48 35 18 24 87 1 44 65 60 78 11 43 71 79 90 6 94 49 22 91 58 93 55 21 22 31 7 15 17 65 76 9 100 89 50 96 14 38 27 87 29 93 54 12 99 35 27 51 36 44 6 26 91 1 53 8 49 63 18 4 31 55 95 15 77 1 16 98 75 26 26 43 2 11 18 70 3 65 11 74 64 69 26 54 9 51 25 82 98 12 90 75 19 23 78 93 6 7\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\nImagine that your city is an infinite 2D plane with Cartesian coordinate system. The only crime-affected road... | [{"input": "44 37298\n-100 -100 -98 -93 -92 -91 -91 -89 -87 -86 -84 -80 -79 -76 -71 -70 -58 -53 -52 -52 -49 -48 -45 -45 -40 -39 -37 -35 -31 -30 -30 -29 -29 -28 -22 -22 -21 -11 -8 -7 -7 -6 -1 0\n", "output": "200\n"}, {"input": "45 45\n-95 -94 -92 -83 -83 -76 -75 -74 -71 -70 -68 -44 -36 -31 -20 -18 -14 -11 -8 -7 -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\nOne day, the Grasshopper was jumping on the lawn and found a piece of paper with a string. Grasshopper became... | [{"input": "VRPHBNWNWVWBWMFJJDCTJQJDJBKSJRZLVQRVVFLTZFSGCGDXCWQVWWWMFVCQHPKXXVRKTGWGPSMQTPKNDQJHNSKLXPCXDJDQDZZD\n", "output": "101\n"}, {"input": "DZZDQDJDXCPXLKSNHJQDNKPTQMSPGWGTKRVXXKPHQCVFMWWWVQWCXDGCGSFZTLFVVRQVLZRJSKBJDJQJTCDJJFMWBWVWNWNBHPRV\n", "output": "101\n"}, {"input": "VRPHBNWNWVWBWMFJJDCTJQJDJBKSJRZLVQRV... | code_stdio |
[
{
"content": "You are an expert Python programmer. 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 has got n empty boxes. For every i (1 ≤ i ≤ n), i-th box is a cube with side length a_{i}.\n\nMishka c... | [{"input": "100\n981 288 186 186 292 876 341 288 663 360 783 907 292 186 341 292 360 1510 360 360 1230 398 783 288 366 398 876 981 398 907 133 360 288 981 907 186 360 288 186 981 186 288 907 876 288 907 876 360 341 292 907 694 907 783 284 981 907 292 876 398 895 876 154 341 876 33 288 186 981 341 398 595 907 981 208 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\nSnuke has one biscuit and zero Japanese yen (the currency) in his pocket. He will perform the following opera... | [{"input": "314159265 35897932 384626433", "output": "48518828981938099"}, {"input": "407766107 9307229 14836778", "output": "1101648954500241\n"}, {"input": "407766107 9307229 25447105", "output": "3215538450316794\n"}, {"input": "296771207 9307229 25447105", "output": "2319816489000594\n"}, {"input": "513602852 93072... | code_stdio |
[
{
"content": "You are an expert Python programmer. 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 sequence of length N, a = (a_1, a_2, ..., a_N).\nEach a_i is a positive integer.\nSnuke's objective... | [{"input": "6\n2 7 1 8 2 8\n", "output": "Yes\n"}, {"input": "6\n4 7 0 -1 6 4", "output": "Yes\n"}, {"input": "6\n2 7 2 12 2 8", "output": "Yes\n"}, {"input": "6\n4 7 2 8 2 10", "output": "Yes\n"}, {"input": "6\n2 7 2 8 2 8", "output": "Yes\n"}, {"input": "6\n4 7 2 8 2 8", "output": "Yes\n"}, {"input": "6\n6 7 2 8 2 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\nWrite a function called that takes a string of parentheses, and determines if the order of the parentheses is... | [{"input": "\"(c(b(a)))(d)\"", "output": "[true]", "fn_name": "valid_parentheses"}, {"input": "\"((())()())\"", "output": "[true]", "fn_name": "valid_parentheses"}, {"input": "\"hi(hi))(\"", "output": "[false]", "fn_name": "valid_parentheses"}, {"input": "\"hi(hi)(\"", "output": "[false]", "fn_name": "valid_parentheses... | 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\nFind the number of integers between 1 and N (inclusive) that contains exactly K non-zero digits when written ... | [{"input": "9999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999\n3\n", "output": "117879300\n"}, {"input": "9999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999\n3", "output": "117879300"}, {"input": "9999999999999999999999... | code_stdio |
[
{
"content": "You are an expert Python programmer. 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π (spelled pi in English) is a mathematical constant representing the circumference of a circle whose di- ame... | [{"input": "1.1386381399168386\n0.08430864816896695\n0.0", "output": "3/1\n16/5\n"}, {"input": "0.5656950408067312\n0.06616503278329884\n0.0", "output": "3/1\n16/5\n"}, {"input": "0.9300839575225542\n0.09342351193849237\n0.0", "output": "3/1\n16/5\n"}, {"input": "0.7461955408233221\n0.09342351193849237\n0.0", "output":... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nJack has become a soldier now. Unfortunately, he has trouble with the drill. Instead of marching beginning wi... | [{"input": "RXLLRXXLLRLRLLXXXXRXXRLLRRRRXLLRRLXXLRXXLXLRLLLLLRXLRXLXRXLXLRRXXRRLXLXLRLRXRXLXXXLRXLLXLRRRRXRLLXRRLLRRXRRRLRLLRLRXXXRLXLXLLLRXXLLXLRXXLLLRLXRRXRLXLXXXXXXLXRXXRXXXRXLXXRRXLLXRRXLXXRRXLXXRLXLXXLXRXXRLRLLXLXLXLRXLXLXLLLRLXXLXLLRLLLLRLRRRRXRRLLRLXLXXRLRRLXRRXXXRLLXRRRXXRRRXXLRXRLLXRRRXRXRXXLLLRLRXXRLRLXRLLXLX... | code_stdio |
[
{
"content": "You are an expert Python programmer. 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 game called Guru Guru Gururin. In this game, you can move with the vehicle called Gururin. ... | [{"input": "RRLRRLRRRRLRRLRRRRLRRLRRRRLRRLRR", "output": "4"}, {"input": "RLLRRLLLRRRLLLLRR", "output": "0\n"}, {"input": "RLLRRLLMRRRLLLLRR", "output": "0\n"}, {"input": "RLLRLLLLRRRLLLRRR", "output": "0"}, {"input": "RRRRLLLLRRRR", "output": "2"}, {"input": "RL", "output": "0\n"}, {"input": "QL", "output": "0\n"}, {"... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nYou are given $q$ queries in the following form:\n\nGiven three integers $l_i$, $r_i$ and $d_i$, find minimum... | [{"input": "30\n1 1000000000 1\n1 1000000000 1\n1 1000000000 1\n1 1000000000 1\n1 1000000000 1\n1 1000000000 1\n1 1000000000 1\n1 1000000000 1\n1 1000000000 1\n1 1000000000 1\n1 1000000000 1\n1 1000000000 1\n1 1000000000 1\n1 1000000000 1\n1 1000000000 1\n1 1000000000 1\n1 1000000000 1\n1 1000000000 1\n1 1000000000 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\nFrom 1603 to 1867, people call that era the EDO era. EDO stands for Enhanced Driving Operation, the most adva... | [{"input": "2\n10 11\n11 12\n2\nN 2\nE 1\n2\n10 11\n11 12\n2\nN 2\nW 1\n3\n0 15\n5 10\n5 15\n5\nW 20\nS 10\nN 20\nE 10\nS 10\n0", "output": "Yes\nNo\nNo\n"}, {"input": "2\n10 11\n11 12\n2\nN 2\nE 1\n2\n10 11\n11 12\n2\nN 3\nW 1\n3\n0 15\n5 10\n5 15\n5\nW 20\nS 10\nN 20\nE 10\nS 10\n0", "output": "Yes\nNo\nNo\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\nYour friend Cody has to sell a lot of jam, so he applied a good 25% discount to all his merchandise.\n\nTroub... | [{"input": "\"10349349 13799132 14426622 17347290 19235496 23129720 24791793 32049435 33055724 42732580 48771579 51731211 58387395 59065617 65028772 67572870 68974948 71437914 77849860 78754156 81661776 88101462 90097160 95250552 97020531 108882368 114334791 117468616 128978592 129360708 138971622 140891505 151010565 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\nCapitalization is writing a word with its first letter as a capital letter. Your task is to capitalize the gi... | [{"input": "lZqBqKeGvNdSeYuWxRiVnFtYbKuJwQtUcKnVtQhAlOeUzMaAuTaEnDdPfDcNyHgEoBmYjZyFePeJrRiKyAzFnBfAuGiUyLrIeLrNhBeBdVcEeKgCcBrQzDsPwGcNnZvTsEaYmFfMeOmMdNuZbUtDoQoNcGwDqEkEjIdQaPwAxJbXeNxOgKgXoEbZiIsVkRrNpNyAkLeHkNfEpLuQvEcMbIoGaDzXbEtNsLgGfOkZaFiUsOvEjVeCaMcZqMzKeAdXxJsVeCrZaFpJtZxInQxFaSmGgSsVyGeLlFgFqTpIbAvPkIfJrVcJ... | code_stdio |
[
{
"content": "You are an expert Python programmer. 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 an integer and prints sum of its digits.\n\n\n\nInput\n\nThe input consists of mu... | [{"input": "123\n158\n1100\n0", "output": "6\n14\n2\n"}, {"input": "123\n181\n1111\n0", "output": "6\n10\n4\n"}, {"input": "123\n418\n1100\n0", "output": "6\n13\n2\n"}, {"input": "123\n418\n1110\n0", "output": "6\n13\n3\n"}, {"input": "123\n736\n1110\n0", "output": "6\n16\n3\n"}, {"input": "123\n239\n1000\n0", "output"... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nThere is data on sales of your company. Your task is to write a program which identifies good workers.\n\nThe... | [{"input": "4\n1001 2000 520\n1002 3520 450\n1003 1600 625\n1001 200 1220\n2\n1001 100 3\n1005 1000 100\n2\n2013 5000 010\n2013 5000 100\n0", "output": "1001\n1002\n1003\nNA\nNA\n"}, {"input": "4\n0110 2000 520\n11 2363 29\n1507 8024 1160\n1101 670 2276\n2\n0001 100 0\n502 1100 100\n2\n715 1354 100\n1668 14106 100\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\nYour task is to calculate logical value of boolean array. Test arrays are one-dimensional and their size is i... | [{"input": "[true, false, false, false]\n\"AND\"", "output": "[false]", "fn_name": "logical_calc"}, {"input": "[true, true, false, false]\n\"AND\"", "output": "[false]", "fn_name": "logical_calc"}, {"input": "[true, true, false, false]\n\"XOR\"", "output": "[false]", "fn_name": "logical_calc"}, {"input": "[true, false,... | code_functional |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nScheduling is how the processor decides which jobs(processes) get to use the processor and for how long. This... | [{"input": "[3, 10, 20, 1, 2, 10, 10]\n5", "output": "[26]", "fn_name": "SJF"}, {"input": "[3, 10, 10, 20, 1, 2]\n1", "output": "[16]", "fn_name": "SJF"}, {"input": "[3, 10, 10, 20, 1, 2]\n2", "output": "[26]", "fn_name": "SJF"}, {"input": "[3, 10, 20, 1, 2, 3]\n5", "output": "[9]", "fn_name": "SJF"}, {"input": "[3, 10... | code_functional |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nTakahashi, who is A years old, is riding a Ferris wheel.\nIt costs B yen (B is an even number) to ride the Fe... | [{"input": "30 100\n", "output": "100\n"}, {"input": "13 298\n", "output": "298\n"}, {"input": "60 654\n", "output": "654\n"}, {"input": "12 100\n", "output": "50\n"}, {"input": "6 482\n", "output": "241\n"}, {"input": "15 100", "output": "100\n"}, {"input": "16 110", "output": "110\n"}, {"input": "17 101", "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\nInternational Christmas Present Company (ICPC) is a company to employ Santa and deliver presents on Christmas... | [{"input": "3 2 3\n0 1 10\n1 2 15\n0 -1\n1 8\n2 -1\n3 2 4\n0 1 10\n1 2 10\n0 0\n1 19\n2 20\n0 25\n13 10 10\n0 1 39\n2 3 48\n3 5 20\n4 8 25\n3 9 10\n8 9 40\n3 4 5\n5 0 17\n0 7 93\n1 3 13\n0 0\n1 100000000\n2 100\n3 543\n4 500\n5 400\n6 300\n6 200\n8 100\n9 100\n0 0 0", "output": "3\n3\n4\n"}, {"input": "3 2 3\n0 1 10\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\n## Task\n\nYou have to write three functions namely - `PNum, GPNum and SPNum` (JS, Coffee), `p_num, g_p_num a... | [{"input": "100", "output": "[false]", "fn_name": "p_num"}, {"input": "0", "output": "[false]", "fn_name": "p_num"}, {"input": "2", "output": "[false]", "fn_name": "p_num"}, {"input": "3", "output": "[false]", "fn_name": "p_num"}, {"input": "4", "output": "[false]", "fn_name": "p_num"}, {"input": "1", "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\nAirport Codes\n\nAirport code\n\nIn the Kingdom of JAG, airport codes are assigned to each domestic airport f... | [{"input": "3\nhaneda\noookayama\nssu\n2\nazusa\nazishirabe\n2\nsnuke\nsnake\n4\nhaneda\nhonda\nhanamaki\nhawaii\n0", "output": "1\n4\n-1\n3\n"}, {"input": "3\nhaneda\noookayama\nstu\n2\nazusa\nebarihsiza\n2\nsnuke\nsnake\n4\nhaneda\nhonda\nhanamaki\nhawaih\n0", "output": "1\n1\n-1\n3\n"}, {"input": "3\nhaneca\noookaya... | code_stdio |
[
{
"content": "You are an expert Python programmer. 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 working for an administration office of the International Center for Picassonian Cubism (ICPC), which... | [{"input": "4 5\n..33\n33..\n2222\n..1.\n.111\n5 7\n....1\n.1..1\n1..1.\n11..1\n.2222\n..111\n...1.\n3 6\n.3.\n233\n23.\n22.\n.11\n.11\n4 3\n2222\n..11\n..11\n4 5\n.3..\n..33\n322.\n2211\n.11.\n3 3\n222\n2.1\n111\n3 4\n11.\n11.\n.2/\n222\n3 4\n.11\n.11\n.2.\n222\n2 7\n11\n.1\n21\n22\n23\n.3\n33\n2 3\n1.\n11\n1.59382700... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nDid you know that the yummy golden triangle was introduced in India as early as 13th century ? By the way, I'... | [{"input": "1\n4\n10 20 34 89\n4\n10 26\n7 21\n14 21\n7 35", "output": "2\n"}, {"input": "1\n4\n10 20 34 89\n4\n7 14\n7 21\n14 21\n7 35", "output": "2\n"}, {"input": "1\n4\n10 20 34 55\n4\n7 14\n7 21\n14 6\n13 35", "output": "2\n"}, {"input": "1\n4\n10 20 34 89\n4\n7 26\n7 21\n14 21\n7 35", "output": "2\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\nEshag has an array $a$ consisting of $n$ integers.\n\nEshag can perform the following operation any number of... | [{"input": "3\n6\n1 1 1 7 3 1\n6\n17 17 8 11 9 12\n6\n10 2 2 2 1 1\n", "output": "2\n5\n4\n"}, {"input": "3\n6\n1 1 1 7 3 1\n6\n17 17 8 11 9 12\n6\n10 2 2 2 0 1\n", "output": "2\n5\n5\n"}, {"input": "3\n6\n1 1 2 7 3 1\n6\n17 17 8 11 9 12\n6\n10 2 2 2 0 1\n", "output": "3\n5\n5\n"}, {"input": "3\n6\n1 1 1 2 3 3\n6\n9 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\nRikhail Mubinchik believes that the current definition of prime numbers is obsolete as they are too complex a... | [{"input": "10000 239\n", "output": "1168638\n"}, {"input": "10001 239\n", "output": "1168798\n"}, {"input": "10000 239\n", "output": "1168638"}, {"input": "10278 674\n", "output": "204510\n"}, {"input": "15744 9999\n", "output": "1020\n"}, {"input": "10000 10000\n", "output": "40\n"}, {"input": "5858 674\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\nOnce again, Boris needs the help of Anton in creating a task. This time Anton needs to solve the following pr... | [{"input": "5\n3\n1 -1 0\n1 1 -2\n3\n0 1 1\n0 2 2\n2\n1 -1\n1 44\n2\n-1 0\n-1 -38\n5\n1 1 -1 1 -1\n1 1 -1 1 -1\n", "output": "YES\nNO\nYES\nYES\nYES\n"}, {"input": "5\n3\n0 -1 -1\n1 1 -2\n3\n0 1 1\n0 1 2\n2\n1 0\n1 41\n2\n-1 0\n-1 -41\n5\n0 1 -1 1 -1\n0 1 -1 1 -1\n", "output": "NO\nYES\nYES\nYES\nYES\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\nInna and Dima bought a table of size n × m in the shop. Each cell of the table contains a single letter: \"D\... | [{"input": "14 34\nDDDDDDDDDDDDIMADDDDDDDDDDDDDDDIMAD\nDDDDDDIMADDDDDDDDDDDDDDDDDDDDDIMAD\nDDDDDDDDDDDDDIDDDDDDDDDDDIDIMIDIMA\nDDDDDDIMDDDDDDDDDDDDDIDDDDDDDDDDDD\nDDDDDDDDDDDDDDDDDMADDDDDDDDDDDDDMD\nDDDDDDIMIDDDDDDDDDDDDIMIDIMIDDDIDD\nDDDDDDDDDDDDDDDDDMIMDDDDIMDDIMADIM\nDDDDDDDDDDDADIMADIDDDDDDIDIMADADDD\nDDDDDDDDIDDDD... | code_stdio |
[
{
"content": "You are an expert Python programmer. 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\nYou've just moved into a perfectly straight street with exactly ```n``` identical houses on either ... | [{"input": "20\n3400", "output": "[6781]", "fn_name": "over_the_road"}, {"input": "10\n22", "output": "[35]", "fn_name": "over_the_road"}, {"input": "7\n11", "output": "[16]", "fn_name": "over_the_road"}, {"input": "9\n26", "output": "[44]", "fn_name": "over_the_road"}, {"input": "20\n10", "output": "[1]", "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\nLet's call beauty of an array $b_1, b_2, \\ldots, b_n$ ($n > 1$) — $\\min\\limits_{1 \\leq i < j \\leq n} |b... | [{"input": "52 52\n19752 66708 73109 84463 95683 96876 98503 98812 99766 99778 99913 99975 99977 99997 99997 99997 99998 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 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\nGiven a string, turn each letter into its ASCII character code and join them together to create a number - le... | [{"input": "\"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ\"", "output": "[96]", "fn_name": "calc"}, {"input": "\"jfmgklf8hglbe\"", "output": "[6]", "fn_name": "calc"}, {"input": "\"aaaaaddddr\"", "output": "[30]", "fn_name": "calc"}, {"input": "\"ifkhchlhfd\"", "output": "[6]", "fn_name": "calc"}, {"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\nConstruct a function 'coordinates', that will return the distance between two points on a cartesian plane, gi... | [{"input": "[-4, -5]\n[-5, -4]\n1", "output": "[1.4]", "fn_name": "coordinates"}, {"input": "[-2, 5]\n[-2, -10]\n2", "output": "[15]", "fn_name": "coordinates"}, {"input": "[4, 7]\n[6, 2]\n3", "output": "[5.385]", "fn_name": "coordinates"}, {"input": "[5, 3]\n[10, 15]\n2", "output": "[13]", "fn_name": "coordinates"}, {... | 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\nBob came to a cash & carry store, put n items into his trolley, and went to the checkout counter to pay. Each... | [{"input": "10\n3 512981548\n0 214269975\n2 603901234\n3 772872647\n0 224281389\n4 561877930\n1 809519308\n4 1128067436\n1 114469023\n2 184038037\n", "output": "860384990\n"}, {"input": "10\n3 512981548\n0 214269975\n2 603901234\n3 772872647\n0 224281389\n4 561877930\n1 809519308\n4 1128067436\n1 40056209\n2 184038037\... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nGerald plays the following game. He has a checkered field of size n × n cells, where m various cells are bann... | [{"input": "10 5\n2 1\n4 4\n2 2\n4 3\n1 1\n", "output": "11\n"}, {"input": "5 5\n3 2\n5 4\n3 3\n2 3\n1 2\n", "output": "1\n"}, {"input": "5 5\n3 2\n1 4\n5 1\n4 5\n3 1\n", "output": "2\n"}, {"input": "5 5\n2 2\n5 3\n2 3\n5 1\n4 4\n", "output": "1\n"}, {"input": "6 5\n2 6\n6 5\n3 1\n2 2\n1 2\n", "output": "4\n"}, {"input... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nThere are N arrays. The length of each array is M and initially each array contains integers (1,2,...,M) in t... | [{"input": "11 12\n6\n-2 0 3 6 -1 3", "output": "No\n"}, {"input": "11 12\n6\n-3 0 3 6 -1 3", "output": "No\n"}, {"input": "11 12\n6\n-3 0 3 6 -2 3", "output": "No\n"}, {"input": "1 6\n6\n-1 -2 1 4 0 1", "output": "Yes\n"}, {"input": "4 6\n6\n-1 -2 1 4 -1 5", "output": "No\n"}, {"input": "1 6\n6\n-1 -2 1 2 0 1", "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\nToad Zitz has an array of integers, each integer is between 0 and m-1 inclusive. The integers are a_1, a_2, …... | [{"input": "100 1000\n980 755 745 448 424 691 210 545 942 979 555 783 425 942 495 741 487 514 752 434 187 874 372 617 414 505 659 445 81 397 243 986 441 587 31 350 831 801 194 103 723 166 108 182 252 846 328 905 639 690 738 638 986 340 559 626 572 808 442 410 179 549 880 153 449 99 434 945 163 687 173 797 999 274 975 6... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nYou are given a string s consisting of n lowercase Latin letters. You have to type this string using your key... | [{"input": "100\nyeywsnxcwslfyiqbbeoaawtmioksfdndptxxcwzfmrpcixjbzvicijofjrbcvzaedglifuoczgjlqylddnsvsjfmfsccxbdveqgu\n", "output": "100\n"}, {"input": "100\nyeywsnxcwslfyiqbbeoaawtmioksfdndptxxcwzfmrpcixjbzvicijofjrbcvzaedglifuoczgjlqylddnsvsjfmfsccxbdveqgu\n", "output": "100\n"}, {"input": "100\nyeywsnxcwslfyiqbbeoia... | code_stdio |
[
{
"content": "You are an expert Python programmer. 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 world of DragonBool there are fierce warriors called Soints. Also there are even fiercer warriors call... | [{"input": "2\n2 3\n10 1\n20 2\n5 2\n4 2\n18 1\n5 5\n73 87\n100 13\n36 36\n77 46\n16 93\n49 46\n27 93\n118 87\n172 13\n63 36", "output": "8\n155\n"}, {"input": "2\n2 3\n7 1\n20 2\n5 2\n4 2\n18 1\n5 5\n73 87\n100 13\n36 36\n77 46\n16 93\n49 46\n27 93\n118 87\n172 13\n63 36", "output": "11\n155\n"}, {"input": "2\n2 3\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\nGiven the triangle of consecutive odd numbers:\n\n```\n 1\n 3 5\n 7 9 1... | [{"input": "101", "output": "[1030301]", "fn_name": "row_sum_odd_numbers"}, {"input": "74", "output": "[405224]", "fn_name": "row_sum_odd_numbers"}, {"input": "86", "output": "[636056]", "fn_name": "row_sum_odd_numbers"}, {"input": "93", "output": "[804357]", "fn_name": "row_sum_odd_numbers"}, {"input": "41", "output":... | code_functional |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nA ski base is planned to be built in Walrusland. Recently, however, the project is still in the constructing ... | [{"input": "2 40\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n", "output": "0\n1\n3\n7\n15\n31\n63\n127\n255\n511\n1023\n2047\n4095\n8191\n16383\n32767\n65535\n1310... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nCheesy Cheeseman just got a new monitor! He is happy with it, but he just discovered that his old desktop wal... | [{"input": "3840\n\"32:9\"", "output": "[\"3840x1080\"]", "fn_name": "find_screen_height"}, {"input": "1920\n\"16:9\"", "output": "[\"1920x1080\"]", "fn_name": "find_screen_height"}, {"input": "5120\n\"32:9\"", "output": "[\"5120x1440\"]", "fn_name": "find_screen_height"}, {"input": "1280\n\"16:9\"", "output": "[\"1280... | code_functional |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nGiven is an integer x that is greater than or equal to 0, and less than or equal to 1.\nOutput 1 if x is equa... | [{"input": "000", "output": "1\n"}, {"input": "000", "output": "1\n"}, {"input": "1\n", "output": "0\n"}, {"input": "0\n", "output": "1\n"}, {"input": "1", "output": "0"}, {"input": "0", "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\nPhoenix has $n$ coins with weights $2^1, 2^2, \\dots, 2^n$. He knows that $n$ is even.\n\nHe wants to split t... | [{"input": "100\n30\n30\n30\n30\n30\n30\n30\n30\n30\n30\n30\n30\n30\n30\n30\n30\n30\n30\n30\n30\n30\n30\n30\n30\n30\n30\n30\n30\n30\n30\n30\n30\n30\n30\n30\n30\n30\n30\n30\n30\n30\n30\n30\n30\n30\n30\n30\n30\n30\n30\n30\n30\n30\n30\n30\n30\n30\n30\n30\n30\n30\n30\n30\n30\n30\n30\n30\n30\n30\n30\n30\n30\n30\n30\n30\n30\... | code_stdio |
[
{
"content": "You are an expert Python programmer. 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 long decimal number $a$ consisting of $n$ digits from $1$ to $9$. You also have a function $f... | [{"input": "20\n58832646452639258958\n9 2 2 1 1 4 8 6 6\n", "output": "58832646452639258958\n"}, {"input": "20\n58832646452639258958\n9 2 2 1 1 4 8 6 6\n", "output": "58832646452639258958"}, {"input": "19\n4752348644348366742\n6 7 9 7 5 7 9 9 5\n", "output": "7957979777979977977\n"}, {"input": "19\n2612437771227631192\... | code_stdio |
[
{
"content": "You are an expert Python programmer. 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# 'Magic' recursion call depth number\n\nThis Kata was designed as a Fork to the one from donaldsebleung Robo... | [{"input": "\"p6023R6F95L64R98P3321L15qP8886P8063P2161p3321P6023P6023F86L64qp8886F12F3L33P3321P3321R57qp8063P3321L35P3321P8886P6023F51qp2161P8063P8063F32R6F46q\"", "output": "[[3, 5]]", "fn_name": "magic_call_depth_number"}, {"input": "\"p5048L50R23P2998R9qp2125P3445R41R48qp1776R41P392qP2904p2998R4P2125P1776qp3445F57P1... | code_functional |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nGiven is a string S. Replace every character in S with x and print the result.\n\n-----Constraints-----\n - S... | [{"input": "kvtvweokpottycaeeyfthzfvsgckwjmgqadfekjfitnsieylhumxjjezqvidkxjpywokrnzxxwraamuimhmrjwqeyvjvyjjzsxxf\n", "output": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\n"}, {"input": "qvssniprlkdntynymqcjoxpttvplhodrlkpqwtnkdfkgmokodexzspghvslwqrerrsiasriutrr... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nYou are given an integer N.\nFind the number of the positive divisors of N!, modulo 10^9+7.\n\n-----Constrain... | [{"input": "1000\n", "output": "972926972\n"}, {"input": "1001", "output": "513172208\n"}, {"input": "108", "output": "875619122\n"}, {"input": "111", "output": "130571620\n"}, {"input": "101", "output": "167902493\n"}, {"input": "100", "output": "583951250\n"}, {"input": "110", "output": "277966376\n"}, {"input": "115... | code_stdio |
[
{
"content": "You are an expert Python programmer. 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 positive integers $x$ and $y$. You can perform the following operation with $x$: write it i... | [{"input": "1740680371580423905 1636173592742219971\n", "output": "NO\n"}, {"input": "999999999999999999 1636173592742219971\n", "output": "NO\n"}, {"input": "616543106594181990 1600944574522397396\n", "output": "NO\n"}, {"input": "470060730774588924 1202400343260876277\n", "output": "NO\n"}, {"input": "616543106594181... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSnuke is buying a bicycle.\nThe bicycle of his choice does not come with a bell, so he has to buy one separat... | [{"input": "10000 10000 10000\n", "output": "20000\n"}, {"input": "10000 10100 10000", "output": "20000\n"}, {"input": "10000 00100 10000", "output": "10100\n"}, {"input": "11000 10100 10000", "output": "20100\n"}, {"input": "11000 10110 10000", "output": "20110\n"}, {"input": "11000 10111 10000", "output": "20111\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\nSquare Route\n\nSquare root\n\nEnglish text is not available in this practice contest.\n\nMillionaire Shinada... | [{"input": "3 3\n2\n1\n2\n-1\n3\n1\n1 2\n22\n11\n10\n0 0", "output": "7\n0\n"}, {"input": "3 3\n1\n1\n2\n1\n1\n1\n1 2\n10\n10\n23\n0 0", "output": "11\n1\n"}, {"input": "3 3\n1\n1\n1\n2\n3\n1\n1 2\n10\n10\n10\n0 0", "output": "6\n2\n"}, {"input": "3 3\n1\n1\n1\n1\n3\n1\n1 2\n10\n10\n10\n0 0", "output": "7\n2\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\nA `bouncy number` is a positive integer whose digits neither increase nor decrease. For example, 1235 is an i... | [{"input": "50", "output": "[99999999999999999999999999999999999999912040301674]", "fn_name": "bouncy_count"}, {"input": "20", "output": "[99999999999959940181]", "fn_name": "bouncy_count"}, {"input": "10", "output": "[9999722967]", "fn_name": "bouncy_count"}, {"input": "6", "output": "[987048]", "fn_name": "bouncy_cou... | code_functional |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nTakahashi became a pastry chef and opened a shop La Confiserie d'ABC to celebrate AtCoder Beginner Contest 10... | [{"input": "1000 1000\n-10000000000 -10000000000 -10000000000\n-10000000000 -10000000000 -10000000000\n-10000000000 -10000000000 -10000000000\n-10000000000 -10000000000 -10000000000\n-10000000000 -10000000000 -10000000000\n-10000000000 -10000000000 -10000000000\n-10000000000 -10000000000 -10000000000\n-10000000000 -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\nRead problems statements in Mandarin Chinese . \n\nGiven an array of n non-negative integers: A_{1}, A_{2}, …... | [{"input": "4\n1\n11\n23\n11", "output": "11\n"}, {"input": "4\n4\n11\n18\n16", "output": "16\n"}, {"input": "4\n1\n15\n17\n14", "output": "14\n"}, {"input": "4\n13\n10\n3\n13", "output": "13\n"}, {"input": "4\n2\n30\n26\n11", "output": "26\n"}, {"input": "4\n37\n23\n0\n36", "output": "36\n"}, {"input": "4\n37\n49\n0\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\nOnce Volodya was at the museum and saw a regular chessboard as a museum piece. And there were only four chess... | [{"input": "e8 e7 d8 g8\n", "output": "CHECKMATE\n"}, {"input": "d4 e5 b7 a5\n", "output": "CHECKMATE\n"}, {"input": "a5 b5 g2 a8\n", "output": "CHECKMATE\n"}, {"input": "d8 d7 h8 f8\n", "output": "CHECKMATE\n"}, {"input": "g8 h5 a6 h3\n", "output": "CHECKMATE\n"}, {"input": "b3 a5 g6 a8\n", "output": "CHECKMATE\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\nFor a given sequence of distinct non-negative integers $(b_1, b_2, \\dots, b_k)$ we determine if it is good i... | [{"input": "109\n74 18 237 179 195 112 156 11 72 68 173 202 78 250 224 251 107 55 186 144 57 62 28 210 132 64 93 6 211 0 174 163 248 226 167 246 46 102 253 180 121 56 151 35 150 254 168 201 242 118 190 158 196 30 75 116 187 96 215 244 192 73 12 175 33 222 131 256 181 230 114 165 128 234 63 90 44 70 229 182 101 69 92 26... | code_stdio |
[
{
"content": "You are an expert Python programmer. 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 an easier version of the next problem. The difference is only in constraints.\n\nYou are given a rect... | [{"input": "40\n2 2\n5 2\n1 5\n1 1\n3\n1 2\n1 1\n1 2\n1 1\n1 2\n2 3\n2 1\n1\n1\n1 1\n1\n2 1\n1\n1\n1 2\n2 3\n2 2\n1 3\n3 3\n1 1\n1\n2 1\n3\n4\n1 1\n2\n2 2\n1 1\n1 1\n2 2\n1 1\n1 1\n1 1\n1\n2 1\n1\n1\n2 1\n5\n3\n1 1\n2\n1 2\n2 2\n2 1\n1\n1\n2 2\n3 2\n2 4\n1 1\n5\n1 2\n2 1\n1 2\n1 1\n1 2\n1 1\n1 2\n1 1\n1 1\n3\n2 2\n1 2\... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nBomboslav likes to look out of the window in his room and watch lads outside playing famous shell game. The g... | [{"input": "2000000000\n0\n", "output": "1\n"}, {"input": "1999999995\n0\n", "output": "2\n"}, {"input": "1999999995\n1\n", "output": "1\n"}, {"input": "1999999995\n2\n", "output": "0\n"}, {"input": "1999999996\n0\n", "output": "2\n"}, {"input": "1999999996\n1\n", "output": "0\n"}, {"input": "1999999996\n2\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 at a water bowling training. There are l people who play with their left hand, r people, who play wit... | [{"input": "100 100 100\n", "output": "300\n"}, {"input": "100 100 100\n", "output": "300\n"}, {"input": "100 101 100\n", "output": "300\n"}, {"input": "99 100 100\n", "output": "298\n"}, {"input": "100 99 100\n", "output": "298\n"}, {"input": "100 100 99\n", "output": "298\n"}, {"input": "99 100 100\n", "output": "298... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nYou have an array of integers (initially empty).\n\nYou have to perform $q$ queries. Each query is of one of ... | [{"input": "8\n2 1 4\n1 1\n1 4\n1 2\n2 2 4\n2 4 3\n1 2\n2 2 7\n", "output": "1 3 3 7 \n"}, {"input": "8\n2 1 4\n1 1\n1 4\n1 2\n2 2 4\n2 4 3\n1 2\n2 2 7\n", "output": "1 3 3 7 "}, {"input": "8\n2 2 4\n1 1\n1 4\n1 2\n2 2 4\n2 4 3\n1 2\n2 2 7\n", "output": "1 3 3 7"}, {"input": "8\n2 2 4\n1 1\n1 4\n1 2\n2 2 6\n2 4 3\n1 2\... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n> I would, if I could,\n> If I couldn't how could I?\n> I couldn't, without I could, could I?\n> Could you... | [{"input": "15 2 3\n16 3 6\n110 9 112\n0 0 0", "output": "1\n11\n98\n"}, {"input": "15 2 4\n16 3 6\n110 9 112\n0 0 0", "output": "8\n11\n98\n"}, {"input": "15 2 4\n15 3 6\n110 9 112\n0 0 0", "output": "8\n10\n98\n"}, {"input": "10 2 3\n10 2 5\n100 13 40\n0 0 0", "output": "1\n2\n86\n"}, {"input": "10 2 3\n28 2 5\n100 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\nGildong is now developing a puzzle game. The puzzle consists of n platforms numbered from 1 to n. The player ... | [{"input": "3\n4\n1 1 1 0\n5\n4 3 2 1 0\n9\n4 1 4 2 1 0 2 1 0\n", "output": "\n0\n3\n2\n"}, {"input": "3\n4\n1 1 1 0\n5\n4 3 2 1 0\n9\n4 1 4 3 1 0 2 1 0\n", "output": "0\n3\n2\n"}, {"input": "3\n4\n1 1 1 0\n5\n4 3 2 1 0\n9\n4 1 4 2 1 0 2 0 0\n", "output": "0\n3\n1\n"}, {"input": "3\n4\n1 1 1 0\n5\n2 3 2 1 0\n9\n3 1 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\nIn number world, two different numbers are friends if they have a lot in common, but also each one has unique... | [{"input": "100\n42 486 341 527 189 740 490 388 989 489 711 174 305 844 971 492 998 757 832 442 176 619 906 154 293 395 439 735 738 915 453 748 2353 895 871 932 693 326 53 904 732 835 354 364 691 669 157 719 282 875 573 672 695 790 58 872 732 751 557 779 329 70 213 844 289 137 50 951 284 671 474 829 906 736 395 366 22 ... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSnuke found a record of a tree with N vertices in ancient ruins. The findings are as follows:\n\n* The vertic... | [{"input": "15\n9 10\n9 15\n15 4\n4 13\n13 2\n13 11\n2 14\n13 6\n11 1\n2 12\n12 3\n12 7\n2 5\n14 8\n1154 890 2365 883 2930 2076 1590 1104 1726 1791 1091 1226 151 1000 1657", "output": "5\n6\n86\n104\n739\n85\n10\n148\n4\n37\n87\n28\n156\n8\n"}, {"input": "15\n9 10\n9 15\n15 4\n4 13\n13 2\n13 11\n2 14\n13 11\n11 1\n1 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\nIn this kata, you will write a function that returns the positions and the values of the \"peaks\" (or local ... | [{"input": "[1, 2, 5, 4, 3, 2, 3, 6, 4, 1, 2, 3, 3, 4, 5, 3, 2, 1, 2, 3, 5, 5, 4, 3]", "output": "[{\"pos\": [2, 7, 14, 20], \"peaks\": [5, 6, 5, 5]}]", "fn_name": "pick_peaks"}, {"input": "[3, 2, 3, 6, 4, 1, 2, 3, 2, 1, 2, 2, 2, 1]", "output": "[{\"pos\": [3, 7, 10], \"peaks\": [6, 3, 2]}]", "fn_name": "pick_peaks"}, ... | 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\nSometimes we are faced with problems when we have a big nested dictionary with which it's hard to w... | [{"input": "{\"glossary\": {\"GlossDiv\": {\"GlossList\": {\"GlossEntry\": {\"GlossDef\": {\"GlossSeeAlso\": {\"1\": \"GML\", \"2\": \"XML\"}, \"para\": \"A meta-markup language, used to create markup languages such as DocBook.\"}, \"GlossSee\": \"markup\", \"Acronym\": \"SGML\", \"GlossTerm\": \"Standard Generalized M... | 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 an attempt to escape the Mischievous Mess Makers' antics, Farmer John has abandoned his farm and is travel... | [{"input": "491 172\n01111101111111100000111010110001010001110111000010101111101000100010010111011101110110111101101010111000111000011100011010010010111111000011011010100110001000011100111000001011100010001111101111101000111001100110010100101000001110010100100100100101001100010101001000010000111110011000000100000100101... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nAt Aizu Riverside Hospital, inpatients walk twice a day for rehabilitation and health promotion. As the numbe... | [{"input": "5\n263 1519 1817\n2 1240 1985\n11656 1896 4132\n10001 503 3107\n51 1421 2690\n3\n345 1628 2181\n7 3910 1590\n5982 2525 3616\n0", "output": "11656 6028\n5982 6141\n"}, {"input": "5\n263 1519 1817\n2 1240 1985\n11656 1896 4132\n10001 503 3107\n51 1421 2690\n3\n345 1628 2181\n7 3910 1590\n5982 2525 5629\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\nWrite a function that takes as its parameters *one or more numbers which are the diameters of circles.* \n\nT... | [{"input": "56894.04839\n843975.4839\n4.08437403489", "output": "[\"We have this much circle: 561977165367\"]", "fn_name": "sum_circles"}, {"input": "5\n6\n7\n8\n9\n10\n105083\n48839\n4853\n28\n483", "output": "[\"We have this much circle: 10564760498\"]", "fn_name": "sum_circles"}, {"input": "4.5456\n746.5\n98.34\n344... | 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 the \"computer expert\" of a local Athletic Association (C.A.A.).\nMany teams of runners come to comp... | [{"input": "\"11|15|59, 10|16|16, 12|17|20, 9|22|34, 13|19|34, 11|15|17, 11|22|00, 10|26|37, 12|17|48, 9|16|30, 12|20|14, 11|25|11\"", "output": "[\"Range: 04|03|04 Average: 11|14|36 Median: 11|18|59\"]", "fn_name": "stat"}, {"input": "\"1|15|59, 1|16|16, 1|17|20, 1|22|34, 1|19|34, 1|15|17, 1|22|00, 1|26|37, 1|17|48, 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\nA sequence $a_1, a_2, \\dots, a_n$ is called good if, for each element $a_i$, there exists an element $a_j$ (... | [{"input": "10\n3 10 14 1 10 12 5 16 5 2\n", "output": "4\n"}, {"input": "10\n3 10 14 1 10 8 5 16 5 2\n", "output": "4\n"}, {"input": "10\n3 10 9 1 10 8 5 16 5 2\n", "output": "6\n"}, {"input": "10\n2 10 9 1 10 4 7 8 5 4\n", "output": "5\n"}, {"input": "10\n2 10 9 1 10 4 5 8 5 4\n", "output": "8\n"}, {"input": "10\n3 1... | code_stdio |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.