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 cities and M roads.\nThe i-th road (1≤i≤M) connects two cities a_i and b_i (1≤a_i,b_i≤N) bidirect... | [{"input": "17 1\n2 8\n3 4\n1 5\n2 8\n4 7\n8 2\n4 1\n0 14", "output": "0\n1\n0\n0\n0\n0\n0\n1\n0\n0\n0\n0\n0\n0\n0\n0\n0\n"}, {"input": "13 7\n2 4\n3 4\n1 5\n2 8\n3 7\n5 2\n4 1\n6 8", "output": "2\n3\n2\n3\n2\n0\n1\n1\n0\n0\n0\n0\n0\n"}, {"input": "13 7\n2 4\n3 4\n1 6\n2 8\n3 7\n5 2\n4 1\n6 8", "output": "2\n3\n2\n3\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\nNaturally, the magical girl is very good at performing magic. She recently met her master wizard Devu, who gi... | [{"input": "3\n0 0 0 1\n2\n0\n0\n0 -1 -1 0\n3\n4\n-1\n3 1 2 1\n2 1 0\n1 12\n0 15", "output": "1\n4\n12\n"}, {"input": "3\n0 0 0 1\n2\n0\n0\n0 -1 -1 0\n3\n5\n-1\n3 1 2 1\n2 1 0\n1 12\n0 15", "output": "1\n5\n12\n"}, {"input": "3\n0 0 1 0\n1\n0\n0\n2 -1 1 0\n3\n4\n2\n6 2 2 0\n2 1 3\n1 7\n9 15", "output": "1\n4\n15\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 are N towns numbered 1, 2, \\cdots, N.\n\nSome roads are planned to be built so that each of them conne... | [{"input": "10\n2 10 9 -1 6 10 -1 -1 -1 -1", "output": "522237\n"}, {"input": "10\n2 8 9 -1 6 10 -1 -1 -1 -1", "output": "515457\n"}, {"input": "10\n1 9 9 -1 6 10 -1 -1 -1 -1", "output": "473877\n"}, {"input": "10\n4 2 6 -1 10 7 -1 -1 -1 -1", "output": "471888\n"}, {"input": "10\n2 6 9 -1 10 2 -1 -1 -1 -1", "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\nNastya came to her informatics lesson, and her teacher who is, by the way, a little bit famous here gave her ... | [{"input": "4 9\n1 1 1 1 1 1 1 1 1\n1 1 1 1 1 1 1 1 1\n1 1 1 1 1 1 1 1 1\n1 1 1 1 1 1 1 1 1\n1 1 1 1 1 1 1 1 1\n1 1 1 1 1 1 1 1 1\n1 1 1 1 1 1 1 1 1\n1 1 1 1 1 1 1 1 1\n", "output": "YES\n"}, {"input": "4 9\n1 1 1 1 1 1 1 1 1\n1 1 1 1 1 1 1 1 1\n1 1 1 1 1 1 1 1 1\n1 1 1 1 1 1 1 1 1\n1 1 1 1 1 1 1 1 1\n1 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\nFor an array of non-negative integers $a$ of size $n$, we construct another array $d$ as follows: $d_1 = a_1$... | [{"input": "69\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\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\nGiven an integer a as input, print the value a + a^2 + a^3.\n\n-----Constraints-----\n - 1 \\leq a \\leq 10\n... | [{"input": "1109", "output": "1365169019\n"}, {"input": "488", "output": "116452904\n"}, {"input": "762", "output": "443032134\n"}, {"input": "767", "output": "451806719\n"}, {"input": "853", "output": "621378939\n"}, {"input": "916", "output": "769415268\n"}, {"input": "249", "output": "15500499\n"}, {"input": "367", ... | code_stdio |
[
{
"content": "You are an expert Python programmer. 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 size of the input.\n\nYou are given a string $s$ co... | [{"input": "3\n5 2\nBGGGG\n5 3\nRBRGR\n5 5\nBBBRR\n", "output": "1\n0\n3\n"}, {"input": "3\n5 2\nGGBGG\n5 3\nRBRGR\n5 5\nBBBRR\n", "output": "0\n0\n3\n"}, {"input": "3\n5 2\nBGGGG\n5 1\nRBRGR\n5 5\nBBBRR\n", "output": "1\n0\n3\n"}, {"input": "3\n5 2\nBGGGG\n5 2\nRRBGR\n5 5\nBBBRR\n", "output": "1\n1\n3\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\nNearly each project of the F company has a whole team of developers working on it. They often are in differen... | [{"input": "110 5\n- 60\n- 58\n+ 25\n- 32\n+ 86\n", "output": "105\n1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 26 27 28 29 30 31 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 59 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 87 88 89 90 91 92 ... | code_stdio |
[
{
"content": "You are an expert Python programmer. 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 Susie loves strings. Today she calculates distances between them. As Susie is a small girl after all, ... | [{"input": "00001111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111\n1111110000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSection numbers are strings of dot-separated integers. The highest level sections (chapters) are numbered 1, ... | [{"input": "\"1.2.3.4\"\n\"1.2.3.4\"", "output": "[0]", "fn_name": "compare"}, {"input": "\"1.2.3\"\n\"1.02.003\"", "output": "[0]", "fn_name": "compare"}, {"input": "\"3.0.0\"\n\"3.1.1\"", "output": "[-1]", "fn_name": "compare"}, {"input": "\"1.2.1\"\n\"1.2.0\"", "output": "[1]", "fn_name": "compare"}, {"input": "\"3.... | 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 array $a$ consisting of $n$ integers.\n\nYou can remove at most one element from this array.... | [{"input": "12\n123654 1 2 3 4 5 6 7 16 9 10 11\n", "output": "10\n"}, {"input": "12\n123654 1 2 3 4 5 6 7 8 9 10 11\n", "output": "11\n"}, {"input": "12\n123654 1 2 6 4 5 6 7 16 9 10 11\n", "output": "7\n"}, {"input": "12\n123654 1 2 6 4 5 6 7 16 9 18 11\n", "output": "7\n"}, {"input": "12\n123654 1 2 6 4 5 6 9 16 9 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\nFor a non-negative integer K, we define a fractal of level K as follows:\n\n* A fractal of level 0 is a grid ... | [{"input": "2\n3 2 7 8\n12 3 1 15", "output": "10\n23\n"}, {"input": "2\n0 2 7 8\n12 3 1 15", "output": "13\n23\n"}, {"input": "2\n0 2 10 8\n6 3 1 15", "output": "16\n17\n"}, {"input": "2\n15 2 4 4\n7 6 1 26", "output": "13\n26\n"}, {"input": "2\n2 14 2 4\n13 3 2 5", "output": "12\n13\n"}, {"input": "2\n3 2 7 8\n7 3 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 saw the little game Marmot made for Mole's lunch. Now it's Marmot's dinner time and, as we all know, Marmo... | [{"input": "3 1\n1 3\n2 3\n4 10\n", "output": "14\n12\n2032\n"}, {"input": "3 1\n1 3\n2 3\n4 6\n", "output": "14\n12\n112\n"}, {"input": "3 1\n2 6\n1 3\n4 4\n", "output": "124\n14\n16\n"}, {"input": "3 1\n1 3\n2 5\n1 6\n", "output": "14\n60\n126\n"}, {"input": "3 1\n1 3\n2 3\n4 4\n", "output": "14\n12\n16\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\n## Task:\nYou have to create a function `isPronic` to check whether the argument passed is a Pronic Number an... | [{"input": "-27", "output": "[false]", "fn_name": "is_pronic"}, {"input": "-3", "output": "[false]", "fn_name": "is_pronic"}, {"input": "3", "output": "[false]", "fn_name": "is_pronic"}, {"input": "4", "output": "[false]", "fn_name": "is_pronic"}, {"input": "5", "output": "[false]", "fn_name": "is_pronic"}, {"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\nWhat are you doing at the end of the world? Are you busy? Will you save us?\n\n<image>\n\nNephren is playing ... | [{"input": "10\n100000 873326525630182716\n100000 620513733919162415\n100000 482953375281256917\n100000 485328193417229962\n100000 353549227094721271\n100000 367447590857326107\n100000 627193846053528323\n100000 243833127760837417\n100000 287297493528203749\n100000 70867563577617188\n", "output": "o W rlot"}, {"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\nA palindrome is a word, phrase, number, or other sequence of characters which reads the same backward as forw... | [{"input": "\"ACCDDCCA\"\n3", "output": "[\"Not valid\"]", "fn_name": "palindrome"}, {"input": "773\n\"1551\"", "output": "[\"Not valid\"]", "fn_name": "palindrome"}, {"input": "6\n4", "output": "[[11, 22, 33, 44]]", "fn_name": "palindrome"}, {"input": "-4505\n15", "output": "[\"Not valid\"]", "fn_name": "palindrome"},... | code_functional |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n< PREVIOUS KATA\nNEXT KATA >\n \n###Task:\n\nYou have to write a function `pattern` which returns the followi... | [{"input": "5", "output": "[\" 11111 \\n 22222 \\n 33333 \\n 44444 \\n1234555554321\\n1234555554321\\n1234555554321\\n1234555554321\\n1234555554321\\n 44444 \\n 33333 \\n 22222 \\n 11111 \"]", "fn_name": "pattern"}, {"input": "3", "output": "[\" 111 \\n 222 \\n1233321... | code_functional |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nThe cows have just learned what a primitive root is! Given a prime p, a primitive root $\\operatorname{mod} p... | [{"input": "1583\n", "output": "672\n"}, {"input": "1987\n", "output": "660\n"}, {"input": "1993\n", "output": "656\n"}, {"input": "1997\n", "output": "996\n"}, {"input": "1999\n", "output": "648\n"}, {"input": "1297\n", "output": "432\n"}, {"input": "1259\n", "output": "576\n"}, {"input": "1949\n", "output": "972\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\nProblem Statement\n\nIn the headquarter building of ICPC (International Company of Plugs & Connectors), there... | [{"input": "3 10 3\n000 0000000000\n110 0000001011\n101 1111111100\n2 6 0\n1 2 0\n2 1 1\n01 1\n11 11 10\n10000000000 10000000000\n11000000000 00000000000\n01100000000 00100000000\n00110000000 00010000000\n00011000000 00001000000\n00001100000 00000100000\n01000110000 00000010000\n00000011000 00000001000\n00000001100 000... | code_stdio |
[
{
"content": "You are an expert Python programmer. 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 wants to train before another programming competition. During the first day of his training he shoul... | [{"input": "5\n200000 200000 200000 200000 200000\n", "output": "5\n"}, {"input": "5\n200000 200000 200000 200000 200000\n", "output": "5\n"}, {"input": "5\n200000 200000 200000 200000 329398\n", "output": "5\n"}, {"input": "5\n330358 200000 200000 200000 200000\n", "output": "5\n"}, {"input": "5\n200000 201888 200000 ... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nWe have a string S consisting of lowercase English letters.\nIf the length of S is at most K, print S without... | [{"input": "99\nlbyhybgfptdyuqnlszvxoggbjhrjopbevyrzytfhiabtoozntnxxcvmhckjlwxnzniwzzxzvmfiztyirssfeauzncyosgrmsgull\n", "output": "lbyhybgfptdyuqnlszvxoggbjhrjopbevyrzytfhiabtoozntnxxcvmhckjlwxnzniwzzxzvmfiztyirssfeauzncyosgrmsgul...\n"}, {"input": "100\nvefcekrnrodmjprtifxrvjtjgzvuidhbtadwuqxctuwqfxhiuuupmsggdrmpswcq... | code_stdio |
[
{
"content": "You are an expert Python programmer. 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 want to build a fence that will consist of $n$ equal sections. All sections have a width equal to $1$ and... | [{"input": "6\n2 3\n0 0\n2 3\n0 3\n2 3\n3 0\n3 3\n4 0 4\n3 3\n4 0 5\n3 3\n5 0 4\n", "output": "YES\nNO\nNO\nYES\nNO\nNO\n"}, {"input": "6\n2 3\n0 0\n2 3\n0 3\n2 3\n3 0\n3 3\n4 0 4\n3 3\n4 0 5\n3 3\n5 0 4\n", "output": "YES\nNO\nNO\nYES\nNO\nNO\n"}, {"input": "6\n2 3\n0 0\n2 3\n0 3\n2 3\n3 0\n3 3\n4 0 4\n3 3\n4 0 5\n3 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\nTo charge your mobile phone battery, do you know how much time it takes from 0% to 100%? It depends ... | [{"input": "1000\n5000", "output": "[0.26]", "fn_name": "calculate_time"}, {"input": "3050\n2600", "output": "[1.53]", "fn_name": "calculate_time"}, {"input": "2000\n1000", "output": "[2.6]", "fn_name": "calculate_time"}, {"input": "5000\n1000", "output": "[6.5]", "fn_name": "calculate_time"}, {"input": "1000\n500", "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\nKavi has 2n points lying on the OX axis, i-th of which is located at x = i.\n\nKavi considers all ways to spl... | [{"input": "1000000\n", "output": "126330412"}, {"input": "372544\n", "output": "214345447\n"}, {"input": "315936\n", "output": "256195953\n"}, {"input": "446167\n", "output": "461428149\n"}, {"input": "797112\n", "output": "121466915\n"}, {"input": "119444\n", "output": "553363384\n"}, {"input": "916542\n", "output": ... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nYou are given an array of integers. Vasya can permute (change order) its integers. He wants to do it so that ... | [{"input": "6\n300000000 200000000 300000000 200000000 1000000000 300000000\n", "output": "3\n"}, {"input": "6\n300000000 200000000 300000000 200000000 1000000000 300000000\n", "output": "3\n"}, {"input": "6\n506233607 200000000 300000000 200000000 1000000000 300000000\n", "output": "4\n"}, {"input": "6\n144373768 2000... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nHave you ever tasted Martian food? Well, you should.\n\nTheir signature dish is served on a completely black ... | [{"input": "2\n4 3 1\n5 2 2\n", "output": "0.9230769231\n0.6521739130\n"}, {"input": "2\n8 3 1\n4 2 2\n", "output": "2.4489795918\n0.6666666667\n"}, {"input": "2\n9 3 1\n4 2 2\n", "output": "2.5714285714\n0.6666666667\n"}, {"input": "2\n8 5 1\n4 2 2\n", "output": "2.4489795918\n0.6666666667\n"}, {"input": "2\n4 3 1\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\nAppleman has a tree with n vertices. Some of the vertices (at least one) are colored black and other vertices... | [{"input": "100\n0 0 2 2 0 3 5 0 6 2 0 4 0 2 3 7 8 3 15 19 13 8 18 19 3 14 23 9 6 3 6 17 26 24 20 4 4 27 8 5 14 5 35 31 27 3 41 25 20 14 25 31 49 40 0 1 10 5 50 13 29 58 1 6 8 1 40 52 30 15 50 8 66 52 29 71 25 68 36 12 80 60 6 2 11 43 62 27 84 86 71 38 14 50 88 4 8 95 53\n1 0 0 1 0 0 1 0 1 0 0 0 1 0 1 1 0 1 1 1 1 0 0 0... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nYou are a given an array $a$ of length $n$. Find a subarray $a[l..r]$ with length at least $k$ with the large... | [{"input": "100 16\n14 94 97 89 73 165 11 78 10 30 54 57 88 57 44 6 33 40 17 26 69 100 92 67 22 59 80 67 17 29 76 69 133 7 86 45 1 98 99 25 65 102 94 91 7 24 53 40 53 91 59 32 67 24 25 157 55 46 68 53 2 15 92 5 53 37 76 40 49 94 4 8 76 12 50 2 54 86 49 95 81 5 34 28 21 47 97 73 96 56 32 78 71 38 49 24 64 78 35 18\n", "... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSnuke lives at position x on a number line.\nOn this line, there are two stores A and B, respectively at posi... | [{"input": "1 999 1000\n", "output": "A\n"}, {"input": "1 1455 0000", "output": "B\n"}, {"input": "1 1200 0101", "output": "B\n"}, {"input": "1 999 0000", "output": "B\n"}, {"input": "1 381 1110", "output": "A\n"}, {"input": "1 999 0100", "output": "B\n"}, {"input": "1 999 0101", "output": "B\n"}, {"input": "1 999 0001... | code_stdio |
[
{
"content": "You are an expert Python programmer. 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### What is simplifying a square root?\n\nIf you have a number, like 80, for example, you would start by find... | [{"input": "200", "output": "[\"10 sqrt 2\"]", "fn_name": "simplify"}, {"input": "18", "output": "[\"3 sqrt 2\"]", "fn_name": "simplify"}, {"input": "20", "output": "[\"2 sqrt 5\"]", "fn_name": "simplify"}, {"input": "24", "output": "[\"2 sqrt 6\"]", "fn_name": "simplify"}, {"input": "32", "output": "[\"4 sqrt 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\nSimple transposition is a basic and simple cryptography technique. We make 2 rows and put first a letter in t... | [{"input": "\"Imagination is more important than knowledge\"", "output": "[\"Iaiaini oeipratta nwegmgnto smr motn hnkolde\"]", "fn_name": "simple_transposition"}, {"input": "\"The better part of valor is discretion\"", "output": "[\"Tebte ato ao sdsrtoh etrpr fvlri icein\"]", "fn_name": "simple_transposition"}, {"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\nYou have received data from a Bubble bot. You know your task is to make factory facilities, but before you ev... | [{"input": "4 5\n9 14 11 12 13\n5 15 11 6 7\n5 8 14 9 14\n3 2 14 3 14\n", "output": "9 4 4 2 1 \n"}, {"input": "4 5\n9 14 9 12 13\n5 15 11 6 7\n5 9 14 9 14\n3 2 14 3 14\n", "output": "9 4 4 2 1 \n"}, {"input": "4 5\n9 14 11 12 13\n5 15 3 6 7\n5 9 14 9 14\n3 2 14 3 14\n", "output": "9 4 4 2 1 \n"}, {"input": "4 5\n9 14 ... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nExample\n\nInput\n\n2 2 2 1\n0 0 0\n\n\nOutput\n\n24### Format: Read the inputs from stdin solve the problem ... | [{"input": "26 2 22 0\n-1 2 0", "output": "1336\n"}, {"input": "36 2 22 0\n-1 2 0", "output": "1816\n"}, {"input": "36 2 43 0\n-1 2 0", "output": "3412\n"}, {"input": "3 8 88 0\n-2 8 -1", "output": "1984\n"}, {"input": "3 9 88 0\n-2 8 -1", "output": "2166\n"}, {"input": "3 9 82 0\n-2 8 -1", "output": "2022\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\nRecently Vova found $n$ candy wrappers. He remembers that he bought $x$ candies during the first day, $2x$ ca... | [{"input": "53\n3\n3\n3\n3\n3\n3\n3\n3\n3\n3\n3\n3\n3\n3\n3\n3\n3\n3\n3\n3\n3\n3\n3\n3\n3\n3\n3\n3\n3\n3\n3\n3\n3\n3\n3\n3\n3\n3\n3\n3\n3\n3\n3\n3\n3\n3\n3\n3\n3\n3\n3\n3\n3\n", "output": "1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\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\nYou are given a string of length N. Calculate the number of distinct substrings of S.\n\nConstraints\n\n* 1 \... | [{"input": "mjssissippi", "output": "57\n"}, {"input": "mjssisrippi", "output": "61\n"}, {"input": "mjssisripph", "output": "62\n"}, {"input": "hppirsitsjm", "output": "63\n"}, {"input": "mjsthspiroh", "output": "64\n"}, {"input": "hnripohtqgm", "output": "65\n"}, {"input": "hppirsissjm", "output": "62\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\nSnuke has decided to use a robot to clean his room.\n\nThere are N pieces of trash on a number line. The i-th... | [{"input": "16 10\n1 12 12 27 52 132 731 18298 395504 534840 1276551 903860 9384806 19108104 82684732 535447408", "output": "3248775590\n"}, {"input": "16 10\n0 12 12 27 52 132 731 18298 395504 534840 1276551 903860 9384806 19108104 82684732 535447408", "output": "3248775585\n"}, {"input": "16 10\n0 12 12 27 52 132 731... | code_stdio |
[
{
"content": "You are an expert Python programmer. 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 winner of the card game popular in Berland \"Berlogging\" is determined according to the following rules.... | [{"input": "12\natrtthfpcvishmqbakprquvnejr 185\natrtthfpcvishmqbakprquvnejr -699\natrtthfpcvishmqbakprquvnejr -911\natrtthfpcvishmqbakprquvnejr -220\nfcgslzkicjrpbqaifgweyzreajjfdo 132\nfcgslzkicjrpbqaifgweyzreajjfdo -242\nm 177\nm -549\natrtthfpcvishmqbakprquvnejr -242\nm 38\natrtthfpcvishmqbakprquvnejr -761\nfcgslzk... | code_stdio |
[
{
"content": "You are an expert Python programmer. 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\n2D, who is good at cooking, is trying to make lunch. Cooking requires all N ingredients ... | [{"input": "2\npaks 0\naxii -1\n-1\nnkua hx`j", "output": "-1\n"}, {"input": "2\ntako -1\njiay -1\n0\npuja yakh", "output": "-2\n"}, {"input": "2\npaks -2\nayhi -1\n0\nmauk j`xh", "output": "-3\n"}, {"input": "2\npaks 1\naxii -1\n-3\nokua hx`j", "output": "0\n"}, {"input": "2\npaks 1\naxii -1\n-1\nokua hx`j", "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\nYour friend gave you a dequeue D as a birthday present.\nD is a horizontal cylinder that contains a row of N ... | [{"input": "50 100\n-10000000 -10000000 -10000000 -10000000 -10000000 -10000000 -10000000 -10000000 -10000000 -10000000 -10000000 -10000000 -10000000 -10000000 -10000000 -10000000 -10000000 -10000000 -10000000 -10000000 -10000000 -10000000 -10000000 -10000000 -10000000 -10000000 -10000000 -10000000 -10000000 -10000000 ... | code_stdio |
[
{
"content": "You are an expert Python programmer. 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 permutation p of size n is an array such that every integer from 1 to n occurs exactly once in this array.\... | [{"input": "1000 4\n", "output": "373086956251\n"}, {"input": "1000 4\n", "output": "373086956251\n"}, {"input": "800 4\n", "output": "152620985001\n"}, {"input": "800 4\n", "output": "152620985001\n"}, {"input": "792 4\n", "output": "146597632567\n"}, {"input": "850 4\n", "output": "194577888126\n"}, {"input": "600 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\nproblem\n\nYou are a traveler traveling on the JOI Highway. The JOI Highway is a road that extends straight f... | [{"input": "7 5\n2\n0\n1\n1\n2\n-1\n2\n-1\n2\n2\n-3", "output": "10\n"}, {"input": "7 0\n1\n-1\n1\n3\n1\n-1\n3\n-2\n-1\n1\n0", "output": "0\n"}, {"input": "7 0\n1\n-1\n1\n2\n1\n-1\n3\n-2\n-1\n1\n0", "output": "0\n"}, {"input": "7 5\n2\n0\n1\n-1\n2\n-1\n2\n-1\n1\n2\n-3", "output": "2\n"}, {"input": "7 5\n4\n0\n1\n0\n2\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\nPetya loves lucky numbers very much. Everybody knows that lucky numbers are positive integers whose decimal r... | [{"input": "100000 77777\n", "output": "177777\n"}, {"input": "150234 77777\n", "output": "177777\n"}, {"input": "77777 77777\n", "output": "177777\n"}, {"input": "47774 47774\n", "output": "147774\n"}, {"input": "145251 7474\n", "output": "157474\n"}, {"input": "100832 7474\n", "output": "107474\n"}, {"input": "56081 ... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nYou are given a string S of length N and another string T of length M. These strings consist of lowercase Eng... | [{"input": "15 16\ndnausrayukusiia\ndujrunuma", "output": "240\n"}, {"input": "16 9\ndnsusrayukuaiia\ndujrunuma", "output": "144\n"}, {"input": "15 8\ndnausrayukusii`\ndujrunuma", "output": "120\n"}, {"input": "12 10\ndnsusrayukuaiia\nrujdunuma", "output": "-1\n"}, {"input": "12 10\ndnsussayukuaiia\nrujdunuma", "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# Task\n You are given a string consisting of `\"D\", \"P\" and \"C\"`. A positive integer N is called DPC of... | [{"input": "\"DDDDPDDCCCDDPDCCPCDCDDPCPCCDDCD\"", "output": "[15782844]", "fn_name": "DPC_sequence"}, {"input": "\"DPCPDPPPDCPDPDPC\"", "output": "[-1]", "fn_name": "DPC_sequence"}, {"input": "\"DDDDDDPCCDPDPP\"", "output": "[-1]", "fn_name": "DPC_sequence"}, {"input": "\"DDDDDDCD\"", "output": "[-1]", "fn_name": "DPC_... | 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\nKilani is playing a game with his friends. This game can be represented as a grid of size $n \\times m$, wher... | [{"input": "4 7 2\n13 1\n....###\n.#..1..\n.#.###.\n2#.....\n", "output": "18 1 \n"}, {"input": "4 7 2\n13 1\n###....\n..1..#.\n.###.#.\n.....#2\n", "output": "18 1 \n"}, {"input": "4 7 2\n13 1\n###....\n..1..#.\n.###.#.\n.....#2\n", "output": "18 1 \n"}, {"input": "4 7 2\n13 1\n....###\n.#..1..\n.#.###.\n2#.....\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\nOur master carpenter is designing a condominium called Bange Hills Mansion. The condominium is constructed by... | [{"input": "000 12 208", "output": "197\n"}, {"input": "000 9 208", "output": "200\n"}, {"input": "000 4 120", "output": "117\n"}, {"input": "000 16 106", "output": "91\n"}, {"input": "000 26 106", "output": "81\n"}, {"input": "000 1 165", "output": "165\n"}, {"input": "000 1 120", "output": "120\n"}, {"input": "000 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\nVladik often travels by trains. He remembered some of his trips especially well and I would like to tell you ... | [{"input": "100\n931 4584 2116 3004 3813 62 2819 2998 2080 4906 3198 2443 2952 3793 1958 3864 3985 3169 3134 4011 4525 995 4163 308 4362 1148 4906 3092 1647 244 1370 1424 2753 84 2997 1197 2606 425 3501 2606 683 4747 3884 4787 2166 3017 3080 4303 3352 1667 2636 3994 757 2388 870 1788 988 1303 0 1230 1455 4213 2113 2908... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nThe Smart Beaver from ABBYY decided to have a day off. But doing nothing the whole day turned out to be too b... | [{"input": "1000000000\n", "output": "1998535156\n"}, {"input": "999161856\n", "output": "1998319610\n"}, {"input": "999936000\n", "output": "1999743134\n"}, {"input": "999999948\n", "output": "1833697140\n"}, {"input": "999999000\n", "output": "1936337207\n"}, {"input": "999989760\n", "output": "1998828039\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\nOur world is one-dimensional, and ruled by two empires called Empire A and Empire B.\nThe capital of Empire A... | [{"input": "99 99 -22 62\n-9 -54 -13 -39 -79 -88 -6 -14 -41 -29 -2 -69 -30 -20 -33 -8 -24 -80 -19 -87 -32 -60 -40 -59 -44 -52 -3 -67 -18 -51 -56 -12 -7 -31 -48 -27 -68 -78 -21 -11 -49 -93 -1 -64 -82 -66 -70 -58 -84 -26 -57 -37 -53 -89 -50 -34 -61 -46 -92 -95 -99 -63 -65 -28 -10 -16 -73 -55 -98 -94 -77 -75 -62 -74 -42 -... | code_stdio |
[
{
"content": "You are an expert Python programmer. 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 river of width $n$. The left bank of the river is cell $0$ and the right bank is cell $n + 1$ (mor... | [{"input": "1000 232 105\n4 3 4 4 6 1 4 3 4 1 4 1 4 2 2 3 2 6 3 2 6 1 1 4 1 2 4 2 3 2 5 2 3 4 3 3 3 2 5 4 2 5 4 2 4 4 4 2 4 1 3 5 4 4 5 3 6 5 3 3 4 4 2 3 3 3 1 4 4 3 2 3 2 5 4 3 2 4 3 1 2 5 6 2 4 6 3 2 2 2 2 2 6 4 4 5 5 1 4 2 5 1 6 4 3 2 3 7 2 3 3 2 4 4 2 3 2 3 3 4 1 3 2 3 2 7 7 3 3 3 4 2 2 3 2 3 4 2 8 3 4 3 3 5 2 3 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\nBerland State University invites people from all over the world as guest students. You can come to the capita... | [{"input": "3\n4\n0 1 0 0 0 0 0\n100000000\n1 0 0 0 1 0 1\n1\n1 0 0 0 0 0 0\n", "output": "22\n233333332\n1\n"}, {"input": "3\n4\n0 1 0 0 0 0 0\n100000000\n1 1 0 0 1 0 1\n1\n1 0 0 0 0 0 0\n", "output": "22\n174999998\n1\n"}, {"input": "3\n4\n0 1 0 0 0 0 0\n100010000\n1 1 0 0 1 0 1\n1\n1 0 0 0 0 0 0\n", "output": "22\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\nLet's call an array $a$ consisting of $n$ positive (greater than $0$) integers beautiful if the following con... | [{"input": "4\n1\n12\n13\n35\n", "output": "1\n4\n4\n6\n"}, {"input": "4\n1\n12\n11\n14\n", "output": "1\n4\n4\n4\n"}, {"input": "4\n1\n12\n22\n35\n", "output": "1\n4\n5\n6\n"}, {"input": "4\n2\n12\n11\n14\n", "output": "2\n4\n4\n4\n"}, {"input": "4\n2\n5\n13\n87\n", "output": "2\n3\n4\n10\n"}, {"input": "4\n1\n12\n7\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 define the function `f1(n,k)`, as the least multiple of `n` that has all its digits less than `k`. \n\nWe ... | [{"input": "9567100\n8", "output": "[9567115]", "fn_name": "find_f1_eq_f2"}, {"input": "568525\n7", "output": "[568531]", "fn_name": "find_f1_eq_f2"}, {"input": "14990\n7", "output": "[14996]", "fn_name": "find_f1_eq_f2"}, {"input": "30500\n3", "output": "[30501]", "fn_name": "find_f1_eq_f2"}, {"input": "62550\n5", "ou... | 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\nAlice guesses the strings that Bob made for her.\n\nAt first, Bob came up with the secret string $a$ consisti... | [{"input": "11\nabbaac\nabbaac\nabbaac\nabbaac\nabbaac\nabbaac\nabbaac\nabbaac\nac\nbccddaaf\nzzzzzzzzzz\n", "output": "abac\nabac\nabac\nabac\nabac\nabac\nabac\nabac\nac\nbcdaf\nzzzzzz\n"}, {"input": "10\nabbaac\nac\nbccddaaf\nzzzzzzzzzz\nabbaac\nac\nbccddaaf\nzzzzzzzzzz\nbccddaaf\nzzzzzzzzzz\n", "output": "abac\nac\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\nNicholas has an array a that contains n distinct integers from 1 to n. In other words, Nicholas has a permuta... | [{"input": "100\n76 70 67 54 40 1 48 63 64 36 42 90 99 27 47 17 93 7 13 84 16 57 74 5 83 61 19 56 52 92 38 91 82 79 34 66 71 28 37 98 35 94 77 53 73 10 26 80 15 32 8 81 3 95 44 46 72 6 33 11 21 85 4 30 24 51 49 96 87 55 14 31 12 60 45 9 29 22 58 18 88 2 50 59 20 86 23 41 100 39 62 68 69 97 78 43 25 89 65 75\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\nMashmokh's boss, Bimokh, didn't like Mashmokh. So he fired him. Mashmokh decided to go to university and part... | [{"input": "2000 2000\n", "output": "585712681"}, {"input": "1544 1794\n", "output": "933285446"}, {"input": "1639 1056\n", "output": "467464129"}, {"input": "2000 1000\n", "output": "228299266"}, {"input": "1903 1612\n", "output": "620810276"}, {"input": "1707 1117\n", "output": "237674323"}, {"input": "1722 1474\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\nHave you ever had an infinite loop when you ran a hard-working program? It would be convenient to be able to ... | [{"input": "6\n10 SET d 1\n20 SET h 5\n100 ADD s s i\n110 SUB i i c\n120 IF i 100\n124 HALT", "output": "c=0\nd=1\nh=5\ni=0\ns=0\n"}, {"input": "6\n10 SET c 1\n20 SET h 5\n100 ADD s s i\n110 SUB i i c\n209 IF j 100\n200 HALT", "output": "c=1\nh=5\ni=0\nj=0\ns=0\n"}, {"input": "6\n10 SET c 1\n20 SET h 7\n100 ADD s s j\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\nFinally, a basketball court has been opened in SIS, so Demid has decided to hold a basketball exercise sessio... | [{"input": "100\n4 1 4 1 4 1 4 1 4 1 4 1 4 1 4 1 4 1 4 1 4 1 4 1 4 1 4 1 4 1 4 1 4 1 4 1 4 1 4 1 4 1 4 1 4 1 4 1 4 1 4 1 4 1 4 1 4 1 4 1 4 1 4 1 4 1 4 1 4 1 4 1 4 1 4 1 4 1 4 1 4 1 4 1 4 1 4 1 4 1 4 1 4 1 4 1 4 1 4 1\n1 4 1 4 1 4 1 4 1 4 1 4 1 4 1 4 1 4 1 4 1 4 1 4 1 4 1 4 1 4 1 4 1 4 1 4 1 4 1 4 1 4 1 4 1 4 1 4 1 4 1 ... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nThere is a rectangular grid of n rows of m initially-white cells each.\n\nArkady performed a certain number (... | [{"input": "50 8\n.....#..\n........\n........\n.....#..\n.....#..\n........\n........\n........\n........\n...#....\n...#....\n........\n...#....\n#.#.#...\n...#....\n...#....\n........\n...#....\n...#....\n...#....\n........\n#.#.#...\n.....#..\n........\n#.#.#...\n#.#.#...\n#.#.#...\n...#....\n........\n........\n..... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nTakahashi is standing on a two-dimensional plane, facing north. Find the minimum positive integer K such that... | [{"input": "1329", "output": "120\n"}, {"input": "1162", "output": "180\n"}, {"input": "1369", "output": "360\n"}, {"input": "1527", "output": "120\n"}, {"input": "1874", "output": "180\n"}, {"input": "2383", "output": "360\n"}, {"input": "2579", "output": "360\n"}, {"input": "643", "output": "360\n"}, {"input": "1780"... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nNumber of tanka\n\nWishing to die in the spring under the flowers\n\nThis is one of the famous tanka poems th... | [{"input": "1\n1\n3\n1531\n2317\n714\n225725068861419081\n0", "output": "10\n10\n13\n55955\n155155\n7277\n3223333233333322222322232232233222323233333233223332\n"}, {"input": "1\n1\n4\n1531\n2317\n714\n225725068861419081\n0", "output": "10\n10\n14\n55955\n155155\n7277\n322333323333332222232223223223322232323333323322333... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nPaladin Manao caught the trail of the ancient Book of Evil in a swampy area. This area contains n settlements... | [{"input": "50 2 5\n9 14\n46 34\n40 35\n44 30\n32 16\n1 38\n48 2\n17 14\n50 25\n6 1\n45 19\n21 15\n22 11\n15 33\n8 28\n2 32\n10 22\n37 3\n43 39\n25 16\n9 19\n16 3\n28 32\n20 45\n24 32\n4 18\n49 39\n13 45\n26 4\n11 33\n14 37\n42 19\n31 45\n38 3\n34 8\n18 29\n35 34\n29 16\n7 46\n19 28\n27 33\n30 9\n33 16\n36 45\n47 1\n41... | code_stdio |
[
{
"content": "You are an expert Python programmer. 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 found a table having an infinite number of rows and columns. The rows are numbered from $1$, sta... | [{"input": "100\n1\n2\n2\n3\n4\n5\n6\n13\n15\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n35\n20\n21\n22\n23\n24\n25\n26\n27\n28\n23\n30\n31\n32\n33\n34\n35\n36\n19\n38\n60\n40\n41\n42\n43\n44\n119\n46\n47\n77\n49\n44\n51\n45\n53\n54\n55\n56\n57\n58\n87\n60\n61\n42\n63\n64\n65\n66\n67\n68\n69\n70\n124\n72\n73\n74\n75\n76\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\nThe Little Elephant loves chess very much. \n\nOne day the Little Elephant and his friend decided to play che... | [{"input": "WBWBWBWB\nBWBWBWBW\nBWBWBWBW\nBWBWBWBW\nWBWBWBWB\nWBWBWBWB\nBWBWBWBW\nWBWBWBWB\n", "output": "YES\n"}, {"input": "BWBWBWBW\nWBWBWBWB\nBWBWBWBW\nBWBWBWBW\nWBWBWBWB\nWBWBWBWB\nWBWBWBWB\nWBWBWBWB\n", "output": "YES\n"}, {"input": "BWBWBWBW\nWBWBWBWB\nBWBWBWBW\nWBWBWBWB\nBWBWBWBW\nWBWBWBWB\nWBWBWBWB\nWBWBWBWB\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 semester is already ending, so Danil made an effort and decided to visit a lesson on harmony analysis to ... | [{"input": "8\n", "output": "++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\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 Codeforces user has rating, described with one integer, possibly negative or zero. Users are divided in... | [{"input": "50\n67 1\n89 2\n83 1\n-26 1\n88 2\n-22 2\n-98 2\n-83 1\n58 2\n26 2\n-37 1\n-51 2\n29 1\n47 2\n-70 1\n81 2\n36 1\n52 2\n93 2\n-12 2\n-12 1\n5 2\n91 1\n3 1\n-27 1\n18 1\n-60 1\n-15 1\n17 1\n-33 1\n-74 2\n5 2\n-62 2\n72 1\n-22 1\n-58 1\n-9 1\n57 1\n-18 2\n-11 1\n-103 2\n74 2\n-20 2\n21 1\n-19 2\n-77 1\n50 2\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\nReca company makes monitors, the most popular of their models is AB999 with the screen size a × b centimeters... | [{"input": "2000000000 2000000000 1999999998 1999999999\n", "output": "1999999998 1999999999"}, {"input": "2000000000 2000000000 1999999999 1999999998\n", "output": "1999999999 1999999998"}, {"input": "1688112099 1875662241 198852947 116042960\n", "output": "1590823576 928343680\n"}, {"input": "1143276347 1875662241 17... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nRecall that the permutation is an array consisting of $n$ distinct integers from $1$ to $n$ in arbitrary orde... | [{"input": "250000 993244853\n", "output": "872048421\n"}, {"input": "244435 994838543\n", "output": "634651929\n"}, {"input": "234324 994631069\n", "output": "720229385\n"}, {"input": "249996 997202249\n", "output": "633673455\n"}, {"input": "249998 990040613\n", "output": "108188702\n"}, {"input": "249999 992509109\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 Cybermen solved that first test much quicker than the Daleks. Luckily for us, the Daleks were angry (shoc... | [{"input": "5 0\n2 1\n-2 -1\n-1 1\n-2 -2\n2 2\n", "output": "1\n"}, {"input": "5 1\n1 1\n-1 -1\n-1 1\n-2 -2\n2 0\n", "output": "2\n"}, {"input": "5 1\n2 1\n-1 -1\n-1 1\n-2 -2\n2 0\n", "output": "2\n"}, {"input": "5 1\n2 1\n-1 -1\n-1 1\n-2 -2\n2 1\n", "output": "2\n"}, {"input": "5 1\n2 1\n-2 -1\n-1 1\n-2 -2\n2 1\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\nProgrammer Sasha has recently begun to study data structures. His coach Stas told him to solve the problem of... | [{"input": "10 3\n-20\n-63\n-64\n45\n-84\n-13\n79\n-31\n70\n-100\n", "output": "-20\n45\n45\n45\n79\n79\n79\n70\n"}, {"input": "10 3\n-20\n-52\n-64\n45\n-139\n-13\n79\n-31\n89\n-100\n", "output": "-20\n45\n45\n45\n79\n79\n89\n89"}, {"input": "10 3\n-20\n-35\n-64\n45\n-139\n-20\n24\n-31\n89\n-100\n", "output": "-20\n45\... | code_stdio |
[
{
"content": "You are an expert Python programmer. 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 we alternate the vowels and consonants in the string `\"have\"`, we get the following list, arranged alpha... | [{"input": "\"acidity\"", "output": "[\"caditiy\"]", "fn_name": "solve"}, {"input": "\"codewars\"", "output": "[\"failed\"]", "fn_name": "solve"}, {"input": "\"orudere\"", "output": "[\"ederoru\"]", "fn_name": "solve"}, {"input": "\"oruder\"", "output": "[\"edorur\"]", "fn_name": "solve"}, {"input": "\"zodiac\"", "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\nDivision of Big Integers\n\nGiven two integers $A$ and $B$, compute the quotient, $\\frac{A}{B}$. Round down ... | [{"input": "12 -1", "output": "-12\n"}, {"input": "10 -1", "output": "-10\n"}, {"input": "20 -1", "output": "-20\n"}, {"input": "11 -1", "output": "-11\n"}, {"input": "15 -1", "output": "-15\n"}, {"input": "16 -1", "output": "-16\n"}, {"input": "14 -1", "output": "-14\n"}, {"input": "23 -1", "output": "-23\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\nVasya has n items lying in a line. The items are consecutively numbered by numbers from 1 to n in such a way ... | [{"input": "2 100 100 10000 10000\n100 100\n", "output": "20000\n"}, {"input": "2 110 100 10000 10000\n100 100\n", "output": "21000\n"}, {"input": "2 110 100 10000 11101\n100 000\n", "output": "11000\n"}, {"input": "2 110 100 00000 11101\n110 000\n", "output": "12100\n"}, {"input": "2 110 100 10000 11000\n100 100\n", "... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nWrite a function that checks the braces status in a string, and return `True` if all braces are properly clos... | [{"input": "\"([[some](){text}here]...)\"", "output": "[true]", "fn_name": "braces_status"}, {"input": "\"()[]{}()\"", "output": "[true]", "fn_name": "braces_status"}, {"input": "\"[()]{(\"", "output": "[false]", "fn_name": "braces_status"}, {"input": "\"{[()]}\"", "output": "[true]", "fn_name": "braces_status"}, {"inp... | 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\nRng is going to a festival.\n\nThe name of the festival is given to you as a string S, which ends with `FESTI... | [{"input": "CODEFESTIVALFERTIVAL", "output": "CODEFESTIVAL\n"}, {"input": "CODEFESTIWALFESTIWAL", "output": "CODEFESTIWAL\n"}, {"input": "LAWITSEFLAWITSEFEDOC", "output": "LAWITSEFLAWI\n"}, {"input": "CODEFWSTIWALFESTIEAL", "output": "CODEFWSTIWAL\n"}, {"input": "COCEFWSTIWALFESTIEAL", "output": "COCEFWSTIWAL\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\nproblem\n\nI want to put as many rectangular tiles as possible on a rectangular wall with a size of $ h $ in ... | [{"input": "87 15\n12 66", "output": "1305\n"}, {"input": "87 29\n12 66", "output": "2523\n"}, {"input": "27 27\n16 16", "output": "473\n"}, {"input": "27 32\n16 16", "output": "352\n"}, {"input": "-1 18\n10 49", "output": "-18\n"}, {"input": "27 32\n20 16", "output": "224\n"}, {"input": "27 18\n20 16", "output": "166\... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nYou are given three integers $a$, $b$, and $c$. Determine if one of them is the sum of the other two.\n\n\n--... | [{"input": "47\n1 1 1\n1 1 1\n1 1 1\n1 1 1\n1 1 1\n1 1 1\n1 1 1\n1 1 1\n1 1 1\n1 1 1\n1 1 1\n1 1 1\n1 1 1\n1 1 1\n1 1 1\n1 1 1\n1 1 1\n1 1 1\n1 1 1\n1 1 1\n1 1 1\n1 1 1\n1 1 1\n1 1 1\n1 1 1\n1 1 1\n1 1 1\n1 1 1\n1 1 1\n1 1 1\n1 1 1\n1 1 1\n1 1 1\n1 1 1\n1 1 1\n1 1 1\n1 1 1\n1 1 1\n1 1 1\n1 1 1\n1 1 1\n1 1 1\n1 1 1\n1 1... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nAs a strict big brother, I do limit my young brother Vasya on time he spends on computer games. I define a pr... | [{"input": "9\n10\n11", "output": "[false]", "fn_name": "can_i_play"}, {"input": "12\n12\n13", "output": "[true]", "fn_name": "can_i_play"}, {"input": "13\n10\n15", "output": "[true]", "fn_name": "can_i_play"}, {"input": "14\n9\n14", "output": "[false]", "fn_name": "can_i_play"}, {"input": "15\n8\n12", "output": "[fals... | 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\nAs you know, majority of students and teachers of Summer Informatics School live in Berland for the most part... | [{"input": "10 10\n7 29\n10 31\n9 40\n5 17\n5 30\n6 85\n2 53\n7 23\n4 57\n10 9\n", "output": "49\n"}, {"input": "10 10\n5 81\n7 68\n7 48\n1 10\n5 37\n7 97\n8 54\n7 41\n7 56\n5 21\n", "output": "110\n"}, {"input": "10 10\n7 29\n10 54\n9 40\n5 17\n5 30\n6 85\n2 53\n7 23\n4 57\n10 9\n", "output": "49\n"}, {"input": "10 10... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nYou are given a rectangular board of M × N squares. Also you are given an unlimited number of standard domino... | [{"input": "14 16\n", "output": "112\n"}, {"input": "15 16\n", "output": "120\n"}, {"input": "16 16\n", "output": "128\n"}, {"input": "14 15\n", "output": "105\n"}, {"input": "15 15\n", "output": "112\n"}, {"input": "11 13\n", "output": "71\n"}, {"input": "14 14\n", "output": "98\n"}, {"input": "10 16\n", "output": "80... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nRingo Mart, a convenience store, sells apple juice.\n\nOn the opening day of Ringo Mart, there were A cans of... | [{"input": "24\n2 2 3 4\n1 2 4 3\n1 3 2 4\n1 3 4 2\n1 4 2 3\n1 4 3 2\n2 1 3 4\n2 1 4 3\n2 3 1 4\n2 3 4 1\n2 4 1 3\n2 4 3 1\n3 1 2 4\n3 1 4 2\n3 2 1 4\n3 2 4 1\n3 4 1 2\n3 4 2 1\n4 1 2 3\n4 1 3 2\n4 2 1 3\n4 2 3 1\n4 3 1 2\n4 3 2 1", "output": "Yes\nNo\nNo\nNo\nNo\nNo\nYes\nYes\nNo\nNo\nNo\nNo\nYes\nYes\nYes\nNo\nNo\nNo... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nJack decides to invite Emma out for a dinner. Jack is a modest student, he doesn't want to go to an expensive... | [{"input": "10 10\n256 72 455 45 912 506 235 68 951 92\n246 305 45 212 788 621 449 876 459 899\n732 107 230 357 370 610 997 669 61 192\n131 93 481 527 983 920 825 540 435 54\n777 682 984 20 337 480 264 137 249 502\n51 467 479 228 923 752 714 436 199 973\n3 91 612 571 631 212 751 84 886 948\n252 130 583 23 194 985 234 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\nYou are going to be given an array of integers. Your job is to take that array and find an index N where the ... | [{"input": "[-100, -99, -98, -97, -96, -95, -94, -93, -92, -91, -90, -89, -88, -87, -86, -85, -84, -83, -82, -81, -80, -79, -78, -77, -76, -75, -74, -73, -72, -71, -70, -69, -68, -67, -66, -65, -64, -63, -62, -61, -60, -59, -58, -57, -56, -55, -54, -53, -52, -51, -50, -49, -48, -47, -46, -45, -44, -43, -42, -41, -40, -... | 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\nToday there is going to be an unusual performance at the circus — hamsters and tigers will perform together! ... | [{"input": "178\nTTTTTTHTHHHTHHTHHHHTTTHTHTTHTHHHTHTTTTHHTTHHHTTHHTTHHTTHHHHHTHHTTHTHHTTHHTTTTTTTTTHTHTTHTHHTHHHHHHTTTHTHHHHTHHTTHHHHTTTTTTTTHHHTHHHTHTHHHTTTTTHTHTTTHTHHTTHTTTHHHHHTTHTTHTTTHTHHHT\n", "output": "40\n"}, {"input": "178\nTTTTTTHTHHHTHHTHHHHTTTHTHTTHTHHHTHTTTTHHTTHHHTTHHTTHHTTHHTHHTHHTTHTHHTTHHTTTTTTTTTHTH... | code_stdio |
[
{
"content": "You are an expert Python programmer. 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 smelt fishing tournament was held at Lake Hibara. The winner is the one who wins the most smelt.\n\nCreate ... | [{"input": "6\n1 14\n2 17\n3 131\n4 11\n4 61\n6 66", "output": "3 131\n"}, {"input": "6\n1 14\n2 25\n3 126\n4 11\n4 40\n6 66", "output": "3 126\n"}, {"input": "6\n1 14\n2 17\n3 169\n4 11\n4 61\n6 66", "output": "3 169\n"}, {"input": "6\n1 12\n4 25\n3 72\n0 11\n2 101\n6 29", "output": "2 101\n"}, {"input": "6\n1 12\n4 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\nWe have a string S of length N consisting of A, T, C, and G.\nStrings T_1 and T_2 of the same length are said... | [{"input": "5000 GCGCGCGCGCGCGCGCGCGCGCGCGCGCGCGCGCGCGCGCGCGCGCGCGCGCGCGCGCGCGCGCGCGCGCGCGCGCGCGCGCGCGCGCGCGCGCGCGCGCGCGCGCGCGCGCGCGCGCGCGCGCGCGCGCGCGCGCGCGCGCGCGCGCGCGCGCGCGCGCGCGCGCGCGCGCGCGCGCGCGCGCGCGCGCGCGCGCGCGCGCGCGCGCGCGCGCGCGCGCGCGCGCGCGCGCGCGCGCGCGCGCGCGCGCGCGCGCGCGCGCGCGCGCGCGCGCGCGCGCGCGCGCGCGCGCGCGCGCGCGCG... | code_stdio |
[
{
"content": "You are an expert Python programmer. 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 a garden consisting entirely of grass and weeds. Your garden is described by an n × m grid, with row... | [{"input": "3 150\nGGGWGGGGWWGGGGGGGGGGGGGWGGWGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGWGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGWGGGGGGGWGGGGGGGGGGGGGGGGGWGGGGGGGGGGGGGGGGGGW\nGGGGGGGGGGGGWGGGGGGGGGWGGGGGGGGGGGGWGGGGGWGGGGGGGWGGGGGGGWGGGGGWGGGGGGGGGGGGGGGGGGGGGGGGWGGGGWGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGWGGWGG... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSomething happened in Uzhlyandia again... There are riots on the streets... Famous Uzhlyandian superheroes Sh... | [{"input": "100\n23 64 60 -45 -36 -64 -59 15 -75 69 -30 -7 -20 17 -77 58 93 -76 -121 -34 -31 16 -50 6 -20 -85 1 64 -88 -8 -15 -6 -57 25 91 10 2 -90 74 -66 -42 73 28 49 -85 30 96 79 -25 49 -59 -89 -75 14 -96 -33 -65 -8 -100 -81 17 99 -91 -5 7 -21 1 85 63 86 -26 85 -31 11 -75 35 -82 15 98 93 -55 24 70 36 -38 8 92 -63 -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\nYour task is to calculate the distance between two $n$ dimensional vectors $x = \\\\{x_1, x_2, ..., x_n\\\\}$... | [{"input": "3\n109 25 10\n-1 -3 -3", "output": "151.000000\n114.249726\n110.661278\n110.000000\n"}, {"input": "3\n109 25 10\n0 -3 -3", "output": "150.000000\n113.287246\n109.673356\n109.000000\n"}, {"input": "3\n109 25 10\n-1 -3 0", "output": "148.000000\n113.947356\n110.628687\n110.000000\n"}, {"input": "3\n198 141 20... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nLet's consider a simplified version of order book of some stock. The order book is a list of orders (offers) ... | [{"input": "15\nADD 14944938\nADD 40032655\nACCEPT 14944938\nACCEPT 40032655\nADD 79373162\nACCEPT 79373162\nADD 55424250\nACCEPT 55424250\nADD 67468892\nACCEPT 67468892\nADD 51815959\nADD 13976252\nADD 2040654\nADD 74300637\nACCEPT 51815959\n", "output": "32\n"}, {"input": "15\nADD 14944938\nADD 40032655\nACCEPT 14944... | code_stdio |
[
{
"content": "You are an expert Python programmer. 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 are playing a game of coins. N coins are placed on the table in a row. \n\nThe game begins with... | [{"input": "100\n90287615\n75096686\n621537351\n337906787\n932379178\n576368174\n614524887\n381393352\n683734903\n357312092\n45953951\n11885544\n659581459\n649281842\n360919237\n468202152\n348705142\n433071763\n766393082\n957639054\n492279795\n441607546\n238769590\n287864255\n240825138\n413652652\n556513880\n942947637\... | code_stdio |
[
{
"content": "You are an expert Python programmer. 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 cat Snuke wants to play a popular Japanese game called ÅtCoder, so Iroha has decided to teach him Japanes... | [{"input": "183\n", "output": "bon\n"}, {"input": "999\n", "output": "hon\n"}, {"input": "440\n", "output": "pon\n"}, {"input": "438\n", "output": "pon\n"}, {"input": "575\n", "output": "hon\n"}, {"input": "16\n", "output": "pon\n"}, {"input": "73\n", "output": "bon\n"}, {"input": "24\n", "output": "hon\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 standard english sentence passed in as a string, write a method that will return a sentence made up o... | [{"input": "\"Only themselves understand themselves and the like of themselves, As souls only understand souls\"", "output": "[\"and like of only souls souls the themselves themselves themselves understand understand Only As\"]", "fn_name": "pseudo_sort"}, {"input": "\"I, habitan of the Alleghanies, treating of him as ... | 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 3^N people dancing in circle. We denote with 0,1,\\dots, 3^{N}-1 the positions in the circle, start... | [{"input": "3\nRRRRSRRRSRRSRS", "output": "23 9 4 8 3 16 20 24 1 5 18 13 17 12 25 2 6 10 14 0 22 26 21 7 11 15 19 "}, {"input": "3\nRSRRSRRRSRRSRR", "output": "17 12 7 11 24 19 5 9 4 26 21 16 20 6 1 14 18 13 8 3 25 2 15 10 23 0 22 "}, {"input": "3\nRRRRSRRRRRRSRS", "output": "13 0 11 10 15 26 25 21 5 4 18 2 1 6 17 16 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 a sequence $a$ consisting of $n$ integers $a_1, a_2, \\dots, a_n$, and an integer $x$. Your tas... | [{"input": "6\n4 1\n2 3 5 4\n5 6\n1 1 3 4 4\n1 10\n2\n2 10\n11 9\n2 10\n12 11\n5 18\n81 324 218 413 324\n", "output": "\n3\n0\n0\n-1\n1\n3\n"}, {"input": "6\n4 1\n2 3 5 4\n5 6\n1 1 3 4 4\n1 10\n2\n2 10\n11 9\n2 10\n12 11\n5 18\n81 324 218 413 324\n", "output": "3\n0\n0\n-1\n1\n3\n"}, {"input": "6\n4 1\n2 3 5 4\n5 6\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\nConsider the following numbers (where `n!` is `factorial(n)`):\n```\nu1 = (1 / 1!) * (1!)\nu2 = (1 / 2!) * (1... | [{"input": "10110", "output": "[1.000098]", "fn_name": "going"}, {"input": "113", "output": "[1.008929]", "fn_name": "going"}, {"input": "200", "output": "[1.005025]", "fn_name": "going"}, {"input": "523", "output": "[1.001915]", "fn_name": "going"}, {"input": "1011", "output": "[1.00099]", "fn_name": "going"}, {"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\n[Image] \n\nIt's the end of July – the time when a festive evening is held at Jelly Castle! Guests from all o... | [{"input": "433 3\nFZDDHMJGBZCHFUXBBPIEBBEFDWOMXXEPOMDGSMPIUZOMRZQNSJAVNATGIWPDFISKFQXJNVFXPHOZDAEZFDAHDXXQKZMGNSGKQNWGNGJGJZVVITKNFLVCPMZSDMCHBTVAWYVZLIXXIADXNYILEYNIQHKMOGMVOCWGHCWIYMPEPADSJAAKEGTUSEDWAHMNYJDIHBKHVUHLYGNGZDBULRXLSAJHPCMNWCEAAPYMHDTYWPADOTJTXTXUKLCHWKUSZRHEKQEFPVJEJJHRWCKYOIWALRTIBUMNOCRXLSIKQCJVQXEPG... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nTo get money for a new aeonic blaster, ranger Qwerty decided to engage in trade for a while. He wants to buy ... | [{"input": "5 10 15\nDdunkjly\n13 12 4\n83 26 1\n63 42 3\n83 22 2\n57 33 0\n59 10 1\n89 31 1\n57 17 2\n98 79 5\n46 41 3\nFbpbc\n28 21 0\n93 66 5\n66 21 0\n68 58 0\n59 17 3\n57 23 1\n72 71 1\n55 51 2\n58 40 5\n70 67 2\nKeiotmh\n73 44 4\n98 14 0\n19 7 0\n55 10 5\n30 25 4\n66 48 2\n66 51 4\n82 79 3\n73 63 4\n87 46 5\nNksd... | code_stdio |
[
{
"content": "You are an expert Python programmer. 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 table consisting of n rows and m columns.\n\nNumbers in each row form a permutation of intege... | [{"input": "20 8\n4 3 2 1 5 6 7 8\n1 2 3 4 8 7 6 5\n1 2 3 4 5 6 7 8\n1 2 3 4 5 6 7 8\n1 2 3 4 5 6 7 8\n1 2 3 4 5 6 7 8\n1 2 3 4 5 6 7 8\n1 2 3 4 5 6 7 8\n1 2 3 4 5 6 7 8\n1 2 3 4 5 6 7 8\n1 2 3 4 5 6 7 8\n1 2 3 4 5 6 7 8\n1 2 3 4 5 6 7 8\n1 2 3 4 5 6 7 8\n1 2 3 4 5 6 7 8\n1 2 3 4 5 6 7 8\n1 2 3 4 5 6 7 8\n1 2 3 4 5 6 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\nWrite a function that returns the number of '2's in the factorization of a number. \nFor example,\n```python... | [{"input": "482848428248882482", "output": "[1]", "fn_name": "two_count"}, {"input": "7777777777777777", "output": "[0]", "fn_name": "two_count"}, {"input": "222222222222", "output": "[1]", "fn_name": "two_count"}, {"input": "84934656", "output": "[20]", "fn_name": "two_count"}, {"input": "17280", "output": "[7]", "fn_... | code_functional |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.