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\nSereja showed an interesting game to his friends. The game goes like that. Initially, there is a table with a... | [{"input": "100 1000\n10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 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\nThere are N squares arranged in a row, numbered 1, 2, ..., N from left to right. You are given a string S of ... | [{"input": "15 -1 6 15 13\n...#.#...#.#...", "output": "Yes\n"}, {"input": "15 -1 3 15 11\n...#.#...#...#.", "output": "Yes\n"}, {"input": "16 -1 3 15 11\n...#.#...#...#.", "output": "Yes\n"}, {"input": "16 -1 3 15 13\n...#.#...#...#.", "output": "Yes\n"}, {"input": "20 -1 3 15 11\n...#.#...#...#.", "output": "Yes\n"},... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nYou are given a chessboard of size $n \\times n$. It is filled with numbers from $1$ to $n^2$ in the followin... | [{"input": "4 5\n2 1\n1 4\n5 3\n3 2\n2 4\n", "output": "11\n10\n10\n13\n4\n"}, {"input": "4 5\n2 1\n1 4\n5 3\n6 2\n2 4\n", "output": "11\n10\n10\n11\n4\n"}, {"input": "8 5\n2 1\n4 4\n4 3\n3 2\n2 4\n", "output": "37\n14\n46\n41\n6\n"}, {"input": "4 5\n4 1\n1 4\n5 3\n3 2\n2 4\n", "output": "15\n10\n10\n13\n4\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 is an integer sequence of length 2^N: A_0, A_1, ..., A_{2^N-1}. (Note that the sequence is 0-indexed.)\... | [{"input": "4\n75 26 45 72 81 47 97 97 2 2 25 82 84 17 56 32\n", "output": "101\n120\n147\n156\n156\n178\n194\n194\n194\n194\n194\n194\n194\n194\n194\n"}, {"input": "4\n75 26 45 112 81 47 97 97 2 2 25 95 84 17 56 32", "output": "101\n120\n187\n187\n187\n187\n209\n209\n209\n209\n209\n209\n209\n209\n209\n"}, {"input": "4... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nYou are given $n$ segments on a coordinate axis $OX$. The $i$-th segment has borders $[l_i; r_i]$. All points... | [{"input": "4\n4\n1 5\n2 4\n2 3\n3 4\n5\n1 5\n2 3\n2 5\n3 5\n2 2\n3\n1 3\n2 4\n2 3\n7\n1 10\n2 8\n2 5\n3 4\n4 4\n6 8\n7 7\n", "output": "3\n4\n2\n7\n"}, {"input": "4\n4\n1 5\n2 4\n2 3\n3 4\n5\n1 5\n2 3\n2 5\n3 5\n2 2\n3\n1 3\n2 4\n2 3\n7\n1 10\n2 8\n0 5\n3 4\n4 4\n6 8\n7 7\n", "output": "3\n4\n2\n6\n"}, {"input": "4\n4... | code_stdio |
[
{
"content": "You are an expert Python programmer. 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 string $s$ of length $3$, consisting of uppercase and lowercase English letters. Check if it is eq... | [{"input": "10\nYES\nyES\nyes\nYes\nYeS\nNoo\norZ\nyEz\nYas\nXES\n", "output": "YES\nYES\nYES\nYES\nYES\nNO\nNO\nNO\nNO\nNO\n"}, {"input": "2\nyes\nlll\n", "output": "YES\nNO\n"}, {"input": "1\nvop\n", "output": "NO\n"}, {"input": "1\nhac\n", "output": "NO\n"}, {"input": "1\nNNy\n", "output": "NO\n"}, {"input": "1\nHAC... | code_stdio |
[
{
"content": "You are an expert Python programmer. 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$ chains, the $i$-th chain consists of $c_i$ vertices. Vertices in each chain are numbered indepen... | [{"input": "3\n4\n3 4 3 6\n-1 1 2 2\n-2 2 2 3\n2\n5 10\n-2 5\n-1 1\n3\n10 5 2\n-1 1 2\n-1 10 5\n", "output": "10\n15\n15\n"}, {"input": "3\n4\n3 4 3 6\n-1 1 2 2\n-1 2 2 3\n2\n5 10\n-1 5\n-1 1\n3\n6 5 2\n-1 1 2\n-1 5 5\n", "output": "10\n15\n10\n"}, {"input": "3\n4\n1 4 3 6\n-1 1 2 2\n-1 2 2 3\n2\n5 13\n-1 5\n-1 1\n3\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\nAs behooves any intelligent schoolboy, Kevin Sun is studying psycowlogy, cowculus, and cryptcowgraphy at the ... | [{"input": "990037 453792\n", "output": "654009570\n"}, {"input": "498653 116674\n", "output": "625264514\n"}, {"input": "512287 359783\n", "output": "542484357\n"}, {"input": "337411 146419\n", "output": "532279245\n"}, {"input": "586189 189159\n", "output": "168174057\n"}, {"input": "613463 269592\n", "output": "3368... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nOnce upon a time in the Kingdom of Far Far Away lived Sir Lancelot, the chief Royal General. He was very prou... | [{"input": "1000 1000\n", "output": "500000\n"}, {"input": "997 1000\n", "output": "498500\n"}, {"input": "999 1000\n", "output": "499500\n"}, {"input": "1000 999\n", "output": "499500\n"}, {"input": "1000 998\n", "output": "499000\n"}, {"input": "1000 997\n", "output": "498500\n"}, {"input": "998 1000\n", "output": "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\nPaw the Spider is making a web. Web-making is a real art, Paw has been learning to do it his whole life. Let'... | [{"input": "20\n5 15 40 35 68 22\n6 70 19 28 69 63 1\n4 37 154 41 90\n7 11 148 35 94 55 59 64\n7 46 28 22 90 97 37 13\n5 62 45 34 50 94\n6 85 83 37 72 27 53\n6 46 56 116 71 49 33\n7 17 35 91 24 50 30 38\n2 75 12\n2 46 38\n1 61\n11 15 79 14 89 20 96 84 26 93 132 18\n1 75\n6 4 100 55 59 62 83\n5 48 44 37 12 6\n6 68 53 28... | code_stdio |
[
{
"content": "You are an expert Python programmer. 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 tree is a graph with n vertices and exactly n - 1 edges; this graph should meet the following condition: th... | [{"input": "12\n1 6\n10 1\n4 1\n7 1\n1 2\n5 1\n1 8\n1 11\n3 1\n12 1\n9 1\n580660007 861441526 -470133967 488291045 253254575 -974301934 709266786 926718320 87511873 514836444 -1167698791 848928657\n", "output": "2916057589\n"}, {"input": "12\n1 6\n10 1\n4 1\n7 1\n1 2\n4 1\n1 8\n1 11\n3 1\n12 1\n9 1\n580660007 861441526... | code_stdio |
[
{
"content": "You are an expert Python programmer. 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 polar bears are going fishing. They plan to sail from (s_{x}, s_{y}) to (e_{x}, e_{y}). However, the boat... | [{"input": "39 -1000000000 -1000000000 -999999997 -1000000000\nENEENWSWSSWESNSSEESNSESWSWNSWESNENWNWEE\n", "output": "4\n"}, {"input": "39 -1000000000 -1000000000 -999999997 -1000000000\nENEENWSWSSWESNSSEESNSESWSWNSWESNENWNWEE\n", "output": "4\n"}, {"input": "51 -1000000000 -1000000000 -999999997 -1000000000\nENEENWSWS... | code_stdio |
[
{
"content": "You are an expert Python programmer. 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 time is 2020. There is data that saves the qualifying results of PC Koshien 2020. This data stores the re... | [{"input": "1,20\n2,20\n3,30\n4,10\n5,10\n6,20\n0,0\n1\n2\n4\n1", "output": "2\n2\n3\n2\n"}, {"input": "1,20\n2,20\n3,30\n4,10\n5,10\n0,26\n0,0\n1\n2\n4\n1", "output": "3\n3\n4\n3\n"}, {"input": "1,20\n2,20\n3,30\n4,10\n5,10\n0,26\n0,0\n0\n2\n4\n1", "output": "2\n3\n4\n3\n"}, {"input": "1,20\n2,20\n3,30\n4,10\n5,10\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\nSonya decided that having her own hotel business is the best way of earning money because she can profit and ... | [{"input": "100 10\n-489 -476 -445 -432 -430 -421 -420 -418 -412 -411 -404 -383 -356 -300 -295 -293 -287 -276 -265 -263 -258 -251 -249 -246 -220 -219 -205 -186 -166 -157 -143 -137 -136 -130 -103 -86 -80 -69 -67 -55 -43 -41 -40 -26 -19 -9 16 29 41 42 54 76 84 97 98 99 101 115 134 151 157 167 169 185 197 204 208 226 227 ... | code_stdio |
[
{
"content": "You are an expert Python programmer. 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 concatenation of 10^{10} copies of the string 110. (For reference, the concatenation of 3 copies... | [{"input": "62089\n1101101101101101101101101101101101101101101101101101101101101101101101101101101101101101101101101101101101101101101101101101101101101101101101101101101101101101101101101101101101101101101101101101101101101101101101101101101101101101101101101101101101101101101101101101101101101101101101101101101101101... | code_stdio |
[
{
"content": "You are an expert Python programmer. 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\"Fukusekiken\" is a popular ramen shop where you can line up. But recently, I've heard some customers say, \... | [{"input": "5\n41\n27\n26", "output": "0\n28\n18\n23\n"}, {"input": "5\n24\n18\n13", "output": "0\n11\n15\n2\n"}, {"input": "5\n24\n27\n13", "output": "0\n11\n18\n2\n"}, {"input": "5\n29\n27\n26", "output": "0\n8\n18\n23\n"}, {"input": "5\n24\n12\n13", "output": "0\n11\n3\n2\n"}, {"input": "5\n24\n34\n13", "output": "0... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nRecently, the Fair Nut has written $k$ strings of length $n$, consisting of letters \"a\" and \"b\". He calcu... | [{"input": "100 1000000000\nbbabbaabbbaaaaabbabbbaaabbbbabaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaabbaabbbbabaabbbabbaaaaabbbbaab\nbbabbaabbbaaaaabbabbbaaabbbbabbaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaababbbabbbbaaaaabbaaaaaaaab\n", "output": "41073741883\n"}, {"input": "100 1000000000\nabbbbabababaabaabaabbababaabbb... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nIt's a walking tour day in SIS.Winter, so $t$ groups of students are visiting Torzhok. Streets of Torzhok are... | [{"input": "16\n4\nPPPP\n4\nAPPP\n4\nPAPP\n4\nAAPP\n4\nPPAP\n4\nAPAP\n4\nPAAP\n4\nAAAP\n4\nPPPA\n4\nAPPA\n4\nPAPA\n4\nAAPA\n4\nPPAA\n4\nAPAA\n4\nPAAA\n4\nAAAA\n", "output": "0\n3\n2\n2\n1\n1\n1\n1\n0\n2\n1\n1\n0\n1\n0\n0\n"}, {"input": "16\n4\nPPPP\n4\nAPPP\n4\nPAPP\n4\nAAPP\n4\nPPAP\n4\nAPAP\n4\nPAAP\n4\nAAAP\n4\nPPPA... | code_stdio |
[
{
"content": "You are an expert Python programmer. 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 some day in January 2018, Takaki is writing a document. The document has a column where the current date i... | [{"input": "2017/01/07\n", "output": "2018/01/07\n"}, {"input": "2017/01/31\n", "output": "2018/01/31\n"}, {"input": "2017/01/06", "output": "2018/01/06\n"}, {"input": "2017/01/32", "output": "2018/01/32\n"}, {"input": "2017/01//7", "output": "2018/01//7\n"}, {"input": "2010/01/77", "output": "2018/01/77\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\nElections in Berland are coming. There are only two candidates β Alice and Bob.\n\nThe main Berland TV channe... | [{"input": "54\n10 13\n10 45\n10 51\n01 44\n10 24\n10 26\n10 39\n10 38\n10 41\n10 33\n10 18\n10 12\n10 38\n10 30\n11 31\n10 46\n11 50\n00 26\n00 29\n00 50\n10 16\n10 40\n10 50\n00 43\n10 48\n10 32\n10 18\n10 8\n10 24\n10 32\n10 52\n00 41\n10 37\n10 38\n10 49\n00 35\n10 52\n00 44\n10 41\n10 36\n00 28\n00 43\n10 36\n00 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## The Riddle\n\nThe King of a small country invites 1000 senators to his annual party. As a tradition, each ... | [{"input": "[3, 5, 6, 7, 8, 9]", "output": "[1000]", "fn_name": "find"}, {"input": "[0, 3, 5, 4, 9, 8]", "output": "[825]", "fn_name": "find"}, {"input": "[0, 1, 2, 3, 4, 6]", "output": "[95]", "fn_name": "find"}, {"input": "[0, 1, 9, 3, 5]", "output": "[555]", "fn_name": "find"}, {"input": "[0, 1, 3, 4]", "output": "[... | code_functional |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nYou are given an n Γ m rectangular table consisting of lower case English letters. In one operation you can c... | [{"input": "4 100\ngdgmmejiigzsmlarrnfsypvlbutvoxazcigpcospgztqkowfhhbnnbxxrbmwbxwkvxlxzabjjjdtbebedukdelooqlxnadjwjpnp\ndmtsnsbsfdzqvydxcdcnkkfcbseicxhvclsligbhqlkccwujpirymoshkqcosbtlxdypsdqkqaolrqtiibymavcwmbfryttdckhx\nqwujylxpxechsqxqwnxtanhpwenvbdgxighxkklpjtnowrcusxgezlnutcxrauuoqwmlsfzhcyqovfamqqvnzouuicpcjldpm... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nAssume that you have $k$ one-dimensional segments $s_1, s_2, \\dots s_k$ (each segment is denoted by two inte... | [{"input": "1\n10\n1 2\n1 3\n2 4\n2 5\n2 6\n3 7\n3 8\n4 9\n4 10\n", "output": "10\n"}, {"input": "1\n10\n1 2\n2 3\n1 4\n2 5\n4 6\n6 7\n3 8\n4 9\n4 10\n", "output": "10\n"}, {"input": "1\n10\n1 2\n1 3\n1 4\n2 5\n2 6\n6 7\n1 8\n4 9\n4 10\n", "output": "10\n"}, {"input": "1\n10\n1 2\n1 3\n2 4\n2 5\n2 6\n3 7\n1 8\n4 9\n4 1... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nThe only difference between easy and hard versions is on constraints. In this version constraints are lower. ... | [{"input": "32\n3 1 3\n2 2 1\n3 1 3\n2 2 2\n3 1 3\n2 2 3\n3 1 3\n2 3 1\n3 1 3\n2 3 2\n3 1 3\n2 3 3\n3 1 3\n3 1 1\n3 1 3\n3 1 2\n3 1 3\n3 1 3\n3 1 3\n3 2 1\n3 1 3\n3 2 2\n3 1 3\n3 2 3\n3 1 3\n3 3 1\n3 1 3\n3 3 2\n3 1 3\n3 3 3\n3 2 1\n1 1 1\n3 2 1\n1 1 2\n3 2 1\n1 1 3\n3 2 1\n1 2 1\n3 2 1\n1 2 2\n3 2 1\n1 2 3\n3 2 1\n1 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\nAfter the mysterious disappearance of Ashish, his two favourite disciples Ishika and Hriday, were each left w... | [{"input": "20\n9 15 11 8 10 5 19 13 12 18 3 20 17 14 2 16 7 4 1 6\n12 6 7 5 4 20 15 14 1 18 10 17 9 19 16 3 13 11 2 8\n", "output": "2\n"}, {"input": "20\n9 15 11 8 10 5 19 13 12 18 3 20 17 14 2 16 7 4 1 6\n12 6 7 5 4 20 15 14 1 18 10 17 9 19 16 3 13 11 2 8\n", "output": "2"}, {"input": "18\n11 16 18 3 7 12 10 6 14 15... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nThe Little Elephant likes permutations. This time he has a permutation A[1], A[2], ..., A[N] of numbers 1, 2,... | [{"input": "4\n0\n1\n2\n0 1\n3\n0 1 2\n4\n1 3 2 4", "output": "YES\nYES\nYES\nYES\n"}, {"input": "4\n0\n1\n2\n0 1\n3\n11 1 1\n4\n1 3 2 -1", "output": "YES\nYES\nNO\nNO\n"}, {"input": "4\n-1\n1\n1\n0 1\n3\n3 0 1\n4\n1 3 2 4", "output": "YES\nYES\nNO\nYES\n"}, {"input": "4\n0\n1\n2\n0 1\n3\n3 -1 0\n4\n1 3 2 4", "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\nShinya watched a program on TV called \"Maya's Great Prophecy! Will the World End in 2012?\" After all, I was... | [{"input": "2012.12.31\n2.11.16.14.14\n7138.4.03\n10.5.5.1.2\n10000000.12.31\n#", "output": "0.0.0.0.10\n3034.11.28\n12.19.19.16.10\n6059.2.10\n8.19.3.13.2\n"}, {"input": "2312.02.12\n2.12.16.14.14\n7128.5.13\n5.1.5.2.01\n10020000.10.31\n#", "output": "0.15.3.8.19\n3054.8.15\n12.19.9.15.18\n4009.1.7\n7.13.14.14.11\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\nCirno_9baka has a tree with $n$ nodes. He is willing to share it with you, which means you can operate on it.... | [{"input": "15 6\n11 8\n9 12\n7 12\n14 13\n12 4\n12 13\n1 7\n10 6\n12 8\n3 5\n3 2\n15 2\n6 8\n12 2\n4 14 11 10 2\n4 12 5 8 9\n", "output": "32"}, {"input": "15 2\n5 1\n15 8\n9 3\n2 10\n15 13\n12 1\n14 15\n2 1\n6 15\n13 7\n11 1\n1 15\n15 4\n1 9\n1 14\n7 5 15 1 7 11 2 13\n", "output": "16"}, {"input": "15 2\n4 13\n8 5\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\nIt is a complicated version of problem F1. The difference between them is the constraints (F1: $k \\le 2$, F2... | [{"input": "6\n2021 3\n177890 2\n34512 3\n724533 4\n998244353 1\n12345678 10\n", "output": "2021\n181111\n34533\n724542\n999999999\n12345678\n"}, {"input": "6\n2021 3\n177890 2\n34512 3\n724533 4\n998244353 1\n12345678 10\n", "output": "2021\n181111\n34533\n724542\n999999999\n12345678\n"}, {"input": "6\n2021 3\n177890 ... | code_stdio |
[
{
"content": "You are an expert Python programmer. 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 toy building consisting of $n$ towers. Each tower consists of several cubes standing on each other... | [{"input": "10 10\n1 1 1 1 1 1 1 1 1 1\n", "output": "0\n"}, {"input": "10 10\n3 3 3 3 3 3 3 3 3 3\n", "output": "0\n"}, {"input": "10 10\n1 1 1 1 1 1 1 1 1 1\n", "output": "0\n"}, {"input": "10 10\n3 3 3 3 3 3 3 3 3 3\n", "output": "0\n"}, {"input": "10 10\n1 1 1 1 2 1 1 1 1 1\n", "output": "1\n"}, {"input": "10 10\n3... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nAnton's favourite geometric figures are regular polyhedrons. Note that there are five kinds of regular polyhe... | [{"input": "28\nOctahedron\nDodecahedron\nOctahedron\nOctahedron\nDodecahedron\nIcosahedron\nIcosahedron\nDodecahedron\nDodecahedron\nDodecahedron\nCube\nDodecahedron\nCube\nTetrahedron\nCube\nCube\nTetrahedron\nDodecahedron\nDodecahedron\nDodecahedron\nIcosahedron\nIcosahedron\nDodecahedron\nIcosahedron\nDodecahedron\... | code_stdio |
[
{
"content": "You are an expert Python programmer. 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 problem was inspired by Pied Piper story. After a challenge from Hooli's compression competitor Nucleus, ... | [{"input": "6\n7\ncontest\nntecost\n7\ncontest\nnsttdco\n7\ncontest\ntnsteco\n7\ncontess\ncotestn\n7\ncontest\ncontest\n7\nontestc\ncontest\n", "output": "3\n-1\n4\n-1\n0\n1\n"}, {"input": "6\n7\ncontest\nntecost\n7\ncontest\nnstteco\n7\ncontest\ntnsteco\n7\ncontess\ncotestn\n7\ncontest\ncontest\n7\nontestc\ncontest\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 Beroil corporation structure is hierarchical, that is it can be represented as a tree. Let's examine the ... | [{"input": "ZLWSYH:WNMTNAI:FTCKPGZBJ.,UZSCFZVXXK.,LNGCU.,TCT.,LNGCU.,U.,NEHYSET..,FBLI:NEHYSET:IFY..,VN.,VN.,IFY.,FBLI.,YH.,FBLI.,DTXG.,NEHYSET.,WNMTNAI.,VN.,SVXN.,NEHYSET.,TCT.,DTXG..,UZSCFZVXXK:KZQRJFST.,FTCKPGZBJ.,WNMTNAI.,SVXN:DHONBXRZAL..,NEHYSET.,IFY..,MPOEEMVOP:DHONBXRZAL.,DTXG.,FTCKPGZBJ..,KZQRJFST:SVXN.,SVXN..... | code_stdio |
[
{
"content": "You are an expert Python programmer. 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 were lucky enough to get a map just before entering the legendary magical mystery world. The map shows th... | [{"input": "6\nBlizid\n0 0\n60 -1\n60 60\n0 60\n0 50\n50 50\n50 10\n0 10\n-1\nBlizid\n0 10\n10 10\n10 50\n0 50\n-1\nWindom\n10 10\n50 10\n40 20\n20 20\n20 40\n10 50\n-1\nAccent\n50 10\n50 50\n35 50\n35 25\n-1\nPilot\n35 25\n35 50\n19 50\n-1\nBlizid\n20 20\n40 20\n20 40\n-1\n4\nA1234567890123456789\n0 0\n0 100\n100 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\nRunning with barriers on the circle track is very popular in the country where Dasha lives, so no wonder that... | [{"input": "50 100\n0 2 4 6 8 10 12 14 16 18 20 22 24 26 28 30 32 34 36 38 40 42 44 46 48 50 52 54 56 58 60 62 64 66 68 70 72 74 76 78 80 82 84 86 88 90 92 94 96 98\n1 3 5 7 9 11 13 15 17 19 21 23 25 27 29 31 33 35 37 39 41 43 45 47 49 51 53 55 57 59 61 63 65 67 69 71 73 75 77 79 81 83 85 87 89 91 93 95 97 99\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\ncoastline\n\nWaves rush to the beach every second. There is data that observes and records how many meters th... | [{"input": "5 2 3\n3\n2\n1\n2\n6\n3 100 100\n5\n3\n4\n20 2 8\n3\n2\n10\n1\n14\n1\n1\n4\n2\n2\n16\n1\n8\n8\n2\n6\n3\n8\n3\n8\n7 2 2\n0\n2\n5\n2\n5\n2\n-1\n0 0 0", "output": "2\n0\n11\n5\n"}, {"input": "5 2 3\n3\n2\n1\n2\n6\n3 110 100\n5\n3\n4\n20 2 3\n3\n2\n10\n1\n14\n1\n1\n4\n2\n2\n16\n1\n8\n8\n2\n6\n3\n8\n3\n8\n7 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\nToday on a lecture about strings Gerald learned a new definition of string equivalency. Two strings a and b o... | [{"input": "yhwepqwyhwepqwyhwepqweahnqtueahnqtueahnqtuyhwepqwyhwepqwyhwepqwyhwepqweahnqtueahnqtuyhwepqweahnqtueahnqtueahnqtueahnqtueahnqtueahnqtu\neahnqtueahnqtueahnqtuyhwepqweahnqtuyhwepqwyhwepqweahnqtuyhwepqweahnqtuyhwepqweahnqtueahnqtuyhwepqweahnqtueahnqtuyhwepqwyhwepqwyhwepqw\n", "output": "NO\n"}, {"input": "yhwep... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n[Image] \n\n\n-----Input-----\n\nThe input contains a single integer $a$ ($0 \\le a \\le 15$).\n\n\n-----Outp... | [{"input": "000\n", "output": "15\n"}, {"input": "3\n", "output": "13\n"}, {"input": "0\n", "output": "15\n"}, {"input": "1\n", "output": "14\n"}, {"input": "2\n", "output": "12\n"}, {"input": "6\n", "output": "10\n"}, {"input": "7\n", "output": "11\n"}, {"input": "10\n", "output": "2\n"}, {"input": "11\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\n###Lucky number\n\nWrite a function to find if a number is lucky or not. If the sum of all digits is 0 or mul... | [{"input": "1892231413243242344321432142343423437", "output": "[true]", "fn_name": "is_lucky"}, {"input": "18922314324324234423437", "output": "[false]", "fn_name": "is_lucky"}, {"input": "189223141324324234423437", "output": "[true]", "fn_name": "is_lucky"}, {"input": "1892376", "output": "[true]", "fn_name": "is_luck... | code_functional |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nCreate a function finalGrade, which calculates the final grade of a student depending on two parameters: a gr... | [{"input": "100\n12", "output": "[100]", "fn_name": "final_grade"}, {"input": "10\n15", "output": "[100]", "fn_name": "final_grade"}, {"input": "99\n0", "output": "[100]", "fn_name": "final_grade"}, {"input": "85\n5", "output": "[90]", "fn_name": "final_grade"}, {"input": "55\n3", "output": "[75]", "fn_name": "final_gr... | 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\nSmart Beaver recently got interested in a new word game. The point is as follows: count the number of distinc... | [{"input": "hrsszhjvrbsszvqesessiqbzeqijjerqirhhjsehiehezvzihzssivhvihrivrhizeqvvhejvibhqrbbqjrjsessvrhijzsrqirvsqqbibzhrzseijesszsrzhjjbqsrjrsrizivvhsjvqz\n3\nrzzevhiibziqiirhsebebrvrvvjihsjhvjjrejvqezireqevqeszrrseriijijijveqzbsbrezqhrrhbshqrhzshjervqjjzveeqsisrbevvjvjhbzvbjrrvizh 0 122\niqqqjirjjhrbrerhssszbqqizzhre... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSkier rides on a snowy field. Its movements can be described by a string of characters 'S', 'N', 'W', 'E' (wh... | [{"input": "1\nENNNNNNNNNNNSSSSSSSSSSSEEEEEEEEEEN\n", "output": "126\n"}, {"input": "1\nNEEEEEEEEEEEWWWWWWWWWWWNNNNNNNNNNE\n", "output": "126\n"}, {"input": "1\nENNNNNNNNNNNSSSSSSSNSSSEEEEEEEEEES\n", "output": "126\n"}, {"input": "1\nNNNNNNNNNNNESSSSSSSNSSSEEEEEEEEEES\n", "output": "162\n"}, {"input": "1\nNNNNSNNNNNNES... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nBalph is learning to play a game called Buma. In this game, he is given a row of colored balls. He has to cho... | [{"input": "WWWOONOOOWWW\n", "output": "0\n"}, {"input": "WWWOONOOOVWW\n", "output": "0\n"}, {"input": "WVWOONOOOVWW\n", "output": "0\n"}, {"input": "WOWOONVOOVWW\n", "output": "0\n"}, {"input": "WOWONOVOOVWW\n", "output": "0\n"}, {"input": "WWVOOVONOWOW\n", "output": "0\n"}, {"input": "WWVPOVONOWOW\n", "output": "0\n"... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nEvery day, N passengers arrive at Takahashi Airport. The i-th passenger arrives at time T_i.\n\nEvery passeng... | [{"input": "6 4 3\n11\n6\n2\n13\n17\n5", "output": "4\n"}, {"input": "6 4 3\n11\n9\n2\n13\n17\n5", "output": "4\n"}, {"input": "6 3 3\n7\n6\n2\n13\n17\n5", "output": "4\n"}, {"input": "6 3 3\n7\n6\n2\n13\n10\n6", "output": "3\n"}, {"input": "6 3 6\n7\n6\n2\n13\n10\n6", "output": "2\n"}, {"input": "6 3 6\n7\n6\n2\n22\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\nOne day, at the \"Russian Code Cup\" event it was decided to play football as an out of competition event. Al... | [{"input": "263 51\n", "output": "13413\n1 2\n1 3\n1 4\n1 5\n1 6\n1 7\n1 8\n1 9\n1 10\n1 11\n1 12\n1 13\n1 14\n1 15\n1 16\n1 17\n1 18\n1 19\n1 20\n1 21\n1 22\n1 23\n1 24\n1 25\n1 26\n1 27\n1 28\n1 29\n1 30\n1 31\n1 32\n1 33\n1 34\n1 35\n1 36\n1 37\n1 38\n1 39\n1 40\n1 41\n1 42\n1 43\n1 44\n1 45\n1 46\n1 47\n1 48\n1 49\... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n$n$ robots have escaped from your laboratory! You have to find them as soon as possible, because these robots... | [{"input": "4\n2\n-1 -2 0 0 0 0\n-1 -2 0 0 0 0\n3\n1 5 1 1 1 1\n2 5 0 0 0 1\n4 5 1 0 0 1\n2\n754 1337 0 1 1 1\n1336 1337 1 1 0 1\n1\n3 5 1 1 1 1\n", "output": "1 -1 -2\n1 2 -100000\n1 754 -100000\n1 -100000 -100000\n"}, {"input": "4\n2\n-1 -2 0 0 0 0\n-1 -2 0 0 0 0\n3\n1 5 1 1 1 1\n2 5 0 0 0 1\n4 5 1 0 0 1\n2\n754 1337... | code_stdio |
[
{
"content": "You are an expert Python programmer. 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 square table sized NxN (3 β€ N β€ 5,000; rows and columns are indexed from 1) with a robot on it. The r... | [{"input": "2 4\n0 3\n3 9\n0 0", "output": "712406685\n49980002\n436378119\n"}, {"input": "2 2\n0 3\n3 9\n0 0", "output": "774058230\n49980002\n436378119\n"}, {"input": "2 2\n4 33\n6 3\n0 0", "output": "774058230\n361127130\n32\n"}, {"input": "2 2\n4 33\n5 3\n0 0", "output": "774058230\n361127130\n18\n"}, {"input": "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\nVasya is interested in arranging dominoes. He is fed up with common dominoes and he uses the dominoes of diff... | [{"input": "10\n34 9\n-41 26\n-101 32\n1 10\n105 14\n92 7\n-45 35\n75 19\n-23 2\n-46 8\n", "output": "1 2 1 1 1 1 3 2 1 4\n"}, {"input": "10\n34 9\n-41 26\n-101 17\n1 10\n105 14\n92 7\n-45 35\n75 19\n-23 2\n-46 8\n", "output": "1 2 1 1 1 1 3 2 1 4\n"}, {"input": "10\n64 9\n-41 26\n-101 17\n1 10\n105 14\n92 7\n-45 35\n7... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nWilliam really likes the cellular automaton called \"Game of Life\" so he decided to make his own version. Fo... | [{"input": "4\n10 1\n1111111111\n9 4\n000000000\n9 4\n000000000\n9 4\n000000000\n", "output": "1111111111\n000000000\n000000000\n000000000\n"}, {"input": "4\n10 1\n1111111111\n9 4\n000000000\n9 4\n000000000\n9 4\n000000000\n", "output": "1111111111\n000000000\n000000000\n000000000\n"}, {"input": "4\n10 1\n1111111111\n9... | code_stdio |
[
{
"content": "You are an expert Python programmer. 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 Jambo Amusement Garden (JAG), you sell colorful drinks consisting of multiple color layers. This color... | [{"input": "4\nred 3444\nred 3018\nred 3098\nred 3319\n4\nred\nred\nrec\nred", "output": "No\n"}, {"input": "4\nred 3444\nder 3018\nred 3098\nred 3319\n4\nred\nred\nrec\nred", "output": "No\n"}, {"input": "4\nred 2133\nder 3018\nred 3098\nred 3319\n4\nred\nred\nrec\nred", "output": "No\n"}, {"input": "4\nred 2133\nder ... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nQuantum mechanics tells us that a molecule is only allowed to have specific, discrete amounts of internal ene... | [{"input": "423\n100\n150", "output": "[[4272300, 4357746, 4444038, 4531176, 4619160, 4707990, 4797666, 4888188, 4979556, 5071770, 5164830, 5258736, 5353488, 5449086, 5545530, 5642820, 5740956, 5839938, 5939766, 6040440, 6141960, 6244326, 6347538, 6451596, 6556500, 6662250, 6768846, 6876288, 6984576, 7093710, 7203690, ... | code_functional |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nThere are N squares numbered 1 to N from left to right. Each square has a character written on it, and Square... | [{"input": "10 15\nSNCZWRCEWB\nB R\nR R\nE R\nW R\nZ L\nS R\nQ L\nW L\nB R\nC L\nA L\nN L\nE R\nZ L\nR L", "output": "7\n"}, {"input": "10 15\nBWECRWZCNS\nB R\nR R\nE R\nW R\nZ L\nS R\nQ L\nW L\nB R\nC L\nA L\nN L\nE R\nZ L\nR L", "output": "9\n"}, {"input": "10 0\nSNCZWRCEWB\nB R\nR R\nE R\nX R\nZ L\nS R\nQ L\nW L\nB ... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nPashmak decided to give Parmida a pair of flowers from the garden. There are n flowers in the garden and the ... | [{"input": "10\n1000000000 1100000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000010000 1000000000\n", "output": "100000000 8\n"}, {"input": "10\n1000000000 1100000000 1000000100 1000000000 1000000000 1000000000 1000000000 1000000000 1000010000 1000000000\n", "output": "100000000 7\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\nAs Sherlock Holmes was investigating another crime, he found a certain number of clues. Also, he has already ... | [{"input": "30 70 288262020\n27 18\n5 19\n23 17\n16 17\n29 17\n1 22\n23 5\n10 13\n22 26\n14 3\n8 3\n29 9\n9 1\n3 9\n16 4\n9 22\n10 22\n20 1\n3 7\n23 19\n26 8\n24 1\n5 7\n28 29\n20 11\n16 12\n6 9\n24 29\n30 4\n5 26\n18 21\n5 21\n30 6\n12 13\n16 23\n28 14\n30 1\n7 27\n7 19\n27 17\n5 30\n30 27\n28 30\n12 28\n27 9\n30 26\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 the current time in 24-hour format hh:mm. Find and print the time after a minutes.\n\nNote that... | [{"input": "12:34\n10000\n", "output": "11:14\n"}, {"input": "00:00\n10000\n", "output": "22:40\n"}, {"input": "00:00\n10000\n", "output": "22:40\n"}, {"input": "12:34\n10000\n", "output": "11:14\n"}, {"input": "00:00\n00000\n", "output": "00:00\n"}, {"input": "14:32\n10000\n", "output": "13:12\n"}, {"input": "00:00\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\nNickname Generator\n\nWrite a function, `nicknameGenerator` that takes a string name as an argument and retur... | [{"input": "\"Sam\"", "output": "[\"Error: Name too short\"]", "fn_name": "nickname_generator"}, {"input": "\"Jam\"", "output": "[\"Error: Name too short\"]", "fn_name": "nickname_generator"}, {"input": "\"Suv\"", "output": "[\"Error: Name too short\"]", "fn_name": "nickname_generator"}, {"input": "\"Ni\"", "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\nProblem statement\n\nThere is a positive integer sequence $ a_1, a_2, \\ ldots, a_N $ of length $ N $.\n\nCon... | [{"input": "2\n10 -2", "output": "Second\n"}, {"input": "2\n-1 10", "output": "First\n"}, {"input": "2\n-2 2", "output": "Second\n"}, {"input": "2\n-2 4", "output": "Second\n"}, {"input": "2\n-2 8", "output": "Second\n"}, {"input": "2\n0 -2", "output": "Second\n"}, {"input": "2\n0 10", "output": "Second\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\nGiven a positive integer $k$, two arrays are called $k$-similar if:\n\nthey are strictly increasing;\n\nthey ... | [{"input": "6 5 15\n2 5 6 7 8 15\n1 2\n1 1\n5 5\n5 6\n4 5\n", "output": "15\n14\n14\n19\n13\n"}, {"input": "6 5 15\n2 5 6 4 8 15\n1 2\n1 1\n5 5\n5 6\n4 5\n", "output": "15\n14\n14\n19\n16\n"}, {"input": "6 5 13\n2 4 6 7 8 12\n1 4\n1 3\n3 5\n2 2\n5 5\n", "output": "11\n12\n10\n12\n12\n"}, {"input": "6 5 20\n2 5 6 7 8 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\nStepan has a very big positive integer.\n\nLet's consider all cyclic shifts of Stepan's integer (if we look a... | [{"input": "8460711003592660299377170851036141857177105821455679225940496548902563144980707248030407967017317182\n13315371\n", "output": "16290\n"}, {"input": "8460711003592660299377170851036141857177105821455679225940496548902563144980707248030407967017317182\n6886527\n", "output": "136104\n"}, {"input": "846071100359... | code_stdio |
[
{
"content": "You are an expert Python programmer. 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 and some bears are playing a game just for fun. Mike is the judge. All bears except Mike are standing in... | [{"input": "5 5 30\n0 1 1 1 0\n1 1 0 1 1\n0 1 1 1 1\n0 0 1 1 0\n0 0 0 0 0\n3 2\n2 2\n2 2\n4 3\n1 4\n3 2\n4 1\n2 4\n1 4\n2 1\n5 2\n4 1\n4 1\n5 1\n2 4\n2 4\n4 4\n1 2\n3 1\n4 5\n1 2\n2 3\n1 1\n5 1\n3 4\n1 1\n5 4\n1 5\n5 4\n2 2\n", "output": "3\n3\n3\n3\n3\n4\n4\n4\n4\n4\n4\n4\n4\n4\n4\n4\n4\n4\n5\n5\n5\n5\n5\n5\n4\n3\n3\n... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nVasya is very upset that many people on the Net mix uppercase and lowercase letters in one word. That's why h... | [{"input": "XHRPXZEGHSOCJPICUIXSKFrZUPYTSGJSDIYBCMNMNBPNDBXLXBzhbfnqvwcffvUdhtickyqhupmcehlsyvncqmfhautvxudqdhgg\n", "output": "xhrpxzeghsocjpicuixskfrzupytsgjsdiybcmnmnbpndbxlxbzhbfnqvwcffvudhtickyqhupmcehlsyvncqmfhautvxudqdhgg\n"}, {"input": "RJIQZMJzIMSNDBOHBRAWIENODSALETAKGKPYUFGVEFGCBRENZGAdkcetqjljtmttlonpekcovdz... | code_stdio |
[
{
"content": "You are an expert Python programmer. 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 K 500-yen coins. (Yen is the currency of Japan.)\nIf these coins add up to X yen or more, print... | [{"input": "100 100000\n", "output": "No\n"}, {"input": "84 42001\n", "output": "No\n"}, {"input": "13 6498\n", "output": "Yes\n"}, {"input": "4 2000\n", "output": "Yes\n"}, {"input": "13 1282", "output": "Yes\n"}, {"input": "10 1282", "output": "Yes\n"}, {"input": "2 900\n", "output": "Yes\n"}, {"input": "1 500\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\nPupils Alice and Ibragim are best friends. It's Ibragim's birthday soon, so Alice decided to gift him a new p... | [{"input": "50\n0 1 1 1 0 0 1 1 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 1 0 0 0 0 0 0 0 0 0 0 1 1 0 0 0 0 0 0 0 0 1 0\n0 0 0 1 0 1 0 0 0 1 0 1 1 1 0 0 0 0 0 1 0 1 0 0 1 1 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 1 0 0 1 0 0 0 1\n0 0 0 0 1 1 0 0 1 0 0 0 1 0 0 0 1 1 0 0 0 0 1 0 0 0 1 0 0 1 0 0 0 0 0 0 0 1 0 0 1 0 1 1 0 0 1 0 0 0\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\nIvan likes to learn different things about numbers, but he is especially interested in really big numbers. Iv... | [{"input": "1000000000000000000 100000000000000000\n", "output": "899999999999999991\n"}, {"input": "1000000000000000000 200000000000000000\n", "output": "799999999999999991\n"}, {"input": "1000000000000000000 100000000000000000\n", "output": "899999999999999991\n"}, {"input": "1000000000000000000 200000000000000000\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\nIntegral numbers can be even or odd.\n\nEven numbers satisfy `n = 2m` ( with `m` also integral ) and we will ... | [{"input": "[1, 3, 5, 7]", "output": "[7]", "fn_name": "oddest"}, {"input": "[-1, -1]", "output": "[null]", "fn_name": "oddest"}, {"input": "[-1, 0, 1]", "output": "[-1]", "fn_name": "oddest"}, {"input": "[-5, 3]", "output": "[null]", "fn_name": "oddest"}, {"input": "[1, 5]", "output": "[null]", "fn_name": "oddest"}, {... | 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\nQuite recently, a very smart student named Jury decided that lectures are boring, so he downloaded a game cal... | [{"input": "1809 1302 7164 6122\n3144121413113111223311232232114144321414421243443243422322144324121433444342231344234443332241322442\n", "output": "420780\n"}, {"input": "1809 1302 7164 6122\n3144121413113111223311232232114144321414421243443243422322144324121433444342231344234443332241322442\n", "output": "420780\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\nLittle Petya likes numbers a lot. He found that number 123 in base 16 consists of two digits: the first is 7 ... | [{"input": "1209\n", "output": "263450/1207\n"}, {"input": "1869\n", "output": "627063/1867\n"}, {"input": "1865\n", "output": "623876/1863\n"}, {"input": "1343\n", "output": "325366/1341\n"}, {"input": "1440\n", "output": "371753/1438\n"}, {"input": "1109\n", "output": "222215/1107\n"}, {"input": "1030\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\nThis is the hard version of the problem. The only difference is that in this version 1 β€ q β€ 10^5. You can ma... | [{"input": "3\n2 3 9\n0 1\n5\n-1 0 0 -100000 000000\n", "output": "120\n119\n119\n120\n119\n"}, {"input": "3\n2 3 9\n0 1\n5\n0 0 0 -100000 000000\n", "output": "119\n119\n119\n120\n119\n"}, {"input": "3\n4 5 4\n2 1\n5\n-1 0 1 -100000 100100\n", "output": "146\n113\n51\n150\n0\n"}, {"input": "3\n5 4 4\n2 1\n5\n-1 0 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\n# Task\n\nJohn is a programmer. He treasures his time very much. He lives on the `n` floor of a building. Eve... | [{"input": "5\n6\n[1, 2, 3, 10]", "output": "[12]", "fn_name": "shortest_time"}, {"input": "5\n5\n[1, 2, 3, 10]", "output": "[11]", "fn_name": "shortest_time"}, {"input": "2\n2\n[2, 3, 4, 10]", "output": "[10]", "fn_name": "shortest_time"}, {"input": "5\n4\n[1, 2, 3, 10]", "output": "[12]", "fn_name": "shortest_time"},... | 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\nAnia has a large integer $S$. Its decimal representation has length $n$ and doesn't contain any leading zeroe... | [{"input": "400 224\n34034718296316650556302576767095880542740697596682657060609028712014739414658241556774411582749368771597248873201583574900424227251655547840887764275893533353440635216728376201808545879398359535670372855472971530695051695650262058940466340529417646357776899296790403916961389072619545914097176242329... | code_stdio |
[
{
"content": "You are an expert Python programmer. 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 Robot is in a rectangular maze of size n Γ m. Each cell of the maze is either empty or occupied by an obs... | [{"input": "20 20 118\n..............*.....\n........*.........*.\n............*.......\n*...................\n....*......*..*.....\n................*...\n....................\n...............*....\n.......*..........*.\n.*..........*.......\n.*..............*..X\n....................\n...............*....\n.............. | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nDifference of Big Integers\n\nGiven two integers $A$ and $B$, compute the difference, $A - B$.\n\nInput\n\nTw... | [{"input": "-2 -1280", "output": "1278\n"}, {"input": "-2 -1243", "output": "1241\n"}, {"input": "-2 -2265", "output": "2263\n"}, {"input": "-1 -2265", "output": "2264\n"}, {"input": "-1 -2368", "output": "2367\n"}, {"input": "-1 -2335", "output": "2334\n"}, {"input": "-2 -2335", "output": "2333\n"}, {"input": "0 -2335... | code_stdio |
[
{
"content": "You are an expert Python programmer. 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 weight of a sequence is defined as the number of unordered pairs of indexes $(i,j)$ (here $i \\lt j$) wit... | [{"input": "2\n4\n2 2 2 2\n4\n1 3 3 4\n", "output": "15\n4\n"}, {"input": "2\n4\n2 2 2 2\n4\n1 4 3 4\n", "output": "15\n2\n"}, {"input": "2\n4\n2 2 2 2\n4\n1 2 3 4\n", "output": "15\n0\n"}, {"input": "2\n4\n1 2 3 1\n4\n1 4 11 4\n", "output": "1\n2\n"}, {"input": "2\n4\n1 6 4 2\n4\n1 10 1 4\n", "output": "0\n2\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\nFor a permutation P[1... N] of integers from 1 to N, function f is defined as follows:\n\n $f(i, j) = \\left\... | [{"input": "10 7 5\n", "output": "2 3 4 5 1 7 8 9 10 6 "}, {"input": "10 7 5\n", "output": "2 3 4 5 1 7 8 9 10 6 "}, {"input": "9 2 5\n", "output": "2 1 4 3 6 7 8 9 5 "}, {"input": "9 7 9\n", "output": "2 3 4 5 6 7 8 9 1 "}, {"input": "9 2 5\n", "output": "2 1 4 3 6 7 8 9 5 "}, {"input": "9 7 9\n", "output": "2 3 4 5 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'll be given a string, and have to return the total of all the unicode characters as an int. Should be abl... | [{"input": "\"Mary Had A Little Lamb\"", "output": "[1873]", "fn_name": "uni_total"}, {"input": "\"Mary had a little lamb\"", "output": "[2001]", "fn_name": "uni_total"}, {"input": "\"And so does Strive\"", "output": "[1661]", "fn_name": "uni_total"}, {"input": "\"CodeWars rocks\"", "output": "[1370]", "fn_name": "uni_... | 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 three numbers $n, a, b$. You need to find an adjacency matrix of such an undirected graph that the numb... | [{"input": "191 1 1\n", "output": "YES\n01000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000\n101000000000000000000000000000000000000000000000000000000000000000000000000000000000000... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n##Task:\n\nYou have to write a function **pattern** which creates the following pattern upto n number of rows... | [{"input": "6", "output": "[\"22\\n4444\\n666666\"]", "fn_name": "pattern"}, {"input": "5", "output": "[\"22\\n4444\"]", "fn_name": "pattern"}, {"input": "2", "output": "[\"22\"]", "fn_name": "pattern"}, {"input": "-25", "output": "[\"\"]", "fn_name": "pattern"}, {"input": "1", "output": "[\"\"]", "fn_name": "pattern"}... | 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\nOne day, Taro received a strange email with only the number \"519345213244\" in the text. The email was from ... | [{"input": "341143514535\n158\n143565553551655311343411652235654535651124615163\n551544654451431564\n4\n3411\n6363636363\n153414", "output": "naruto\nNA\ndo you wanna go to aizu?\nyes sure!\nNA\nna\n?????\nend\n"}, {"input": "341143514535\n158\n143565553551655311343411652235654535651124615163\n551544654451431564\n4\n29... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nThe only difference between easy and hard versions is that you should complete all the projects in easy versi... | [{"input": "50 15000\n142 -300\n20 -298\n560 -300\n1815 -292\n282 -297\n92 -293\n34 -284\n555 -299\n408 -293\n504 -284\n278 -284\n139 -291\n64 -298\n311 -293\n130 -293\n89 -298\n129 -294\n385 -295\n136 -288\n41 -293\n112 -290\n416 -295\n178 -294\n154 -300\n110 -300\n346 -299\n209 -294\n1394 -295\n209 -299\n16 -297\n592... | code_stdio |
[
{
"content": "You are an expert Python programmer. 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[3R2 as DJ Mashiro - Happiness Breeze](https://open.spotify.com/track/2qGqK8GRS65Wlf20qUBEak)\n\n[Ice - DJ Ma... | [{"input": "10 83\n1 3\n2 2\n2 2\n2 2\n2 2\n2 2\n2 2\n2 2\n1 4\n2 2\n2 3\n2 3\n2 3\n2 3\n2 3\n2 3\n1 4\n1 5\n1 7\n2 2\n2 2\n1 5\n2 2\n1 3\n2 1\n2 6\n1 5\n2 6\n2 9\n1 2\n2 5\n1 2\n2 5\n2 4\n2 4\n1 2\n1 2\n1 4\n2 6\n2 6\n2 4\n2 4\n1 2\n1 2\n2 4\n2 4\n2 3\n2 3\n1 2\n2 9\n1 2\n1 2\n1 2\n2 6\n2 6\n2 4\n2 4\n2 3\n2 5\n2 5\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\nComplete the function that takes 3 numbers `x, y and k` (where `x β€ y`), and returns the number of integers w... | [{"input": "1005\n9999999999999999999999999999999999999999999\n109", "output": "[91743119266055045871559633027522935779807]", "fn_name": "divisible_count"}, {"input": "101\n9999999999999999999999999999999999999999999\n11", "output": "[909090909090909090909090909090909090909081]", "fn_name": "divisible_count"}, {"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\nHere, we want to solve path planning for a mobile robot cleaning a rectangular room floor with furniture.\n\n... | [{"input": "7 5\n.......\n.o...*.\n.......\n.*...*.\n.......\n15 13\n.......x.......\n...o...x....*..\n.......x.......\n.......x.......\n.......x.......\n.-.............\nxxxxx.....xxxxx\n...............\n.......x.......\n.......x.......\n.......x.......\n..*....x....*..\n.......x.......\n10 10\n..........\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\nA newspaper is published in Walrusland. Its heading is s1, it consists of lowercase Latin letters. Fangy the ... | [{"input": "ehfjaabjfedhddejjfcfijagefhkeahjcddhchahjbagi\nfbfdjbjhibjgjgaaajgdbcfdbhjcajcbbieijhcjgajhgaa\n", "output": "10\n"}, {"input": "ehfjaabjfedhddejjfcfijagefhkeahjcddhchahjbagi\naaghjagjchjieibbcjacjhbdfcbdgjaaagjgjbihjbjdfbf\n", "output": "10\n"}, {"input": "ehfjabbjfedhddejjfcfijagefhkeahjcddhchahjbagi\nfbf... | code_stdio |
[
{
"content": "You are an expert Python programmer. 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 array $a$ is good if for all pairs of adjacent elements, $a_i$ and $a_{i+1}$ ($1\\le i \\lt n$) are of dif... | [{"input": "30\n1\n1\n1\n2\n2\n1 1\n2\n1 2\n2\n2 1\n2\n2 2\n3\n1 1 1\n3\n1 1 2\n3\n1 2 1\n3\n1 2 2\n3\n2 1 1\n3\n2 1 2\n3\n2 2 1\n3\n2 2 2\n4\n1 1 1 1\n4\n1 1 1 2\n4\n1 1 2 1\n4\n1 1 2 2\n4\n1 2 1 1\n4\n1 2 1 2\n4\n1 2 2 1\n4\n1 2 2 2\n4\n2 1 1 1\n4\n2 1 1 2\n4\n2 1 2 1\n4\n2 1 2 2\n4\n2 2 1 1\n4\n2 2 1 2\n4\n2 2 2 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\nMancala is a game famous in the Middle East. It is played on a board that consists of 14 holes. [Image] \n\n... | [{"input": "297857621 238127103 749085829 139033277 597985489 202617713 1366784327 117968155 278551059 297781685 330124279 338959601 682874531 259895291\n", "output": "5305874892\n"}, {"input": "404418821 993626161 346204297 122439813 461187221 628048227 625919459 628611733 938993057 701270099 398043779 684205961 63097... | code_stdio |
[
{
"content": "You are an expert Python programmer. 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 N weights indexed 1 to N. The mass of the weight indexed i is W_i.\nWe will divide these weights into... | [{"input": "100\n15 62 67 2 22 89 88 68 100 14 35 3 81 6 26 81 13 90 17 53 60 82 6 84 31 76 26 64 74 41 33 93 29 99 89 85 34 56 62 64 100 85 65 67 95 28 49 100 9 53 18 31 37 3 37 37 24 71 91 47 73 86 42 71 90 63 98 50 75 82 67 61 48 30 35 29 41 37 1 58 85 91 19 40 85 68 36 48 52 73 6 8 100 47 82 3 17 88 28 94\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\nRoman and Denis are on the trip to the programming competition. Since the trip was long, they soon got bored,... | [{"input": "4\nqe\nnd\niqryhukieskfvaeettersinksrmazelxtgvartuz\nvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSeveral ages ago Berland was a kingdom. The King of Berland adored math. That's why, when he first visited on... | [{"input": "1000 1100 1000\n", "output": "3196901\n"}, {"input": "1000 0100 1000\n", "output": "1197901\n"}, {"input": "1000 1000 1000\n", "output": "2997001"}, {"input": "998 999 1001\n", "output": "2993002\n"}, {"input": "1143 998 467\n", "output": "2137954\n"}, {"input": "998 137 1000\n", "output": "1269592\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\nPhoenix is picking berries in his backyard. There are $n$ shrubs, and each shrub has $a_i$ red berries and $b... | [{"input": "20 4\n0 1\n0 2\n0 0\n1 2\n3 2\n1 3\n1 3\n2 0\n3 1\n0 2\n3 3\n2 3\n2 0\n3 2\n1 2\n1 1\n1 1\n1 2\n0 0\n1 3\n", "output": "14\n"}, {"input": "20 4\n0 1\n0 2\n0 0\n1 2\n3 2\n1 3\n1 3\n2 0\n3 1\n0 2\n3 3\n2 3\n2 0\n3 2\n1 2\n1 1\n1 1\n1 2\n0 0\n1 3\n", "output": "14\n"}, {"input": "20 4\n0 1\n0 2\n0 0\n1 2\n3 2\... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nThe BFS algorithm is defined as follows. Consider an undirected graph with vertices numbered from $1$ to $n$... | [{"input": "11\n1 2\n2 8\n3 7\n4 9\n5 10\n5 11\n6 4\n6 5\n7 1\n1 6\n1 6 7 2 5 4 3 8 11 10 9\n", "output": "Yes\n"}, {"input": "11\n1 2\n2 8\n3 7\n4 9\n5 10\n5 11\n11 4\n6 5\n7 1\n1 6\n1 6 7 2 5 4 3 8 11 10 9\n", "output": "No\n"}, {"input": "11\n1 2\n2 8\n3 7\n4 9\n5 10\n5 11\n11 4\n8 5\n7 1\n1 6\n1 6 7 2 5 4 3 8 11 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\nWe have N clocks. The hand of the i-th clock (1β€iβ€N) rotates through 360Β° in exactly T_i seconds.\n\nInitiall... | [{"input": "100\n999999999999999967\n999999999999999967\n999999999999999967\n999999999999999967\n999999999999999967\n999999999999999967\n999999999999999967\n999999999999999967\n999999999999999967\n999999999999999967\n999999999999999967\n999999999999999967\n999999999999999967\n999999999999999967\n999999999999999967\n999... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n$n$ people gathered to hold a jury meeting of the upcoming competition, the $i$-th member of the jury came up... | [{"input": "1\n74\n15 4 1 8 1 4 -1 5 9 1 6 3 1 16 2 1 3 6 7 4 1 6 8 9 21 4 0 6 6 4 22 1 8 7 0 1 6 6 4 1 8 9 16 4 10 5 9 2 20 10 0 5 3 8 1 7 7 0 2 10 2 4 8 4 6 9 2 4 9 8 1 11 3 0\n", "output": "210389544\n"}, {"input": "1\n74\n15 4 1 8 1 4 0 5 9 1 6 3 1 16 2 1 3 6 7 4 1 6 8 9 21 4 0 6 6 4 22 1 8 7 0 1 6 6 4 1 8 9 16 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\nGiven an array A1,A2...AN, you have to print the size of the largest contiguous subarray such that \nGCD of a... | [{"input": "2\n1\n16 2\n3\n2 4 16", "output": "-1\n-1\n"}, {"input": "2\n1\n12 2\n3\n2 4 4", "output": "-1\n-1\n"}, {"input": "2\n1\n6 4\n2\n2 12 2", "output": "-1\n-1\n"}, {"input": "2\n1\n12 2\n3\n2 4 8", "output": "-1\n-1\n"}, {"input": "2\n1\n6 4\n2\n2 10 2", "output": "-1\n-1\n"}, {"input": "2\n1\n6 4\n2\n2 12 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\nYou are a paparazzi working in Manhattan.\n\nManhattan has r south-to-north streets, denoted by numbers 1, 2,... | [{"input": "500 10\n69 477 122\n73 186 235\n341 101 145\n372 77 497\n404 117 440\n494 471 37\n522 300 498\n682 149 379\n821 486 359\n855 157 386\n", "output": "3\n"}, {"input": "500 10\n69 477 111\n73 186 235\n341 101 145\n372 77 497\n404 117 440\n494 471 37\n522 300 498\n682 149 379\n821 486 359\n855 157 386\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\nWe have N sticks with negligible thickness.\nThe length of the i-th stick is A_i.\nSnuke wants to select four... | [{"input": "10\n1 1 2 -3 2 8 1 218 -1 8", "output": "16\n"}, {"input": "10\n0 1 0 -2 4 34 1 34 0 4", "output": "136\n"}, {"input": "10\n-1 2 12 15 3 1 0 18 1 1", "output": "0\n"}, {"input": "10\n-2 2 12 1 4 2 1 41 -1 1", "output": "2\n"}, {"input": "10\n0 2 12 13 3 1 0 18 3 1", "output": "3\n"}, {"input": "10\n-1 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\nConsider the following series:\n\n`1, 2, 4, 8, 16, 22, 26, 38, 62, 74, 102, 104, 108, 116, 122`\n\nIt is gene... | [{"input": "5000", "output": "[283]", "fn_name": "convergence"}, {"input": "500", "output": "[29]", "fn_name": "convergence"}, {"input": "10", "output": "[5]", "fn_name": "convergence"}, {"input": "15", "output": "[2]", "fn_name": "convergence"}, {"input": "3", "output": "[5]", "fn_name": "convergence"}, {"input": "5",... | 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\nGalois is one of the strongest chess players of Byteforces. He has even invented a new variant of chess, whic... | [{"input": "........\n........\n.B....B.\n....W...\n........\n..W.....\n........\n........\n", "output": "A\n"}, {"input": "..B.....\n..W.....\n......B.\n........\n.....W..\n......B.\n........\n........\n", "output": "B\n"}, {"input": ".BB.B.B.\nB..B..B.\n.B.BB...\nBB.....B\nBBB....B\nB..BB...\nBB.B...B\n....WWW.\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\nGoldbach's conjecture is one of the oldest and best-known unsolved problems in number theory and all of mathe... | [{"input": "5000", "output": "[[[7, 4993], [13, 4987], [31, 4969], [43, 4957], [67, 4933], [97, 4903], [139, 4861], [199, 4801], [211, 4789], [241, 4759], [271, 4729], [277, 4723], [337, 4663], [349, 4651], [379, 4621], [397, 4603], [409, 4591], [433, 4567], [439, 4561], [487, 4513], [577, 4423], [643, 4357], [661, 433... | 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 finds a pattern $p$ in a ring shaped text $s$.\n\n\n<image>\n\nConstraints\n\n* $1 \\le... | [{"input": "vanceknowledgetoad\nbdvanced", "output": "No\n"}, {"input": "vanceknowledgetoad\ncdvanced", "output": "No\n"}, {"input": "vanceknowmedgetoad\ncdvanced", "output": "No\n"}, {"input": "vbnceknowmedgetoad\ncdvanced", "output": "No\n"}, {"input": "vbnceknowledgetoad\ncdvanced", "output": "No\n"}, {"input": "vbn... | code_stdio |
[
{
"content": "You are an expert Python programmer. 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 $f(i)$ denote the minimum positive integer $x$ such that $x$ is not a divisor of $i$.\n\nCompute $\\sum_{... | [{"input": "6\n1\n4\n3\n4\n10\n10000000000000000\n", "output": "2\n10\n7\n10\n26\n366580019\n"}, {"input": "6\n1\n2\n3\n4\n10\n10000000000000000\n", "output": "2\n5\n7\n10\n26\n366580019\n"}, {"input": "6\n1\n2\n3\n4\n10\n10000000000000000\n", "output": "2\n5\n7\n10\n26\n366580019\n"}, {"input": "1\n5897090464090076\n"... | code_stdio |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.