messages listlengths 1 1 | ground_truth stringlengths 156 726k | dataset stringclasses 2
values |
|---|---|---|
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nThere are $n$ candy boxes in front of Tania. The boxes are arranged in a row from left to right, numbered fro... | [{"input": "50 49 1000\n30 37 34 31 26 44 32 12 36 15 5 5 31 24 17 24 43 19 17 23 45 2 24 17 23 48 20 44 46 44 13 4 29 49 33 41 14 25 46 43 7 47 28 25 2 30 37 37 19 32\nGBBBRBGRBRBRGRGRBBGBGRRBGGRBGRBRRRRRRRBRGRGGGGBRGG\n", "output": "-1\n"}, {"input": "50 37 500\n25 43 15 16 29 23 46 18 15 21 33 26 38 25 2 17 48 50 33... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nIf you visit Aizu Akabeko shrine, you will find a unique paper fortune on which a number with more than one d... | [{"input": "167918384", "output": "8\n"}, {"input": "177127860", "output": "8\n"}, {"input": "16612328", "output": "7\n"}, {"input": "23422731", "output": "6\n"}, {"input": "32523857", "output": "6\n"}, {"input": "14513597", "output": "8\n"}, {"input": "15282598", "output": "8\n"}, {"input": "12659326", "output": "8\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\nAn **anagram** is the result of rearranging the letters of a word to produce a new word.\n\n**Note:** anagram... | [{"input": "\"Buckethead\"\n\"DeathCubeK\"", "output": "[true]", "fn_name": "is_anagram"}, {"input": "\"dumble\"\n\"bumble\"", "output": "[false]", "fn_name": "is_anagram"}, {"input": "\"foefet\"\n\"toffee\"", "output": "[true]", "fn_name": "is_anagram"}, {"input": "\"ound\"\n\"round\"", "output": "[false]", "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\nArkady decides to observe a river for n consecutive days. The river's water level on each day is equal to som... | [{"input": "100\n0 1 2 2 3 0 1 5 6 6 0 0 8 7 1 9 9 4 10 11 12 2 12 12 12 12 9 13 14 8 15 15 15 19 15 7 17 17 18 19 9 10 21 0 22 9 2 24 24 4 24 7 25 14 5 8 28 29 30 31 31 31 0 3 15 31 8 33 6 35 35 35 36 71 37 37 38 39 28 0 2 23 41 9 9 0 6 25 41 41 12 42 43 43 36 44 51 11 43 4\n", "output": "2658\n"}, {"input": "100\n0 1... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nYou are given an array $a_1, a_2, \\dots, a_n$. You can perform the following operation any number of times: ... | [{"input": "50\n1 1 1 1 1 2 1 1 2 1 2 1 1 1 2 1 1 1 2 2 2 1 1 2 2 1 2 1 1 2 2 1 1 2 2 1 1 1 1 1 2 2 2 2 2 1 2 2 2 1\n", "output": "19\n"}, {"input": "50\n1 1 1 1 1 2 1 1 2 1 2 1 1 1 2 1 1 1 2 2 2 1 1 2 2 1 2 1 1 2 2 1 1 2 2 1 1 1 1 1 2 2 2 2 2 1 2 2 2 1\n", "output": "19\n"}, {"input": "50\n1 1 1 1 1 2 1 1 2 1 4 1 1 1 ... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nThere are X+Y+Z people, conveniently numbered 1 through X+Y+Z. Person i has A_i gold coins, B_i silver coins ... | [{"input": "6 2 4\n33189 87907 277349742\n71616 46764 575306520\n8801 53151 327161251\n58589 4337 796697686\n110501 17565 289910583\n50598 35195 478112689\n13919 118109 103962455\n7953 69657 699253752\n44255 98144 468443709\n2332 42580 752437097\n39752 19060 845062869\n105264 135743 245001003", "output": "3094048455\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\nImplement a function called makeAcronym that returns the first letters of each word in a passed in string.\n\... | [{"input": "\"How much wood would a woodchuck chuck if a woodchuck could chuck wood\"", "output": "[\"HMWWAWCIAWCCW\"]", "fn_name": "make_acronym"}, {"input": "\"Please excuse my dear aunt Sally\"", "output": "[\"PEMDAS\"]", "fn_name": "make_acronym"}, {"input": "\"Unique New York\"", "output": "[\"UNY\"]", "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\nWhen little Petya grew up and entered the university, he started to take part in ΠΠ‘Π contests. Later he reali... | [{"input": "16 25\nbBZ\nEr\nZ\nrYJmfZLgmx\nPaJNrF\naHtRqSxOO\nD\nhsagsG\nMDuBOXrmWH\nSgjMQZ\nYXgWq\nxDwpppG\nSDY\nJwZWx\ncOzrgrBaE\nFJYX\nYXgWq SgjMQZ\nSDY PaJNrF\nFJYX rYJmfZLgmx\nhsagsG Er\nxDwpppG rYJmfZLgmx\naHtRqSxOO rYJmfZLgmx\nhsagsG bBZ\nJwZWx hsagsG\nFJYX cOzrgrBaE\nSDY YXgWq\nFJYX Z\nJwZWx rYJmfZLgmx\nD rYJmf... | code_stdio |
[
{
"content": "You are an expert Python programmer. 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# Solve For X\n\nYou will be given an equation as a string and you will need to [solve for X](https://www.mat... | [{"input": "\"x - 100 + 2 - 50 = 52\"", "output": "[200]", "fn_name": "solve_for_x"}, {"input": "\"5 * x + 20 - x = 60\"", "output": "[10]", "fn_name": "solve_for_x"}, {"input": "\"(5 - 3) * x = x + 2\"", "output": "[2]", "fn_name": "solve_for_x"}, {"input": "\"(x - 30) * 2 = x\"", "output": "[60]", "fn_name": "solve_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\nWrite a function that takes an array/list of numbers and returns a number such that \n\nExplanation\ntotal([1... | [{"input": "[-1, -1, -10, 42, 92, 1, 23, 6, -3]", "output": "[9248]", "fn_name": "total"}, {"input": "[4, 4, 52, 23, 32, 1, -1]", "output": "[1753]", "fn_name": "total"}, {"input": "[1, 2, 3, 4, 5]", "output": "[48]", "fn_name": "total"}, {"input": "[4, 4, 5, -1]", "output": "[30]", "fn_name": "total"}, {"input": "[-1,... | code_functional |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nConsider sequences \\{A_1,...,A_N\\} of length N consisting of integers between 1 and K (inclusive).\nThere a... | [{"input": "100000 100000\n", "output": "742202979\n"}, {"input": "101000 100000", "output": "817082185\n"}, {"input": "101010 100000", "output": "781111243\n"}, {"input": "99991 99989\n", "output": "215961669\n"}, {"input": "23857 50338\n", "output": "123598436\n"}, {"input": "86918 71567\n", "output": "531753154\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\nWe have a tree with N vertices numbered 1 to N. The i-th edge in this tree connects Vertex a_i and b_i.\nFor ... | [{"input": "8\n1 3\n2 3\n3 4\n3 5\n3 6\n6 7\n6 8", "output": "240\n240\n1680\n240\n240\n1008\n144\n144\n"}, {"input": "8\n1 3\n2 3\n5 4\n3 5\n3 6\n3 7\n3 8", "output": "360\n360\n2520\n120\n840\n360\n360\n360\n"}, {"input": "8\n1 2\n2 3\n2 4\n3 5\n2 6\n6 7\n2 8", "output": "180\n1260\n420\n180\n60\n420\n60\n180\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 summer Vitya comes to visit his grandmother in the countryside. This summer, he got a huge wart. Every ... | [{"input": "92\n13 12 11 10 9 8 7 6 5 4 3 2 1 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 14 13 12\n", "output": "DOWN\n"}, {"input": "92\n14 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 1 2 ... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nTwo polar bears Menshykov and Uslada from the St.Petersburg zoo and elephant Horace from the Kiev zoo got six... | [{"input": "5 5 5 5 5 5\n", "output": "Elephant\n"}, {"input": "4 4 4 4 2 2\n", "output": "Elephant\n"}, {"input": "4 4 2 2 2 2\n", "output": "Elephant\n"}, {"input": "1 1 2 2 2 2\n", "output": "Elephant\n"}, {"input": "1 1 1 1 1 1\n", "output": "Elephant\n"}, {"input": "2 2 4 4 4 4\n", "output": "Elephant\n"}, {"input... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nThe Cybermen and the Daleks have long been the Doctor's main enemies. Everyone knows that both these species ... | [{"input": "10\n11 11\n11 12\n11 15\n11 17\n11 18\n11 19\n11 28\n11 33\n11 38\n11 40\n12 11\n15 46\n17 11\n17 46\n18 46\n19 11\n19 46\n20 11\n20 46\n24 46\n25 46\n26 11\n32 11\n32 46\n33 11\n34 46\n36 11\n39 11\n40 46\n43 11\n44 0\n46 14\n46 15\n46 17\n46 22\n46 26\n46 28\n46 32\n46 43\n46 45\n46 46\n", "output": "44 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\nJerry is a little mouse. He is trying to survive from the cat Tom. Jerry is carrying a parallelepiped-like pi... | [{"input": "10 7 12\n5\n1\n-1\n19\n2\n10\n0 0 0", "output": "NA\nNA\nOK\nNA\nOK\n"}, {"input": "10 7 12\n5\n1\n-1\n11\n2\n5\n0 0 0", "output": "NA\nNA\nOK\nNA\nNA\n"}, {"input": "10 6 8\n5\n1\n-1\n-1\n-1\n6\n0 0 0", "output": "NA\nNA\nNA\nNA\nOK\n"}, {"input": "10 7 12\n5\n1\n-1\n19\n2\n5\n0 0 0", "output": "NA\nNA\nOK... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nCasimir has a string $s$ which consists of capital Latin letters 'A', 'B', and 'C' only. Each turn he can cho... | [{"input": "6\nABABAB\nABBA\nBC\nABC\nCABBCB\nBBCBCBCBCBCCCBCB\n", "output": "YES\nYES\nYES\nNO\nYES\nYES\n"}, {"input": "6\nBBAACB\nABBA\nBC\nABA\nACBCBB\nCBCBCBCBCBCBCBCB\n", "output": "YES\nYES\nYES\nNO\nYES\nYES\n"}, {"input": "6\nABACAB\nABBA\nBC\nABB\nCABCBB\nCBCBCBCBCBCBCBCB\n", "output": "NO\nYES\nYES\nNO\nYES\... | code_stdio |
[
{
"content": "You are an expert Python programmer. 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 random number generator. It generates an integer between 0 and 2^N-1 (inclusive). An integer se... | [{"input": "4\n337 780 799 18 796 875 331 223 1804 67 268 483 390 565 116 355", "output": "0\n870892872\n738673049\n866136893\n809360917\n134965576\n496873404\n200938352\n392063026\n225113281\n769068776\n945265000\n612087551\n845908556\n726467732\n606029955\n"}, {"input": "4\n337 780 799 10 796 875 331 223 1804 67 268 ... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nMole is hungry again. He found one ant colony, consisting of n ants, ordered in a row. Each ant i (1 β€ i β€ n)... | [{"input": "5\n1 5 2 4 2\n4\n1 5\n2 5\n3 5\n4 5\n", "output": "4\n4\n1\n1\n"}, {"input": "5\n1 3 4 4 2\n4\n1 5\n2 5\n3 5\n4 5\n", "output": "4\n4\n2\n1\n"}, {"input": "5\n1 3 4 4 2\n4\n1 5\n2 5\n3 5\n2 5\n", "output": "4\n4\n2\n4\n"}, {"input": "5\n1 3 4 4 2\n4\n1 5\n2 5\n1 5\n4 5\n", "output": "4\n4\n4\n1\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\nLittle Elephant is playing a game with arrays. He is given an array A0, A1, ..., ANβ1 of N integers. And then... | [{"input": "5\n4 1 1 6 4\n4\n1\n0\n1\n-1", "output": "11\n0\n11\n0\n"}, {"input": "5\n4 1 1 6 4\n4\n0\n5\n1\n-1", "output": "0\n0\n11\n0\n"}, {"input": "5\n4 -1 -1 0 0\n4\n6\n4\n2\n0", "output": "0\n1\n0\n3\n"}, {"input": "5\n3 0 3 0 10\n4\n0\n4\n6\n1", "output": "12\n0\n0\n0\n"}, {"input": "5\n4 -1 -1 0 0\n4\n6\n4\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\nSilver Fox is fighting with N monsters.\nThe monsters are standing in a row, and we can assume them to be sta... | [{"input": "3 0 1\n300000000 1000000000\n100000000 1000000000\n200000000 1000000000\n", "output": "3000000000\n"}, {"input": "3 -1 2\n156828556 1001000000\n100000000 1000101000\n114627287 1001010011", "output": "1501055506\n"}, {"input": "3 -1 2\n156828556 1001000000\n100000000 1000101000\n114627287 0001010011", "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\nNauuo is a girl who loves drawing circles.\n\nOne day she has drawn a circle and wanted to draw a tree on it.... | [{"input": "10\n5 4\n5 2\n3 7\n9 3\n3 2\n3 1\n3 8\n9 10\n1 6\n", "output": "19200\n"}, {"input": "10\n5 4\n5 2\n3 7\n9 3\n3 2\n4 1\n3 8\n9 10\n1 6\n", "output": "7680\n"}, {"input": "10\n7 4\n5 2\n3 7\n9 3\n3 2\n4 1\n3 8\n9 10\n1 6\n", "output": "7680\n"}, {"input": "9\n5 6\n1 3\n2 3\n7 6\n4 1\n3 6\n8 1\n1 9\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\nVasyaβs elder brother Petya loves playing computer games. In one of his favourite computer games Petya reache... | [{"input": "70 1000 1\n91 2\n43 1\n100 1\n79 2\n26 1\n68 2\n4 2\n64 1\n100 1\n80 2\n20 2\n70 1\n25 1\n99 1\n64 1\n35 2\n60 1\n63 2\n93 1\n40 2\n100 1\n54 1\n100 1\n15 2\n72 1\n28 1\n5 1\n93 1\n100 2\n39 2\n54 2\n100 1\n55 1\n43 1\n20 1\n28 2\n21 1\n100 2\n98 1\n35 1\n12 2\n50 2\n7 2\n7 2\n12 2\n100 2\n44 1\n40 2\n56 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$n$ students attended the first meeting of the Berland SU programming course ($n$ is even). All students will... | [{"input": "2\n4\n1 0 0 1 0\n0 1 0 1 1\n0 0 0 1 0\n0 1 0 0 0\n2\n-1 0 0 1 0\n0 0 1 1 0\n", "output": "YES\nYES\n"}, {"input": "2\n4\n1 0 1 1 0\n1 1 0 0 1\n0 0 0 1 0\n0 1 0 1 0\n2\n-1 0 0 0 1\n0 0 0 1 0\n", "output": "YES\nYES\n"}, {"input": "2\n4\n1 0 0 1 0\n1 1 0 0 1\n0 1 0 1 0\n0 1 0 0 0\n2\n-1 1 0 0 0\n0 0 1 1 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\nLet s(x) be sum of digits in decimal representation of positive integer x. Given two integers n and m, find s... | [{"input": "3963 619\n", "output": "11111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111... | code_stdio |
[
{
"content": "You are an expert Python programmer. 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 greatest common divisor is an indispensable element in mathematics handled on a computer. Using the great... | [{"input": "1251 5715\n10 10\n0 0", "output": "9 6\n10 1\n"}, {"input": "1251 3144\n10 10\n0 0", "output": "3 6\n10 1\n"}, {"input": "1893 2905\n10 6\n0 0", "output": "1 11\n2 3\n"}, {"input": "1893 2905\n11 6\n0 0", "output": "1 11\n1 3\n"}, {"input": "1810 3998\n10 4\n0 0", "output": "2 10\n2 2\n"}, {"input": "1810 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\n## Task\n\nImplement a function which finds the numbers less than `2`, and the indices of numbers greater tha... | [{"input": "[0, 1, 2, 1, 0, 2, 1, 1, 1, 0, 4, 5, 6, 2, 1, 1, 0]", "output": "[[[0, 1, 1, 0, 1, 1, 1, 0, 1, 1, 0], [2, 5, 10, 11, 12, 13]]]", "fn_name": "binary_cleaner"}, {"input": "[0, 1, 2, 1, 0, 2, 1, 1]", "output": "[[[0, 1, 1, 0, 1, 1], [2, 5]]]", "fn_name": "binary_cleaner"}, {"input": "[3, 0, 7, 0, 2, 0]", "outp... | 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 on the island which can be represented as a $n \\times m$ table. The rows are numbered from $1$ to $n... | [{"input": "21 3 61 3\n18 3\n21 3\n11 3\n13 2\n5 2\n14 2\n10 3\n9 3\n12 1\n1 2\n7 2\n20 1\n16 3\n18 2\n9 1\n20 3\n17 3\n6 1\n4 2\n1 1\n3 1\n4 1\n6 3\n6 2\n2 1\n13 3\n5 3\n3 2\n13 1\n10 1\n11 1\n18 1\n11 2\n5 1\n19 2\n20 2\n16 1\n12 3\n2 2\n3 3\n19 3\n8 2\n15 3\n8 1\n14 1\n17 1\n21 1\n19 1\n21 2\n12 2\n2 3\n8 3\n1 3\n16... | code_stdio |
[
{
"content": "You are an expert Python programmer. 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 palindrome is a word, phrase, number, or other sequence of characters which reads the same backward as forw... | [{"input": "\"ACCDDCCA\"", "output": "[\"Not valid\"]", "fn_name": "palindrome"}, {"input": "\"@14AbC\"", "output": "[\"Not valid\"]", "fn_name": "palindrome"}, {"input": "1456009006541", "output": "[true]", "fn_name": "palindrome"}, {"input": "\"1221\"", "output": "[\"Not valid\"]", "fn_name": "palindrome"}, {"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\nInternational Abbreviation Olympiad takes place annually starting from 1989. Each year the competition receiv... | [{"input": "9\nIAO'0\nIAO'00\nIAO'000\nIAO'0000\nIAO'00000\nIAO'000000\nIAO'0000000\nIAO'00000000\nIAO'000000000\n", "output": "1990\n2000\n3000\n10000\n100000\n1000000\n10000000\n100000000\n1000000000\n"}, {"input": "9\nIAO'0\nIAO'00\nIAO'000\nIAO'0000\nIAO'00000\nIAO'010000\nIAO'0000000\nIAO'00000000\nIAO'000000000\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 write all the positive integer numbers one after another from $1$ without any delimiters (i.e. as a sin... | [{"input": "1000000000000\n", "output": "1\n"}, {"input": "1009684841618\n", "output": "7\n"}, {"input": "999999999999\n", "output": "9\n"}, {"input": "134613461346\n", "output": "3\n"}, {"input": "100000000000\n", "output": "0\n"}, {"input": "100000000004\n", "output": "0\n"}, {"input": "523452345325\n", "output": "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\nYou got a job as a marketer in a pet shop, and your current task is to boost sales of cat food. One of the st... | [{"input": "10\n335544320 671088640\n335544322 671088639\n335544321 671088639\n335544325 671088637\n335544319 671088640\n335544319 671088641\n335544319 671088639\n335544318 671088639\n352759476 671088637\n335544319 671088643\n", "output": "NO\nYES\nYES\nYES\nNO\nNO\nNO\nNO\nYES\nNO\n"}, {"input": "10\n335544320 6710886... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nYou are given an array $a$ consisting of $n$ non-negative integers. It is guaranteed that $a$ is sorted from ... | [{"input": "1\n147\n0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 145 10443 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\nTurtle Shi-ta and turtle Be-ko decided to divide a chocolate. The shape of the chocolate is rectangle. The co... | [{"input": "2 3 7 10 50\n3 3\n6 6\n10 10\n4.0000000000 4.380940502722975\n7.0000000000 7.0000000000\n2 3 10 10 48\n2 3\n7 6\n10 10\n4.1530399119933294 4.124627510166318\n7.679827074828504 8.063298606739774\n2 3 10 10 30\n3 3\n6 6\n10 10\n4.0000000000 4.920930737803775\n7.0000000000 7.0000000000\n2 3 10 10 40\n3 3\n6 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\nOn the planet Mars a year lasts exactly n days (there are no leap years on Mars). But Martians have the same ... | [{"input": "1000000\n", "output": "285714 285715\n"}, {"input": "999999\n", "output": "285714 285714\n"}, {"input": "999998\n", "output": "285713 285714\n"}, {"input": "999997\n", "output": "285712 285714\n"}, {"input": "999996\n", "output": "285712 285714\n"}, {"input": "999995\n", "output": "285712 285714\n"}, {"inpu... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nEdogawa Conan got tired of solving cases, and invited his friend, Professor Agasa, over. They decided to play... | [{"input": "10\n38282 53699 38282 38282 38282 38282 38282 38282 38282 38282\n", "output": "Conan\n"}, {"input": "10\n50165 50165 50165 50165 50165 50165 50165 50165 50165 50165\n", "output": "Agasa\n"}, {"input": "10\n32093 36846 32093 32093 36846 36846 36846 36846 36846 36846\n", "output": "Conan\n"}, {"input": "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\nInternational Center for Picassonian Cubism is a Spanish national museum of cubist artworks, dedicated to Pab... | [{"input": "5 5\n1 2 3 2 5\n1 2 1 4 5\n5 5\n2 3 3 1 3\n4 1 5 3 2\n5 5\n1 2 3 4 5\n3 3 1 4 5\n3 3\n7 7 7\n7 14 7\n3 3\n2 4 4\n4 3 4\n4 3\n4 0 2 5\n0 2 1\n4 4\n2 8 8 8\n2 3 8 3\n10 10\n9 9 9 9 17 9 9 17 9 9\n9 16 9 9 9 9 9 9 9 3\n10 9\n20 1 20 20 20 20 20 18 20 20\n20 20 20 20 7 17 20 20 4\n0 0", "output": "18\n21\n18\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\nMonocarp and Bicarp live in Berland, where every bus ticket consists of $n$ digits ($n$ is an even number). D... | [{"input": "396\n???7?2675?2??52554870???512418???29?6270?638470?154?339014?59??5?3?51577??8?2???1441?86???90?7?6?472??3675?4??1920?9??6258??16362?979??707?0?05682730650?08???04005?54?355??4???530?5?1?9?84416??5???80??8102??2??8??3??868?18?304????68?91225?047175??4??8?14593???58?05661?9?0??4?8??1?47?1881???9751??68????... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nProblem\n\nYamano Mifune Gakuen's 1st grade G group is a class where female students carrying misfortune gath... | [{"input": "5 10 5\n0 1 1 2\n0 2 1 2\n0 1 2 3\n1 2 0 2\n1 4 2 3\n2 1 1 1\n2 1 1 2\n3 3 2 3\n4 1 1 2\n4 2 1 2", "output": "13\n"}, {"input": "5 10 5\n0 1 1 2\n0 2 1 2\n0 1 2 3\n1 2 0 2\n1 4 2 3\n2 1 1 1\n2 1 1 2\n3 3 2 4\n4 1 1 2\n4 2 0 2", "output": "14\n"}, {"input": "5 10 5\n0 1 1 2\n0 2 1 2\n0 1 2 3\n1 2 1 2\n1 4 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\nRecently, you bought a brand new smart lamp with programming features. At first, you set up a schedule to the... | [{"input": "7 1000000000\n1 10001 10011 20011 20021 40021 40031\n", "output": "999999969\n"}, {"input": "7 1000000000\n3 10001 10011 20011 20021 40021 40031\n", "output": "999999969\n"}, {"input": "7 1000000000\n1 10001 10011 20011 20021 40021 40031\n", "output": "999999969\n"}, {"input": "7 1000000000\n3 10001 10011 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\nThis is the easy version of the problem. The difference between the versions is that the easy version does no... | [{"input": "3\n14 1\n+--++---++-++-\n1 14\n14 3\n+--++---+++---\n1 14\n6 12\n3 10\n4 10\n+-+-\n1 1\n1 2\n1 3\n1 4\n2 2\n2 3\n2 4\n3 3\n3 4\n4 4\n", "output": "2\n2\n1\n0\n1\n2\n1\n2\n1\n2\n1\n1\n2\n1\n"}, {"input": "3\n14 1\n+--++---++-++-\n1 14\n14 3\n+--++---+++---\n1 14\n7 12\n3 10\n4 10\n+-+-\n1 1\n1 2\n1 3\n1 4\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\nAlice and Bob play a game. There is a paper strip which is divided into n + 1 cells numbered from left to rig... | [{"input": "24\n26 13\n8 9\n2 9\n22 9\n29 5\n47 18\n9 15\n14 9\n27 9\n28 9\n35 8\n34 9\n23 6\n52 2\n1011010000 999999999\n232709804 999999999\n1011611339 999999999\n1000000100 5\n1000000000 3\n1000010010 9\n1737891047 6\n1058606099 5\n999999992 16\n974657870 9\n", "output": "Alice\nAlice\nAlice\nAlice\nAlice\nBob\nBob\... | code_stdio |
[
{
"content": "You are an expert Python programmer. 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 went to the store, selling $n$ types of chocolates. There are $a_i$ chocolates of type $i$ in stock.\n\nY... | [{"input": "19\n11 10 2 12 1 1 9 13 8 40 16 27 18 22 33 1 14 32 12\n", "output": "34\n"}, {"input": "19\n11 10 2 12 1 1 9 13 8 40 8 27 18 22 33 1 14 32 12\n", "output": "34\n"}, {"input": "19\n11 10 6 11 2 1 6 13 8 38 8 27 9 22 18 7 14 20 12\n", "output": "61\n"}, {"input": "19\n11 10 6 12 2 1 6 13 8 38 8 27 9 22 18 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\nThis is the easier version of the problem. In this version $1 \\le n, m \\le 100$. You can hack this problem ... | [{"input": "5\n3 1 4 1 2\n15\n5 5\n5 4\n5 3\n5 2\n5 1\n4 4\n4 3\n4 2\n4 1\n3 3\n3 2\n3 1\n2 2\n2 1\n1 1\n", "output": "2\n1\n4\n1\n3\n2\n4\n1\n3\n2\n4\n3\n4\n3\n4\n"}, {"input": "5\n3 1 4 1 2\n15\n5 5\n5 4\n5 3\n5 2\n5 1\n4 4\n4 3\n4 2\n4 1\n3 3\n3 2\n3 1\n2 2\n2 1\n1 1\n", "output": "2\n1\n4\n1\n3\n2\n4\n1\n3\n2\n4\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\nOne day you wanted to read something, so you went to your bookshelf to grab some book. But when you saw how m... | [{"input": "100\n82 51 81 14 37 17 78 92 64 15 8 86 89 8 87 77 66 10 15 12 100 25 92 47 21 78 20 63 13 49 41 36 41 79 16 87 87 69 3 76 80 60 100 49 70 59 72 8 38 71 45 97 71 14 76 54 81 4 59 46 39 29 92 3 49 22 53 99 59 52 74 31 92 43 42 23 44 9 82 47 7 40 12 9 3 55 37 85 46 22 84 52 98 41 21 77 63 17 62 91\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\nEfim just received his grade for the last test. He studies in a special school and his grade can be equal to ... | [{"input": "320 142\n2704701300865535.432223312233434114130011113220102420131323010344144201124303144444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444447444444444444444444444444444444615444444482101673308979557675074444444444444446867245414595534444693160... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nKISS stands for Keep It Simple Stupid.\nIt is a design principle for keeping things simple rather than comple... | [{"input": "\"Joe listened to the noises and there were some onamonapias\"", "output": "[\"Keep It Simple Stupid\"]", "fn_name": "is_kiss"}, {"input": "\"Joe listened to the noise and it was an onamonapia\"", "output": "[\"Good work Joe!\"]", "fn_name": "is_kiss"}, {"input": "\"Sometimes joe cries for hours\"", "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\nThere is an array with some numbers. All numbers are equal except for one. Try to find it!\n\n```python\nfind... | [{"input": "[4, 4, 4, 3, 4, 4, 4, 4]", "output": "[3]", "fn_name": "find_uniq"}, {"input": "[5, 5, 5, 5, 4, 5, 5, 5]", "output": "[4]", "fn_name": "find_uniq"}, {"input": "[6, 6, 6, 6, 6, 5, 6, 6]", "output": "[5]", "fn_name": "find_uniq"}, {"input": "[7, 7, 7, 7, 7, 7, 6, 7]", "output": "[6]", "fn_name": "find_uniq"},... | code_functional |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nYou are given $a$ uppercase Latin letters 'A' and $b$ letters 'B'.\n\nThe period of the string is the smalles... | [{"input": "1000000000 1000000000\n", "output": "1999936805\n"}, {"input": "1000000000 1000000000\n", "output": "1999936805\n"}, {"input": "1000000000 956817411\n", "output": "1956733985\n"}, {"input": "1000000000 839933539\n", "output": "1839852485\n"}, {"input": "956817411 1000000000\n", "output": "1956733985\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 have N items and a bag of strength W. The i-th item has a weight of w_i and a value of v_i.\n\nYou will s... | [{"input": "4 1\n10 100\n10 100\n10 101\n10 100", "output": "0\n"}, {"input": "4 2\n10 100\n10 100\n10 100\n10 100", "output": "0\n"}, {"input": "4 1\n10 100\n10 000\n10 101\n10 100", "output": "0\n"}, {"input": "4 2\n10 110\n10 100\n10 100\n10 100", "output": "0\n"}, {"input": "4 1\n10 100\n10 000\n10 001\n10 100", "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\nJohnny has recently found an ancient, broken computer. The machine has only one register, which allows one to... | [{"input": "10\n10 5\n11 73\n17 21\n1 1\n96 3\n2 128\n0001 1100611139403776\n1000000000000000000 1000000001000000000\n7 1\n10 8\n", "output": "1\n-1\n-1\n0\n2\n2\n-1\n-1\n-1\n-1\n"}, {"input": "10\n10 5\n11 73\n17 18\n1 1\n96 3\n2 128\n0001 1100611139403776\n1000000000000000000 1000000001000000000\n7 1\n10 8\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\nKirito is stuck on a level of the MMORPG he is playing now. To move on in the game, he's got to defeat all n ... | [{"input": "9983 34\n6626 5976\n4448 3568\n2794 2309\n3741 8806\n4754 129\n2780 9275\n5785 9243\n3915 6159\n2609 4331\n238 6756\n6987 3887\n3384 5711\n4349 5563\n1135 4483\n9151 1584\n1500 766\n1608 4440\n7768 5005\n7205 2360\n9088 2933\n3923 7814\n7538 9372\n7504 165\n5277 1636\n2061 4384\n7668 1422\n9582 2121\n5483 7... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nYou are given an array $a_1, a_2, \\dots, a_n$ consisting of $n$ distinct integers. Count the number of pairs... | [{"input": "3\n2\n3 1\n3\n3 1 5\n5\n3 1 4 10 2\n", "output": "1\n2\n3\n"}, {"input": "3\n2\n2 1\n3\n4 2 5\n5\n3 1 4 10 2\n", "output": "0\n0\n3\n"}, {"input": "3\n2\n3 2\n3\n3 1 5\n5\n3 1 4 10 2\n", "output": "0\n2\n3\n"}, {"input": "3\n2\n3 1\n3\n4 1 5\n5\n3 1 4 10 2\n", "output": "1\n1\n3\n"}, {"input": "3\n2\n3 1\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\nOur bear's forest has a checkered field. The checkered field is an n Γ n table, the rows are numbered from 1 ... | [{"input": "1000000000 1000000000 1000000000 100 -100 1000000000000000000\n", "output": "969796608 969796608\n"}, {"input": "1000000000 1000000000 1000000001 100 -100 1000000000000000000\n", "output": "599261184 599261185\n"}, {"input": "1000000000 1000000000 1000000000 100 -100 1000000000000000000\n", "output": "96979... | code_stdio |
[
{
"content": "You are an expert Python programmer. 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 Dormi received a histogram with $n$ bars of height $a_1, a_2, \\ldots, a_n$ for Christmas. However, th... | [{"input": "2\n4\n0 16 14 1\n6\n2 1 14 4 0 0\n", "output": "30\n19\n"}, {"input": "2\n4\n0 16 17 1\n6\n2 1 14 4 0 0\n", "output": "33\n19\n"}, {"input": "2\n4\n13 8 15 13\n6\n2 1 7 8 1 0\n", "output": "33\n16\n"}, {"input": "2\n4\n13 8 15 13\n6\n2 1 7 3 1 0\n", "output": "33\n11\n"}, {"input": "2\n4\n13 8 15 13\n6\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\nA way to make a new task is to make it nondeterministic or probabilistic. For example, the hard task of Topco... | [{"input": "6\nzfnkpxaavrcvqhhkclcuiswawpghlqrlq wnvbzhvsjozlkwxowcvyclmehjkkvkxin\nzkxkvlnovnloxjdydujkjydaegzjypsgrzq dmiilhmkspokltabpvwalijhlitbfp\nldfbfggqsdqethdgkmbcwloluguxiluqjyr fewoondewvndcxticvpiqnvvdhsnzfd\nepokfmixjnawdfgkmqlcyirxuprrvudh xvijbdzqdyjwsyhjucytuxrxuiynxf\nxntrjusjwbfemnysqrloflcmuiiqxdwvia... | code_stdio |
[
{
"content": "You are an expert Python programmer. 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 N pairwise distinct non-negative integers A_1,A_2,\\ldots,A_N. Find the number of ways to choose a ... | [{"input": "5 4 1 15\n3 11 1 0 5", "output": "4"}, {"input": "5 4 1 15\n3 11 1 1 5", "output": "7"}, {"input": "5 4 1 15\n3 11 1 0 2", "output": "0"}, {"input": "5 5 1 11\n3 4 11 1 5", "output": "2"}, {"input": "5 4 0 15\n3 11 1 1 5", "output": "0"}, {"input": "5 4 1 15\n1 11 1 0 5", "output": "4"}, {"input": "5 4 0 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\nKenkoooo found a simple connected graph. The vertices are numbered 1 through n. The i-th edge connects Vertex... | [{"input": "8 7\n1 2 1000000000\n2 3 2\n3 4 1000000000\n4 5 2\n5 6 1000000000\n6 7 2\n2 8 1000000000", "output": "0\n"}, {"input": "8 7\n1 2 1000000000\n2 3 2\n2 4 1000000000\n4 5 2\n5 6 1000000000\n6 7 2\n2 8 1000000000", "output": "0\n"}, {"input": "8 7\n1 2 1000000000\n2 3 2\n3 6 1000000000\n4 5 2\n5 6 1000000000\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\nProblem\n\nI chose creature observation as the theme of my free study during the summer vacation and purchase... | [{"input": "5\n00000\n01010\n00000\n00100\n00000\n\n00000\n01010\n00000\n01010\n00000\n\n00000\n00100\n00000\n01010\n00000\n\n00000\n01110\n00000\n00100\n00000\n\n00000\n00000\n00100\n00000\n00000\n\n1 2\n2 3 4\n4\n01110\n00100\n00100\n00100\n01110\n\n01110\n10001\n10000\n10001\n01110\n\n11111\n10001\n11111\n10000\n100... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nwHAT DO WE NEED cAPS LOCK FOR?\n\nCaps lock is a computer keyboard key. Pressing it sets an input mode in whi... | [{"input": "cTKDZNWVYRTFPQLDAUUNSPKTDJTUPPFPRXRSINTVFVNNQNKXWUZUDHZBUSOKTABUEDQKUIVRTTVUREEOBJTSDKJKVEGFXVHXEYPE\n", "output": "Ctkdznwvyrtfpqldauunspktdjtuppfprxrsintvfvnnqnkxwuzudhzbusoktabuedqkuivrttvureeobjtsdkjkvegfxvhxeype\n"}, {"input": "KETAXTSWAAOBKUOKUQREHIOMVMMRSAEWKGXZKRASwTVNSSFSNIWYNPSTMRADOADEEBURRHPOOBI... | code_stdio |
[
{
"content": "You are an expert Python programmer. 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 two small spaceship, surrounded by two groups of enemy larger spaceships. The space is a two-dimens... | [{"input": "50 60\n445 303 -861 -583 436 -125 312 -700 -829 -865 -276 -25 -725 -286 528 -221 757 720 -572 514 -514 359 294 -992 -838 103 611 776 830 143 -247 182 -241 -627 299 -824 635 -571 -660 924 511 -876 160 569 -570 827 75 558 708 46\n899 974 750 -138 -439 -904 -113 -761 -150 -92 -279 489 323 -649 -759 667 -600 -7... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nTakahashi and Aoki will have a battle using their monsters.\nThe health and strength of Takahashi's monster a... | [{"input": "100 1 100 1\n", "output": "Yes\n"}, {"input": "85 7 30 19\n", "output": "Yes\n"}, {"input": "85 7 23 19\n", "output": "Yes\n"}, {"input": "38 11 7 79\n", "output": "Yes\n"}, {"input": "45 13 80 90\n", "output": "No\n"}, {"input": "52 62 6 48\n", "output": "Yes\n"}, {"input": "59 11 32 59\n", "output": "No\n... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nA stowaway and a controller play the following game. \n\nThe train is represented by n wagons which are numbe... | [{"input": "50 42 13\nto head\n00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001\n", "output": "Controller 61\n"}, {"input": "49 44 14\nto head\n000000000000000000000000... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nVolodya likes listening to heavy metal and (occasionally) reading. No wonder Volodya is especially interested... | [{"input": "trueheavymetalissotruewellitisalsosoheavythatyoucanalmosteeeltheweightofmetalonyou\n", "output": "3\n"}, {"input": "trueheavymetalissotrufwellitisalsosoheavythatyoucanalmosteeeltheweightofmetalonyou\n", "output": "3\n"}, {"input": "uoynolatemfothgiewehtleeetsomlanacuoytahtyvaehososlasitillewfurtossilatemyva... | code_stdio |
[
{
"content": "You are an expert Python programmer. 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 recent years John has very successfully settled at his new job at the office. But John doesn't like to idl... | [{"input": "1000000000000000000 1000000000000000000 1000000000000000000 1000000000000000000 1000000 1000000000000000000\n", "output": "No\n"}, {"input": "1000000000000000000 1000000000000000000 1000000000000000000 1000000000000000000 1000000 1000000000000000000\n", "output": "No\n"}, {"input": "1000000000000000000 1000... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nNow Serval is a junior high school student in Japari Middle School, and he is still thrilled on math as befor... | [{"input": "100\n0 1 0 0 1 0 1 0 0 0 0 0 1 0 0 1 1 1 1 0 0 1 0 1 1 0 1 0 0 0 0 1 0 1 1 1 1 0 0 1 0 1 0 0 1 0 0 1 0 0 0 0 0 0 1 0 0 1 0 0 0 0 1 0 0 0 1 1 1 1 0 0 0 0 1 1 1 0 1 0 0 1 1 0 0 1 0 0 1 1 0 0 0 1 1 1 0 0 0 1\n1 2 3 4 2 6 5 5 4 8 10 8 1 14 5 16 3 11 13 11 12 8 11 22 8 17 19 5 15 27 14 13 12 4 6 2 10 25 36 14 16... | code_stdio |
[
{
"content": "You are an expert Python programmer. 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 about to assemble a character figure, consisting of N parts called Part 1, Part 2, ..., Part N a... | [{"input": "44242\n1 2 1 1 3 2 2 1 1 2 1 1 3 3 2 1 3 3 1 1 2 4 2 1 3 3 1 2 1 4 2 1 4 1 1 3 1 1 1 2 3 1 3 1 1 3 2 2 2 1 2 2 2 2 3 1 3 2 2 2 2 2 2 1 4 3 1 2 1 2 2 1 2 5 1 1 3 5 2 2 1 3 6 2 1 2 1 1 3 1 1 1 1 4 1 2 2 1 1 1 2 1 2 3 1 4 1 1 1 2 2 3 1 1 1 2 3 1 1 4 1 1 2 2 2 4 2 3 1 1 2 3 2 2 2 2 2 2 1 2 2 3 2 2 1 1 1 3 4 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\nFind \\displaystyle{\\sum_{a=1}^{K}\\sum_{b=1}^{K}\\sum_{c=1}^{K} \\gcd(a,b,c)}.\nHere \\gcd(a,b,c) denotes t... | [{"input": "200\n", "output": "10813692\n"}, {"input": "199\n", "output": "10611772\n"}, {"input": "198\n", "output": "10493367\n"}, {"input": "197\n", "output": "10290813\n"}, {"input": "196\n", "output": "10174780\n"}, {"input": "195\n", "output": "9997134\n"}, {"input": "157\n", "output": "5205481\n"}, {"input": "12... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nIn a small restaurant there are a tables for one person and b tables for two persons. \n\nIt it known that n ... | [{"input": "30 10 10\n1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2 2 2\n", "output": "20\n"}, {"input": "30 10 10\n1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2 2 2\n", "output": "20\n"}, {"input": "20 4 3\n2 2 2 2 2 2 2 2 1 2 1 1 2 2 1 2 2 2 1 2\n", "output": "25\n"}, {"input": "20 4 3\n2 2 2 2 2 ... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nGiven an array (or list) of scores, return the array of _ranks_ for each value in the array. The largest val... | [{"input": "[5, 2, 3, 5, 5, 4, 9, 8, 0]", "output": "[[3, 8, 7, 3, 3, 6, 1, 2, 9]]", "fn_name": "ranks"}, {"input": "[-1, 3, 3, 3, 5, 5]", "output": "[[6, 3, 3, 3, 1, 1]]", "fn_name": "ranks"}, {"input": "[-5, -10, 3, 1]", "output": "[[3, 4, 1, 2]]", "fn_name": "ranks"}, {"input": "[1, 10, 4]", "output": "[[3, 1, 2]]",... | 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\nSometimes it is hard to prepare tests for programming problems. Now Bob is preparing tests to new problem abo... | [{"input": "rdtevvmiqmfgvafkdypxjthzhfsbavmhgkavkfonscaokdxoscenpxrc\nijbvueenzsmgkmkrskjspvfchwkqdglkxnrdtevvmiqmfgvafkdypxjthz\nkqdglkxnrdtevvmiqmfgvafkdypxjthzhfsbavmhgkavkfonscaokdxoscenpxrcivydtkrxjy\n", "output": "100\n"}, {"input": "iefouqzxoyuieqdzalfktehtvdbvjmeubju\nocotspetkkhvwfgaqynhovjwjhciefouqzxoyuieqdz... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nVasya has found a piece of paper with a coordinate system written on it. There are n distinct squares drawn i... | [{"input": "50 2\n611819205 916034844 226292837 817298502 176794540 727900268 460009451 154197232 1083758894 641633528 316549457 84943963 320598147 360295861 299532522 279193498 61088105 776327911 952977833 796036148 193827182 248414821 822409059 451009120 316494610 702170585 194014479 567762248 201775925 186588924 630... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nNauuo is a girl who loves playing cards.\n\nOne day she was playing cards but found that the cards were mixed... | [{"input": "20\n0 0 0 0 5 6 7 8 0 0 11 12 13 14 15 16 17 18 0 0\n20 9 19 0 0 0 0 0 0 10 0 0 0 0 0 0 1 2 3 4\n", "output": "37\n"}, {"input": "20\n15 10 6 0 0 11 19 17 0 0 0 0 0 1 14 0 3 4 0 12\n20 7 0 0 0 0 0 0 5 8 2 16 18 0 0 13 9 0 0 0\n", "output": "30\n"}, {"input": "20\n15 10 6 0 0 11 19 17 0 0 0 0 0 1 14 0 3 4 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\nWrite a function that accepts two arguments: an array/list of integers and another integer (`n`). \n\nDetermi... | [{"input": "[1, 1, 5, 6, 9, 16, 27]\n4", "output": "[3]", "fn_name": "int_diff"}, {"input": "[4, 8, 12, 12, 3, 6, 2]\n6", "output": "[3]", "fn_name": "int_diff"}, {"input": "[1, 2, 3, 4, 5, 6, 7]\n7", "output": "[0]", "fn_name": "int_diff"}, {"input": "[1, 6, 2, 3, 7, 8, 7]\n0", "output": "[1]", "fn_name": "int_diff"},... | 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\nAt the start of each season, every player in a football team is assigned their own unique squad number. Due t... | [{"input": "[1, 2, 3, 4, 6, 9, 10, 11, 15, 18, 27, 29, 34, 36, 38, 45, 47, 54, 56, 63, 65, 69, 72, 74, 81, 83, 90, 92]\n9", "output": "[null]", "fn_name": "generate_number"}, {"input": "[1, 2, 3, 4, 6, 9, 10, 11, 15, 18, 27, 29, 34, 36, 38, 45, 47, 54, 56, 63, 65, 69, 72, 74, 81, 83, 92]\n9", "output": "[null]", "fn_na... | code_functional |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nAncient Egyptians are known to have understood difficult concepts in mathematics. The ancient Egyptian mathem... | [{"input": "((((4?6)?9)?((5?(7?1))?(6?(4?(((((((7?3)?7)?(((((8?(6?7))?((1?2)?(5?8)))?8)?7)?4))?6)?7)?1)?((7?(2?((1?(((8?(((((2?7)?(((((3?6)?3)?(((((9?5)?7)?(1?(5?5)))?(8?((3?(1?2))?((8?5)?(7?((9?((9?8)?7))?1))))))?1))?1)?(9?2)))?((7?5)?((9?(4?(9?6)))?(8?(((5?7)?2)?(6?(3?8)))))))?(((4?(2?2))?(7?9))?((7?((((4?(3?(7?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\nIto joined the Kyudo club after entering high school. At first, I had a hard time because the arrow didn't re... | [{"input": "20\n1\n11\n1\n-1\n0\n8\n-2\n1\n0", "output": "12\n-1\n"}, {"input": "20\n1\n10\n1\n-1\n0\n8\n-2\n1\n0", "output": "11\n-1\n"}, {"input": "20\n3\n2\n0\n1\n12\n8\n-1\n-1\n0", "output": "18\n-2\n"}, {"input": "20\n5\n10\n3\n1\n-2\n8\n0\n-2\n0", "output": "17\n-2\n"}, {"input": "20\n-1\n-2\n1\n-1\n0\n8\n0\n1\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\nYou are given n Γ m table. Each cell of the table is colored white or black. Find the number of non-empty set... | [{"input": "5 50\n1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1\n1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1\n1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1\... | code_stdio |
[
{
"content": "You are an expert Python programmer. 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 cord whose length is a positive integer. We will perform the following condition until the length o... | [{"input": "52", "output": "18014398509481982\n"}, {"input": "51", "output": "9007199254740990\n"}, {"input": "49", "output": "2251799813685246\n"}, {"input": "50", "output": "4503599627370494\n"}, {"input": "48", "output": "1125899906842622\n"}, {"input": "47", "output": "562949953421310\n"}, {"input": "45", "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\nOne day in the IT lesson Anna and Maria learned about the lexicographic order.\n\nString x is lexicographical... | [{"input": "hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhihhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nThe only difference between easy and hard versions is the length of the string.\n\nYou are given a string $s$... | [{"input": "izoiweukqszkkhwapzxyotbaarpqxbybsjxilhylbbjbvoedrezyluaabsfzvtxxvncdwxrlfdtfvbfoqwlzqwneimwzpoygfdcldmxdhoxzensxlspituzocvzzrfomhggrwurdccgfoorvhyzsdkpjhwakuoxwdjhzaalanyzwuuqwlrtmvmdraleyusjqdyxuztvc\nizoiweukqszkkhwapzxyotbaarpqxbybsjxilhylbbjbvoedrezyluaabsfzvtxxvncdwxrlfdtfvbfoqwlzqwneimwzpoygfdcldmxdho... | code_stdio |
[
{
"content": "You are an expert Python programmer. 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 girl named Xenia has a cupboard that looks like an arc from ahead. The arc is made of a semicircle with rad... | [{"input": "1 10000000\n", "output": "20000001\n"}, {"input": "2 10000000\n", "output": "10000001\n"}, {"input": "1 10010000\n", "output": "20020001\n"}, {"input": "3 15787624\n", "output": "10525083\n"}, {"input": "2 10001000\n", "output": "10001001\n"}, {"input": "1 10010001\n", "output": "20020003\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\nNathan O. Davis is challenging a kind of shooter game. In this game, enemies emit laser beams from outside of... | [{"input": "100 100 1 1\n78 1 50 100 21\n640 295 1 2\n1 -1 640 480 100\n0 0 0 0", "output": "Yes\nYes\n"}, {"input": "100 100 1 0\n78 1 50 100 21\n640 295 1 2\n1 -1 640 480 100\n0 0 0 0", "output": "Yes\nYes\n"}, {"input": "100 100 1 0\n78 1 50 100 21\n640 292 1 2\n1 -1 640 480 100\n0 0 0 0", "output": "Yes\nYes\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\nToday on Informatics class Nastya learned about GCD and LCM (see links below). Nastya is very intelligent, so... | [{"input": "1000000000 1000000000 1000000000 1000000000\n", "output": "1\n"}, {"input": "1000000000 1000000000 1000000000 1000000000\n", "output": "1\n"}, {"input": "1000000000 1000000000 1000100000 1000000000\n", "output": "0\n"}, {"input": "11678540 172842392 2335708 864211960\n", "output": "4\n"}, {"input": "1167854... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nPolycarp has just invented a new binary protocol for data transmission. He is encoding positive integer decim... | [{"input": "89\n11111111101111111110111111111011111111101111111110111111111011111111101111111110111111111\n", "output": "999999999\n"}, {"input": "89\n11111111101111111110111111111011111111101111111110111111111011111111101111111110111111111\n", "output": "999999999\n"}, {"input": "53\n1011011101111011111011111101111111... | code_stdio |
[
{
"content": "You are an expert Python programmer. 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 stones arranged on an axis. Initially the i-th stone is located at the coordinate s_i. There may ... | [{"input": "20\n53 86 76 100 16 12 13 97 79 23 28 64 42 10 23 56 59 76 48 12\n48 49 49 49 48 49 48 49 49 49 48 48 48 49 49 49 49 49 49 48\n", "output": "YES\n19\n14 1 4\n14 16 7\n14 17 10\n14 12 15\n14 3 2\n6 3 25\n6 18 11\n20 18 16\n20 9 20\n7 9 10\n7 2 25\n5 2 12\n5 8 20\n10 8 25\n15 8 3\n15 4 22\n11 4 21\n13 4 7\n19... | code_stdio |
[
{
"content": "You are an expert Python programmer. 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 and your best friend Stripes have just landed your first high school jobs! You'll be delivering newspaper... | [{"input": "499", "output": "[48.06]", "fn_name": "cheapest_quote"}, {"input": "10", "output": "[0.97]", "fn_name": "cheapest_quote"}, {"input": "20", "output": "[1.93]", "fn_name": "cheapest_quote"}, {"input": "40", "output": "[3.85]", "fn_name": "cheapest_quote"}, {"input": "41", "output": "[3.95]", "fn_name": "cheap... | 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 the set of positive integers $S$ correct if the following two conditions are met:\n\n$S \\subseteq... | [{"input": "1000000000 22 22\n", "output": "500000006\n"}, {"input": "1000000000 21 22\n", "output": "488372094\n"}, {"input": "1000000000 20 22\n", "output": "476190480\n"}, {"input": "455678451 22 17\n", "output": "221997195\n"}, {"input": "708087026 21 16\n", "output": "344474771\n"}, {"input": "706836718 14 15\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 trains to compose crossword puzzles. He can only compose crosswords of a very simplΠ΅ type so far. All o... | [{"input": "ABBAAAABBBB\nBBABAAAABAABAB\nBAABABBBABBBBBAAA\nBABABAAABBAAABBAAAAB\nABAAAABBBBBABAABABBAAAAABBBBBB\nBBBBAABBAABBBBABAAABAABBAABBAA\n", "output": "BAABABBBABBBBBAAA.............\nA...............B.............\nB...............A.............\nA...............A.............\nB...............A.............\n... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nThere is unrest in the Galactic Senate. Several thousand solar systems have declared their intentions to leav... | [{"input": "100 100\n52 93 36 69 49 37 48 42 63 27 16 60 16 63 80 37 69 24 86 38 73 15 43 65 49 35 39 98 91 24 20 35 12 40 75 32 54 4 76 22 23 7 50 86 41 9 9 91 23 18 41 61 47 66 1 79 49 21 99 29 87 94 42 55 87 21 60 67 36 89 40 71 6 63 65 88 17 12 89 32 79 99 34 30 63 33 53 56 10 11 66 80 73 50 47 12 91 42 28 56\n1 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\nEverybody knows what an arithmetic progression is. Let us remind you just in case that an arithmetic progress... | [{"input": "40\n100000000 100000000 100000000 100000000 100000000 100000000 100000000 100000000 100000000 100000000 100000000 100000000 100000000 100000000 100000000 100000000 100000000 100000000 100000000 100000000 100000000 100000000 100000000 100000000 100000000 100000000 100000000 100000000 100000000 100000000 1000... | code_stdio |
[
{
"content": "You are an expert Python programmer. 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 walruses standing in a queue in an airport. They are numbered starting from the queue's tail: the... | [{"input": "15\n18 6 33 21 14 20 13 9 18 20 28 13 19 25 21\n", "output": "10 -1 11 8 6 6 0 -1 2 2 3 -1 -1 0 -1 "}, {"input": "15\n18 6 33 21 14 20 20 9 18 20 28 13 19 25 21\n", "output": "10 -1 11 8 6 6 5 -1 2 2 3 -1 -1 0 -1 "}, {"input": "15\n18 6 33 21 14 17 20 9 18 20 28 13 19 25 21\n", "output": "10 -1 11 8 6 5 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\nTraining is indispensable for achieving good results at ICPC. Rabbit wants to win at ICPC, so he decided to p... | [{"input": "3\n0\n0\n1000000010", "output": "1000000010\n0\n0\n"}, {"input": "3\n0\n0\n1000000000", "output": "1000000000\n0\n0"}, {"input": "4\n11\n5\n10\n10", "output": "5\n10\n10\n11\n"}, {"input": "4\n11\n5\n19\n10", "output": "5\n10\n11\n19\n"}, {"input": "4\n18\n5\n19\n10", "output": "5\n10\n18\n19\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\nTwo tortoises named ***A*** and ***B*** must run a race. ***A*** starts with an average speed of ```720 feet ... | [{"input": "720\n850\n370", "output": "[[2, 50, 46]]", "fn_name": "race"}, {"input": "820\n850\n550", "output": "[[18, 20, 0]]", "fn_name": "race"}, {"input": "720\n850\n70", "output": "[[0, 32, 18]]", "fn_name": "race"}, {"input": "720\n850\n37", "output": "[[0, 17, 4]]", "fn_name": "race"}, {"input": "80\n91\n37", "o... | code_functional |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nGiven are integer sequences A and B of length 3N. Each of these two sequences contains three copies of each o... | [{"input": "8\n3 6 7 5 4 8 4 1 1 3 8 7 3 8 2 4 7 5 2 2 6 5 6 1\n7 5 8 1 3 6 7 5 4 8 1 3 3 8 2 4 2 6 5 6 1 4 7 2", "output": "7"}, {"input": "3\n2 3 3 1 2 1 2 1 3\n3 2 2 1 1 1 3 3 2", "output": "-1\n"}, {"input": "3\n2 3 3 1 1 1 3 2 2\n3 2 2 1 1 1 3 3 2", "output": "-1\n"}, {"input": "3\n1 1 2 2 1 2 3 3 3\n1 1 1 2 3 2 3... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nThere are $n$ districts in the town, the $i$-th district belongs to the $a_i$-th bandit gang. Initially, no d... | [{"input": "4\n5\n1 3 2 1 5\n3\n2 1 0\n4\n-1 1000 101 1000\n4\n1 2 3 4\n", "output": "YES\n1 2\n1 3\n1 5\n5 4\nYES\n1 2\n1 3\nYES\n1 2\n1 3\n1 4\nYES\n1 2\n1 3\n1 4\n"}, {"input": "4\n5\n1 3 2 1 5\n3\n1 1 0\n4\n-1 1000 101 1000\n4\n1 2 3 4\n", "output": "YES\n1 2\n1 3\n1 5\n5 4\nYES\n1 3\n3 2\nYES\n1 2\n1 3\n1 4\nYES\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 non-negative integer N, define S(N) as the sum of the odd digits of N\nplus twice the sum of the even d... | [{"input": "3\n0 10\n34 453\n517800 1591348", "output": "46\n1890\n4830969\n"}, {"input": "3\n0 10\n16 252\n314159 1591348", "output": "46\n1065\n5747356\n"}, {"input": "3\n1 10\n28 297\n314159 559966", "output": "46\n1207\n1106130\n"}, {"input": "3\n1 10\n28 297\n206640 516069", "output": "46\n1207\n1392435\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\nIt is a holiday season, and Koala is decorating his house with cool lights! He owns $n$ lights, all of which ... | [{"input": "70\n0010011111011101101111000111101011010101000011000000010100010101010001\n3 1\n1 5\n3 1\n4 1\n3 3\n2 4\n2 1\n5 1\n2 4\n5 2\n5 2\n4 1\n2 5\n2 2\n4 2\n5 1\n1 2\n2 4\n3 1\n1 1\n5 3\n5 2\n3 5\n4 4\n2 1\n3 2\n1 3\n5 1\n3 4\n2 3\n1 5\n4 1\n2 2\n5 1\n3 3\n4 2\n1 4\n5 2\n1 2\n4 1\n1 4\n5 3\n3 3\n2 5\n3 5\n3 4\n3 ... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nTakahashi has many red balls and blue balls. Now, he will place them in a row.\nInitially, there is no ball p... | [{"input": "984159202374430527 552558592232591693 265756112319848958\n", "output": "718403090054581569\n"}, {"input": "994914121424164663 818665214162491101 129546857230076861\n", "output": "865367264194087802\n"}, {"input": "501719768609305159 370614275896614890 131105492712690269\n", "output": "370614275896614890\n"}... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nA 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 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.