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\nAtCoder currently hosts three types of contests: ABC, ARC, and AGC. As the number of users has grown, in orde...
[{"input": "5\n86 90 69 51 2 96 71 47 88 34 45 46 89 34 31 38 97 84 41 80 14 4 50 83 7 82\n19771 12979 18912 10432 10544 12928 13403 3047 10527 9740 8100 92 2856 14730 1396 15905 6534 4650 11469 3628 8433 2994 10899 16396 18355 11424\n6674 17707 13855 16407 12232 2886 11908 1705 5000 1537 10440 10711 4917 10770 17272 1...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nThe R1 company has recently bought a high rise building in the centre of Moscow for its main office. It's tim...
[{"input": "100 50\n5B2N,CXCWOIWH71XV!HCFEUCN3U88JDRIFRO2VHY?!N.RGH.?W14X5S.Y00RIY6YA19BPD0T,WECXYI,O2RF1U4NX9,F5AVLPOYK\n", "output": "LEFT\nLEFT\nLEFT\nLEFT\nLEFT\nLEFT\nLEFT\nLEFT\nLEFT\nLEFT\nLEFT\nLEFT\nLEFT\nLEFT\nLEFT\nLEFT\nLEFT\nLEFT\nLEFT\nLEFT\nLEFT\nLEFT\nLEFT\nLEFT\nLEFT\nLEFT\nLEFT\nLEFT\nLEFT\nLEFT\nLEFT...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nTomash keeps wandering off and getting lost while he is walking along the streets of Berland. It's no surpris...
[{"input": "8 56\n1 2\n1 3\n1 4\n1 5\n1 6\n1 7\n1 8\n2 1\n2 3\n2 4\n2 5\n2 6\n2 7\n2 8\n3 1\n3 2\n3 4\n3 5\n3 6\n3 7\n3 8\n4 1\n4 2\n4 3\n4 5\n4 6\n4 7\n4 8\n5 1\n5 2\n5 3\n5 4\n5 6\n5 7\n5 8\n6 1\n6 2\n6 3\n6 4\n6 5\n6 7\n6 8\n7 1\n7 2\n7 3\n7 4\n7 5\n7 6\n7 8\n8 1\n8 2\n8 3\n8 4\n8 5\n8 6\n8 7\n", "output": "840\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\nKatie, Kuro and Shiro are best friends. They have known each other since kindergarten. That's why they often ...
[{"input": "1000000000000000000\n", "output": "1000000000000000001\n"}, {"input": "1043714136496022950\n", "output": "1043714136496022951\n"}, {"input": "1837625121252532586\n", "output": "1837625121252532587\n"}, {"input": "1568485437674580780\n", "output": "1568485437674580781\n"}, {"input": "1000000000000010000\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\nString can be called correct if it consists of characters \"0\" and \"1\" and there are no redundant leading ...
[{"input": "100\n1000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000\n", "output": "1000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000\n"}, {"input": "100\n10000000000000000000000000000000000000000000000000000000000000000...
code_stdio
[ { "content": "You are an expert Python programmer. 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 might know, cooking is the process of taking a food item and subjecting it to various processes(like h...
[{"input": "3\n-2 2\n5 10\n1 11", "output": "2\n555841676\n110\n"}, {"input": "3\n-2 2\n4 15\n1 12", "output": "2\n286982263\n132\n"}, {"input": "3\n-16 2\n10 13\n1 6", "output": "2\n131267026\n30\n"}, {"input": "3\n-8 2\n10 13\n1 5", "output": "2\n131267026\n20\n"}, {"input": "3\n-16 2\n10 13\n1 3", "output": "2\n1312...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nDr. Moriarty is about to send a message to Sherlock Holmes. He has a string s. \n\nString p is called a subst...
[{"input": "ksmbytfyhhnstlecripupiwdhbkhfpfmimrbqgszohcqnezcybvwasxmkxfupvuecsctcpadccnqexsglwaiyxcoyheefcjmdedesgjqdtqgrvfjonzesffousooutsjumrxl\nhgjqihcfbnmgufonaiudbjegexexthrzcdkuimwogpbyovemztzcmqnrbhabxyyxyfuzpyhjgnioexbezzupcxlyzuuncstiiqsjzdtqppqhxilvqimlpjejiqbwpeekzweeyvthvjffgfvqauqrugajjjzibgzhxphcvtncjzecb...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nCalculate the number of items in a vector that appear at the same index in each vector, with the same value. ...
[{"input": "[6, 6, 6, 6, 6, 6]\n[6, null, null, 6, 6, null]", "output": "[0.5]", "fn_name": "vector_affinity"}, {"input": "[6]\n[6, 6, 6, 6, 6, 6]", "output": "[0.16666666666666666]", "fn_name": "vector_affinity"}, {"input": "[1, 2, 3, 4]\n[1, 2, 3, 5]", "output": "[0.75]", "fn_name": "vector_affinity"}, {"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\nIn order to put away old things and welcome a fresh new year, a thorough cleaning of the house is a must.\n\n...
[{"input": "1000000000000000000 2\n", "output": "61\n0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 1 0 1 0 0 0 1 1 1 1 1 0 0 1 0 1 1 1 1 1 1 0 1 0 0 1 1 1 0 0 0 0 1 0 0 0 1 0 0 1 \n"}, {"input": "1000000000000000000 2\n", "output": "61\n0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 1 0 1 0 0 0 1 1 1 1 1 0 0 1 0 1 1 1 1 1 1 0 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\nStick n circular stickers with a radius of 1 on a square origami paper with a side length of 10. The stickers...
[{"input": "15\n3.13979,8.51743\n2.39506,3.84915\n2.68432,5.39095\n5.61904,9.16332\n7.85653,4.75593\n2.84021,5.41511\n1.79500,8.59211\n7.55389,8.17604\n4.70665,4.66125\n1.63470,4.42538\n7.34959,4.61981\n5.09003,8.11122\n5.24373,1.30066\n0.13517,1.83659\n7.57313,1.58150\n0", "output": "4\n"}, {"input": "15\n3.13979,8.51...
code_stdio
[ { "content": "You are an expert Python programmer. 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 harder version of the problem. In this version, 1 ≤ n, m ≤ 2⋅10^5. You can hack this problem if y...
[{"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 3\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\n4\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\nRecently, Anton has found a set. The set consists of small English letters. Anton carefully wrote out all the...
[{"input": "{a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a}\n", "ou...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nValera the horse lives on a plane. The Cartesian coordinate system is defined on this plane. Also an infinite...
[{"input": "37 -100\n", "output": "400\n"}, {"input": "100 100\n", "output": "397\n"}, {"input": "-96 -96\n", "output": "383\n"}, {"input": "100 100\n", "output": "397\n"}, {"input": "37 -100\n", "output": "400\n"}, {"input": "-96 -96\n", "output": "383\n"}, {"input": "56 -100\n", "output": "400\n"}, {"input": "99 100\...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nIn this Kata, you will implement a function `count` that takes an integer and returns the number of digits in...
[{"input": "50000000", "output": "[363233781]", "fn_name": "count"}, {"input": "5000000", "output": "[31323382]", "fn_name": "count"}, {"input": "500000", "output": "[2632342]", "fn_name": "count"}, {"input": "50000", "output": "[213237]", "fn_name": "count"}, {"input": "5000", "output": "[16326]", "fn_name": "count"},...
code_functional
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nPolycarp loves geometric progressions — he collects them. However, as such progressions occur very rarely, he...
[{"input": "10\n-10000 -10000 -10000 -10000 10000 -10000 -10000 -10000 -10000 10000\n", "output": "2\n"}, {"input": "10\n-10000 -10000 -10000 -10000 10000 -10000 -10000 -10000 -12453 10000\n", "output": "2\n"}, {"input": "14\n-1 -2 -4 -8 -16 -32 -64 -128 -256 -512 -1024 -2048 -4096 -8192\n", "output": "0\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\nIn computer science, cycle detection is the algorithmic problem of finding a cycle in a sequence of iterated ...
[{"input": "[1, 1, 1, 1, 1, 1, 1, 1]", "output": "[[0, 1]]", "fn_name": "cycle"}, {"input": "[1, 2, 3, 4, 2, 3, 4]", "output": "[[1, 3]]", "fn_name": "cycle"}, {"input": "[2, 3, 4, 2, 3, 4]", "output": "[[0, 3]]", "fn_name": "cycle"}, {"input": "[1, 2, 3, 4]", "output": "[[]]", "fn_name": "cycle"}, {"input": "[7]", "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\nCreate a program to determine the positional relationship between a triangle and a circle on a plane. All tar...
[{"input": "1 1\n6 0\n3 3\n3 0\n3\n3 11\n1 3\n11 16\n12 4\n5\n15 4\n17 12\n22 5\n7 22\n3\n5 13\n16 2\n16 9\n5 3\n1\n0 0", "output": "b\nd\nd\nd\n"}, {"input": "1 1\n6 0\n3 3\n3 2\n3\n3 11\n1 3\n11 16\n12 7\n5\n15 3\n17 7\n22 5\n7 12\n4\n5 13\n13 2\n16 9\n5 3\n2\n0 0", "output": "c\nd\nd\nd\n"}, {"input": "3 2\n3 1\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\nThis problem is an extension of the problem \"Wonderful Coloring - 1\". It has quite many differences, so you...
[{"input": "12\n10 3\n3 1 1 1 1 3 3 10 10 2\n4 4\n1 1 1 2\n1 1\n1\n13 1\n5 1 4 1 5 9 2 11 1 3 5 8 9\n13 2\n3 1 4 1 5 9 2 6 5 3 4 7 9\n13 3\n3 1 4 1 5 9 2 6 5 3 5 8 9\n10 3\n3 1 1 1 1 10 3 10 10 2\n4 4\n1 1 1 1\n1 1\n1\n13 1\n5 1 4 1 10 9 2 11 5 3 5 8 9\n13 2\n3 1 4 1 5 9 2 6 5 3 5 8 9\n13 3\n3 1 4 1 5 9 2 8 5 3 5 8 9\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\nI always thought that my old friend John was rather richer than he looked, but I never knew exactly how much ...
[{"input": "0\n200", "output": "[[[\"M: 37\", \"B: 5\", \"C: 4\"], [\"M: 100\", \"B: 14\", \"C: 11\"], [\"M: 163\", \"B: 23\", \"C: 18\"]]]", "fn_name": "howmuch"}, {"input": "20000\n20100", "output": "[[[\"M: 20008\", \"B: 2858\", \"C: 2223\"], [\"M: 20071\", \"B: 2867\", \"C: 2230\"]]]", "fn_name": "howmuch"}, {"inpu...
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\nBerland annual chess tournament is coming!\n\nOrganizers have gathered 2·n chess players who should be divide...
[{"input": "100\n1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1...
code_stdio
[ { "content": "You are an expert Python programmer. 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 mobile application store has a new game called \"Subway Roller\".\n\nThe protagonist of the game Philip i...
[{"input": "1\n100 26\ns................PPPP.CCCCC..UUUUUU.........YYYQQQQQQQ...GGGGG............MMM.....JJJJ..............\n.OOOOOO....EEE....................................................SSSSSS........LLLLLL......NNNIIII.\n......FFFFFF...VVVV..ZZZBBB...KKKKK..WWWWWWWXXX..RRRRRRR......AAAAADDDDDDD.HHH............TTT...
code_stdio
[ { "content": "You are an expert Python programmer. 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 names of two days of the week.\n\nPlease, determine whether it is possible that during some non...
[{"input": "wednesday\nwednesday\n", "output": "YES\n"}, {"input": "wednesday\nwednesday\n", "output": "YES\n"}, {"input": "wednesday\nsaturday\n", "output": "YES\n"}, {"input": "wednesday\nsaturday\n", "output": "YES\n"}, {"input": "wednesday\nsaturday\n", "output": "YES\n"}, {"input": "wednesday\nthursday\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 three piles of casino chips: white, green and black chips:\n\n* the first pile contains only wh...
[{"input": "[12, 12, 12]", "output": "[18]", "fn_name": "solve"}, {"input": "[7, 4, 10]", "output": "[10]", "fn_name": "solve"}, {"input": "[1, 23, 2]", "output": "[3]", "fn_name": "solve"}, {"input": "[1, 1, 1]", "output": "[1]", "fn_name": "solve"}, {"input": "[1, 2, 1]", "output": "[2]", "fn_name": "solve"}, {"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# It's too hot, and they can't even…\n\nOne hot summer day Pete and his friend Billy decided to buy watermelo...
[{"input": "100", "output": "[true]", "fn_name": "divide"}, {"input": "67", "output": "[false]", "fn_name": "divide"}, {"input": "99", "output": "[false]", "fn_name": "divide"}, {"input": "2", "output": "[false]", "fn_name": "divide"}, {"input": "5", "output": "[false]", "fn_name": "divide"}, {"input": "88", "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\nMr. A came to Aizu for sightseeing. You can overlook the Aizu Basin from the window of the hotel where you st...
[{"input": "8 4\n2 1 3 1 1 5 1 3\n2 3 2 4 1 0 2 1\n0 3 -1 2 1 1 4 2\n1 2 3 2 1 1 5 4\n0 2 0 1 1 3 2 1\n1 3 1 2 2 4 3 2\n5 1 2 1 4 1 1 5\n4 1 1 -1 1 2 2 1\n2 -1 -1 -1\n0 3 -1 -1\n-1 2 2 4\n-1 1 -1 1\n5 3\n1 0 2 3 5\n2 3 7 2 1\n2 5 4 2 2\n8 9 0 3 3\n3 6 0 4 7\n-1 -1 2\n-1 3 5\n0 4 -1\n0 0", "output": "4 2\nNA\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\nThere are N strings of lowercase alphabet only. The i-th string is S_i. Every string is unique.\n\nProvide an...
[{"input": "8\nabrakatabra\nabadaba\nabracadabra\natcoder\ngrand\ncontest\nababa\na\n6\n3 abcdefghijklmnopqrstuvwxyz\n6 qwertyuiopasdfhgjklzxcvbnm\n8 poiuytrewqlkjhgfdsamnbvcxz\n2 qazwsxedcrfvtgbyhnujmikolp\n1 plokmijnuhbygvtfcrdxeszwaq\n4 mnbvcxzasdfghjklpoiuytrewq", "output": "4\n8\n2\n3\n4\n7\n"}, {"input": "8\nabra...
code_stdio
[ { "content": "You are an expert Python programmer. 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 become a millionaire, M-kun has decided to make money by trading in the next N days. Currently, he has 100...
[{"input": "7\n100 130 243 130 115 115 150", "output": "3165\n"}, {"input": "7\n100 130 243 130 115 115 271", "output": "5706\n"}, {"input": "7\n110 130 243 130 115 115 271", "output": "5161\n"}, {"input": "7\n110 130 136 130 115 115 271", "output": "2794\n"}, {"input": "7\n100 130 130 130 11 115 150", "output": "17702...
code_stdio
[ { "content": "You are an expert Python programmer. 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 loves the number 7 and multiples of K.\nWhere is the first occurrence of a multiple of K in the seq...
[{"input": "999983\n", "output": "999982\n"}, {"input": "999863\n", "output": "999862\n"}, {"input": "999953\n", "output": "999952\n"}, {"input": "531441\n", "output": "531441\n"}, {"input": "823543\n", "output": "100842\n"}, {"input": "823543\n", "output": "100842\n"}, {"input": "224593\n", "output": "111194\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\nLittle penguin Polo adores strings. But most of all he adores strings of length n.\n\nOne day he wanted to fi...
[{"input": "93563 25\n", "output": "abababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababab...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nLittle girl Tanya climbs the stairs inside a multi-storey building. Every time Tanya climbs a stairway, she s...
[{"input": "48\n1 2 3 4 1 2 3 1 1 2 3 1 2 3 4 1 1 2 3 4 1 2 3 4 1 2 3 4 1 1 1 1 2 1 2 1 1 2 1 2 1 2 3 1 1 1 2 1\n", "output": "22\n4 3 1 3 4 1 4 4 4 1 1 1 2 2 1 2 2 3 1 1 2 1 "}, {"input": "48\n1 2 3 4 1 2 3 1 1 2 1 1 2 3 4 1 1 2 3 4 1 2 3 4 1 2 3 4 1 1 2 1 2 1 2 1 1 1 1 2 1 2 3 1 2 1 2 1\n", "output": "22\n4 3 1 2 1 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\nGiven are two strings s and t consisting of lowercase English letters. Determine if the number of non-negativ...
[{"input": "aa\naaaaaaa\n", "output": "-1\n"}, {"input": "abcabab\nab\n", "output": "3\n"}, {"input": "aba\nbaaab\n", "output": "0\n"}, {"input": "aa\naaaaaaa", "output": "-1"}, {"input": "aa\nabaaaaa", "output": "0"}, {"input": "abcaabb\nab", "output": "1"}, {"input": "aa\naaaaaba", "output": "0"}, {"input": "accaabb\...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nRead problems statements in Mandarin Chinese and Russian as well. \n\nChef wants to implement wildcard patter...
[{"input": "2\ns?o?r\nsco??\nstor?\nsco??", "output": "Yes\nNo\n"}, {"input": "2\ns?or?\nsco??\nstor?\nsco??", "output": "Yes\nNo\n"}, {"input": "2\ns?or?\nsco??\nstor?\nsco??", "output": "Yes\nNo"}, {"input": "2\nr?o?s\nsco??\nstor?\nsco??", "output": "No\nNo\n"}, {"input": "2\nr?o?s\nsco??\n?rots\nsco??", "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 recently came up with a card game called UT-Rummy.\n\nThe cards used in this game are numbered re...
[{"input": "5\n1 2 3 6 4 5 7 13 7\nR R R R R R G G G\n1 2 2 3 4 4 4 4 5\nR R R R R Q R R R\n1 3 3 4 4 4 5 5 5\nR R B R R R R R R\n1 1 1 3 4 5 6 6 10\nR R B G G G R R S\n2 2 2 3 3 3 1 1 2\nR G B R G B R G B", "output": "0\n0\n0\n0\n0\n"}, {"input": "5\n1 2 3 6 4 5 7 13 7\nR R R R R R G G G\n1 2 2 3 4 4 4 4 5\nQ R R R R ...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nDwarfs have planted a very interesting plant, which is a triangle directed \"upwards\". This plant has an amu...
[{"input": "1000000000000000000\n", "output": "899770636\n"}, {"input": "1221245149414588849\n", "output": "459720998\n"}, {"input": "1033757552205836488\n", "output": "556130197\n"}, {"input": "1365148398628465905\n", "output": "906250341\n"}, {"input": "1000000000001000000\n", "output": "351480341\n"}, {"input": "115...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nYou are given an array $a$ consisting of $n$ integers. Indices of the array start from zero (i. e. the first ...
[{"input": "4\n8\n1 3 3 4 11 6 2 9\n5\n1 2 1 2 1\n10\n5 13 6 5 14 0 4 9 13 5\n4\n0 1 2 1\n", "output": "24\n5\n50\n3\n"}, {"input": "4\n8\n0 4 3 6 11 6 2 9\n5\n1 2 1 2 1\n10\n5 13 6 5 14 0 4 9 13 5\n4\n0 1 2 1\n", "output": "25\n5\n50\n3\n"}, {"input": "4\n8\n1 3 3 6 11 6 2 9\n5\n1 2 1 2 1\n10\n5 13 6 5 14 0 4 9 13 5\n...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nYou are given a directed acyclic graph, consisting of $n$ vertices and $m$ edges. The vertices are numbered f...
[{"input": "10 45\n3 8\n3 7\n3 5\n3 2\n3 1\n3 4\n3 10\n3 6\n3 9\n8 7\n8 5\n8 2\n8 1\n8 4\n8 10\n8 6\n8 9\n7 5\n7 2\n7 1\n7 4\n7 10\n7 6\n7 9\n5 2\n5 1\n5 4\n5 10\n5 6\n5 9\n2 1\n2 4\n2 10\n2 6\n2 9\n1 4\n1 10\n1 6\n1 9\n4 10\n4 6\n4 9\n10 6\n10 9\n6 9\n", "output": "8\n"}, {"input": "200000 12\n137434 3309\n195674 1635...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nKuro and Shiro are playing with a board composed of n squares lining up in a row.\nThe squares are numbered 1...
[{"input": "7775\n", "output": "499126064\n499126064\n796234435\n114971967\n891826170\n38460928\n746758804\n102098624\n582205169\n762199467\n509915249\n602954502\n392594249\n215817236\n170876474\n643293880\n150463555\n628074695\n355316779\n513918741\n157394975\n757039573\n277888730\n825789360\n896475652\n681510732\n825...
code_stdio
[ { "content": "You are an expert Python programmer. 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\n3\ny 7\ny 6\nn 5\n\n\nOutput\n\n1### Format: Read the inputs from stdin solve the problem...
[{"input": "3\ny 11\ny 3\nn 10", "output": "1\n"}, {"input": "3\ny 11\nx 3\nn 10", "output": "1\n"}, {"input": "3\nx 2\ny 10\nn 10", "output": "1\n"}, {"input": "3\ny 11\nw 3\nn 10", "output": "1\n"}, {"input": "3\nx 0\ny 10\nn 10", "output": "1\n"}, {"input": "3\ny 0\ny 10\nn 10", "output": "1\n"}, {"input": "3\ny 11\...
code_stdio
[ { "content": "You are an expert Python programmer. 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 bow adorned with nameless flowers that bears the earnest hopes of an equally nameless person.\n\nYou have o...
[{"input": "4\n3\n8 0 2\n4\n6 9 7 2\n9\n1 2 3 4 5 1 7 8 9\n3\n39 242 165\n", "output": "3\n1 2 3\n4\n1 2 3 4\n9\n1 2 3 4 5 6 7 8 9\n3\n1 2 3\n"}, {"input": "4\n3\n8 1 2\n4\n6 9 4 6\n9\n1 2 3 4 5 1 7 8 13\n3\n200 199 198\n", "output": "2\n1 3\n4\n1 2 3 4\n9\n1 2 3 4 5 6 7 8 9\n3\n1 2 3\n"}, {"input": "4\n3\n8 1 2\n4\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\nFukushima Prefecture is also famous for producing fruits, and among them, peaches and apples boast one of the...
[{"input": "the cost of one peach is higher than th`t of one apple.", "output": "the cost of one apple is higher than th`t of one peach.\n"}, {"input": "the cost of ooe peach is higher than th`t of one apple.", "output": "the cost of ooe apple is higher than th`t of one peach.\n"}, {"input": "the cost of ooe peach is h...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nAkaki, a patissier, can make N kinds of doughnut using only a certain powder called \"Okashi no Moto\" (liter...
[{"input": "5 3000\n150\n130\n150\n130\n110\n", "output": "26\n"}, {"input": "5 3000\n150\n130\n150\n130\n100", "output": "28\n"}, {"input": "5 3000\n236\n130\n150\n130\n100", "output": "27\n"}, {"input": "5 3000\n150\n173\n150\n212\n101", "output": "26\n"}, {"input": "5 3000\n50\n130\n150\n130\n100", "output": "53\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 pretend your company just hired your friend from college and paid you a referral bonus. Awesome! To cel...
[{"input": "21\n1.5", "output": "[3]", "fn_name": "beeramid"}, {"input": "454\n5", "output": "[5]", "fn_name": "beeramid"}, {"input": "455\n5", "output": "[6]", "fn_name": "beeramid"}, {"input": "10\n2", "output": "[2]", "fn_name": "beeramid"}, {"input": "11\n2", "output": "[2]", "fn_name": "beeramid"}, {"input": "-1\n...
code_functional
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n# Your Task\nThe city of Darkishland has a strange hotel with infinite rooms. The groups that come to this ho...
[{"input": "10\n900000000000000000", "output": "[1341640786]", "fn_name": "group_size"}, {"input": "10000\n1000000000000000", "output": "[44721361]", "fn_name": "group_size"}, {"input": "2\n20000000000000", "output": "[6324555]", "fn_name": "group_size"}, {"input": "234234\n6577", "output": "[234234]", "fn_name": "grou...
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$ positive integers.\n\nYou are allowed to perform this operation ...
[{"input": "1\n100\n1 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2\n", "output": "YES\n"}, {"input": "10\n2\n1 1\n10\n1 2 3 4 5 6 7 8 9 10\n2\n1000000000 1\n2\n1000000...
code_stdio
[ { "content": "You are an expert Python programmer. 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 [Mersenne prime](https://en.wikipedia.org/wiki/Mersenne_prime) is a prime number that can be represented as...
[{"input": "221", "output": "[false]", "fn_name": "valid_mersenne"}, {"input": "1279", "output": "[true]", "fn_name": "valid_mersenne"}, {"input": "11", "output": "[false]", "fn_name": "valid_mersenne"}, {"input": "21", "output": "[false]", "fn_name": "valid_mersenne"}, {"input": "23", "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\nIn a new version of the famous Pinball game, one of the most important parts of the game field is a sequence ...
[{"input": "100\n<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<\n", "output": "100\n"}, {"input": "100\n>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n", "output": "100\n"}, {"input": "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\nYou are given two integers a and b. In one turn, you can do one of the following operations: \n\n * Take an ...
[{"input": "8\n36 48 2\n36 48 3\n36 48 4\n2 8 1\n2 8 2\n1000000000 1000000000 1000000000\n1 2 1\n2 2 2\n", "output": "YES\nYES\nYES\nYES\nYES\nNO\nYES\nYES\n"}, {"input": "8\n36 48 2\n36 48 3\n36 48 4\n2 8 1\n2 8 2\n1000000000 1000000000 1000100000\n1 2 1\n2 1 1\n", "output": "YES\nYES\nYES\nYES\nYES\nNO\nYES\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\nKuro has recently won the \"Most intelligent cat ever\" contest. The three friends then decided to go to Kati...
[{"input": "50 1\n-1 -1 -1 -1 -1 0 -1 -1 -1 0 1 0 -1 0 1 -1 -1 -1 1 0 1 -1 0 1 0 1 0 0 1 1 -1 1 -1 -1 1 1 -1 -1 0 -1 -1 1 -1 1 -1 1 1 0 0 -1\n", "output": "279519499\n"}, {"input": "50 1\n-1 -1 -1 -1 -1 0 -1 -1 -1 0 1 0 -1 0 1 -1 -1 -1 1 0 1 -1 0 1 0 1 0 0 0 1 -1 1 -1 -1 1 1 -1 -1 0 -1 -1 1 -1 1 -1 1 1 0 0 -1\n", "outp...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nValera has array a, consisting of n integers a_0, a_1, ..., a_{n} - 1, and function f(x), taking an integer f...
[{"input": "43\n761 2165 6131 8874 8980 119 8300 9006 6278 7582 4740 6321 10042 6869 3788 17625 1707 5070 3809 335 2494 8255 1123 1430 190 5712 7313 3286 15423 133 1032 3067 8043 5297 5398 12168 13897 2141 1436 10227 362 8438 2300\n0111011100100011110010011110011011010001101\n", "output": "235367\n"}, {"input": "43\n76...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nAtCoDeer is thinking of painting an infinite two-dimensional grid in a checked pattern of side K.\nHere, a ch...
[{"input": "6 2\n1 2 B\n2 1 W\n2 2 B\n1 0 B\n0 6 W\n4 5 W\n", "output": "4\n"}, {"input": "6 2\n0 2 B\n2 1 W\n0 2 B\n1 0 B\n0 6 W\n-1 5 W", "output": "4\n"}, {"input": "3 2\n0 2 B\n2 1 W\n0 2 B\n1 0 B\n0 6 W\n-1 5 W", "output": "3\n"}, {"input": "6 2\n1 2 B\n2 1 W\n0 2 B\n1 0 B\n0 6 W\n4 5 W", "output": "3\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\nYou are given a sequence of length N: A_1, A_2, ..., A_N.\nFor each integer i between 1 and N (inclusive), an...
[{"input": "2\n200000\n1\n", "output": "1\n200000\n"}, {"input": "3\n-1\n0\n13", "output": "13\n13\n0\n"}, {"input": "3\n-2\n0\n16", "output": "16\n16\n0\n"}, {"input": "3\n0\n1\n13", "output": "13\n13\n1\n"}, {"input": "3\n0\n1\n12", "output": "12\n12\n1\n"}, {"input": "3\n1\n2\n12", "output": "12\n12\n2\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\nWe arrange the numbers between 1 and N (1 <= N <= 10000) in increasing order and decreasing order like this:\...
[{"input": "1\n10\n13\n373", "output": "0\n0\n3\n20\n"}, {"input": "1\n175\n19\n12", "output": "0\n14\n4\n2\n"}, {"input": "1\n175\n19\n16", "output": "0\n14\n4\n0\n"}, {"input": "1\n12\n7\n115", "output": "0\n2\n2\n12\n"}, {"input": "1\n12\n9\n115", "output": "0\n2\n3\n12\n"}, {"input": "1\n10\n7\n189", "output": "0\n...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nGiven is a string S representing the day of the week today.\nS is SUN, MON, TUE, WED, THU, FRI, or SAT, for S...
[{"input": "SAT\n", "output": "1\n"}, {"input": "SUN\n", "output": "7\n"}, {"input": "FRI\n", "output": "2\n"}, {"input": "MON\n", "output": "6\n"}, {"input": "THU\n", "output": "3\n"}, {"input": "TUE\n", "output": "5\n"}, {"input": "WED\n", "output": "4\n"}, {"input": "SUN", "output": "7"}, {"input": "SAT", "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\nGiven is a positive integer N.\nHow many tuples (A,B,C) of positive integers satisfy A \\times B + C = N?\n\n...
[{"input": "1000000\n", "output": "13969985\n"}, {"input": "877046\n", "output": "12137262\n"}, {"input": "999931\n", "output": "13968881\n"}, {"input": "999901\n", "output": "13968459\n"}, {"input": "999927\n", "output": "13968843\n"}, {"input": "105008\n", "output": "1230314\n"}, {"input": "333589\n", "output": "4293...
code_stdio
[ { "content": "You are an expert Python programmer. 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 loves lowercase letters and dislikes uppercase ones. Once he got a string s consisting only of lower...
[{"input": "200\nrsgraosldglhdoorwhkrsehjpuxrjuwgeanjgezhekprzarelduuaxdnspzjuooguuwnzkowkuhzduakdrzpnslauejhrrkalwpurpuuswdgeadlhjwzjgegwpknepazwwleulppwrlgrgedlwdzuodzropsrrkxusjnuzshdkjrxxpgzanzdrpnggdwxarpwohxdepJ\n", "output": "17\n"}, {"input": "200\nMkuxcDWdcnqsrlTsejehQKrTwoOBRCUAywqSnZkDLRmVBDVoOqdZHbrInQQyeRF...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nVitaly is a very weird man. He's got two favorite digits a and b. Vitaly calls a positive integer good, if th...
[{"input": "3 6 1000000\n", "output": "786609214\n"}, {"input": "8 9 1000000\n", "output": "573697309\n"}, {"input": "1 2 1000000\n", "output": "786609214\n"}, {"input": "1 2 1000000\n", "output": "786609214\n"}, {"input": "8 9 1000000\n", "output": "573697309\n"}, {"input": "3 6 1000000\n", "output": "786609214\n"}, {...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n## Nova polynomial add\n\nThis kata is from a series on polynomial handling. ( [#1](http://www.codewars.com/k...
[{"input": "[1, 2, 3, 4, 5, 6]\n[]", "output": "[[1, 2, 3, 4, 5, 6]]", "fn_name": "poly_add"}, {"input": "[]\n[1, 2, 3, 4, 5, 6]", "output": "[[1, 2, 3, 4, 5, 6]]", "fn_name": "poly_add"}, {"input": "[1, 2, 3, 4]\n[4, 3, 2, 1]", "output": "[[5, 5, 5, 5]]", "fn_name": "poly_add"}, {"input": "[1, 2]\n[1]", "output": "[[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\nGiven are positive integers A and B.\nLet us choose some number of positive common divisors of A and B.\nHere...
[{"input": "1000000000000 1000000000000\n", "output": "3\n"}, {"input": "642507465600 642507465600\n", "output": "10\n"}, {"input": "963761198400 963761198400\n", "output": "10\n"}, {"input": "200560490130 200560490130\n", "output": "12\n"}, {"input": "698726868840 271727115660\n", "output": "11\n"}, {"input": "2508779...
code_stdio
[ { "content": "You are an expert Python programmer. 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 program fails again. This time it gets \"Wrong answer on test 233\".\n\nThis is the easier version of th...
[{"input": "98 102\n79 30 51 48 80 91 32 16 39 54 79 17 48 24 8 66 9 94 45 14 85 82 54 89 44 92 26 62 47 5 75 33 102 24 63 39 91 31 33 55 81 63 81 87 26 19 41 108 46 56 91 97 67 30 94 81 40 5 22 8 23 34 5 77 43 66 67 15 7 154 26 22 19 71 26 82 69 52 40 4 98 27 63 74 68 74 55 75 25 51 18 100 22 66 50 38 43 43\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\nproblem\n\nA mysterious $ X $ [cm] plant grows in one place. This plant has the following mysterious properti...
[{"input": "109 30 5\n0\norioan\nnobiro\nuifimd", "output": "109\n"}, {"input": "112 30 9\n0\norioan\nniboro\ntieimd", "output": "112\n"}, {"input": "84 122 10\n0\noobrjn\nonciro\nudfimi", "output": "84\n"}, {"input": "17 122 12\n0\nnjrbop\nnndiro\nudfimi", "output": "17\n"}, {"input": "20 122 12\n0\nnjrbop\nnndiro\nud...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nNick's company employed n people. Now Nick needs to build a tree hierarchy of «supervisor-surbodinate» relati...
[{"input": "7\n10 0 4 7 3 8 6\n10\n3 2 4\n6 4 3\n6 5 1\n1 2 1\n6 7 6\n7 3 9\n1 6 3\n3 2 1\n6 4 4\n1 4 4\n", "output": "23\n"}, {"input": "7\n10 0 4 7 3 8 6\n10\n3 2 4\n6 4 3\n6 5 1\n1 2 1\n6 7 6\n7 3 9\n1 6 3\n3 2 1\n6 4 7\n1 4 4\n", "output": "23\n"}, {"input": "6\n10 2 4 3 1 6\n10\n1 4 10\n1 6 9\n6 4 1\n4 2 5\n4 5 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\nThere are $b$ boys and $g$ girls participating in Olympiad of Metropolises. There will be a board games tourn...
[{"input": "100\n200\n150\n", "output": "101\n"}, {"input": "300\n299\n300\n", "output": "300\n"}, {"input": "199\n199\n199\n", "output": "200\n"}, {"input": "297\n297\n298\n", "output": "297\n"}, {"input": "299\n259\n300\n", "output": "259\n"}, {"input": "288\n188\n300\n", "output": "177\n"}, {"input": "300\n299\n300\...
code_stdio
[ { "content": "You are an expert Python programmer. 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 begin their day with a quick game. They first choose a starting number X0 ≥ 3 and try to reach ...
[{"input": "1000000\n", "output": "998677\n"}, {"input": "908209\n", "output": "453632\n"}, {"input": "999958\n", "output": "250008\n"}, {"input": "570570\n", "output": "285282\n"}, {"input": "959878\n", "output": "239978\n"}, {"input": "959806\n", "output": "239958\n"}, {"input": "959818\n", "output": "239958\n"}, {"i...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nproblem\n\nGiven a sequence $ a_i $ of length $ N $. Output all integers $ K (1 \\ le K \\ le N) $ that satis...
[{"input": "8\n0 1 1 -24 -1 1 1 0", "output": "1 2 3 5 6 7 8\n"}, {"input": "8\n-1 0 12 16 3 1 0 -1", "output": "1 2 6 7 8\n"}, {"input": "8\n-1 0 12 8 3 1 0 -1", "output": "1 2 6 7 8\n"}, {"input": "8\n5 2 4 4 4 14 2 5", "output": "1 2 6 7 8\n"}, {"input": "8\n5 2 4 9 4 9 2 5", "output": "1 2 4 6 7 8"}, {"input": "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\nTakahashi is doing a research on sets of points in a plane. Takahashi thinks a set S of points in a coordinat...
[{"input": "33 4 2", "output": "0 0\n0 1\n0 4\n0 5\n0 8\n0 9\n0 12\n0 13\n0 16\n0 17\n0 20\n0 21\n0 24\n0 25\n0 28\n0 29\n0 32\n0 33\n0 36\n0 37\n0 40\n0 41\n0 44\n0 45\n0 48\n0 49\n0 52\n0 53\n0 56\n0 57\n0 60\n0 61\n0 64\n0 65\n2 2\n2 3\n2 6\n2 7\n2 10\n2 11\n2 14\n2 15\n2 18\n2 19\n2 22\n2 23\n2 26\n2 27\n2 30\n2 31...
code_stdio
[ { "content": "You are an expert Python programmer. 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\n```python\nword_pattern(pattern, string)\n```\nthat given a ```pattern``` and a string ```str```, find...
[{"input": "\"aafggiilp\"\n\"cow cow fly rooster pig sheep sheep chicken aardvark\"", "output": "[false]", "fn_name": "word_pattern"}, {"input": "\"aafggiilp\"\n\"cow cow fly pig pig sheep sheep chicken aardvark\"", "output": "[true]", "fn_name": "word_pattern"}, {"input": "\"abcdef\"\n\"apple banana cat donkey elephan...
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 consider one interesting word game. In this game you should transform one word into another through spe...
[{"input": "dkjijdkjijdkjijdkjijdkjijdkjijdkjijdkjijdkjijdkjijdkjijdkjijdkjijdkjijdkjijdkjijdkjijdkjijdkjijdkjijdkjijdkjijdkjijdkjijdkjijdkjijdkjijdkjijdkjijdkjijdkjijdkjijdkjijdkjijdkjijdkjijdkjijdkjijdkjijdkjijdkjijdkjij\ndddkikjjidkkidijjjjkkjjikjdikiidijjikikjijjiijdikkjjjiddjjijkkkjkiijijkijdjjikikdjjjijdddjkjjdij...
code_stdio
[ { "content": "You are an expert Python programmer. 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 Mister B has free evenings when he doesn't know what to do. Fortunately, Mister B found a new game,...
[{"input": "12 12 876543210 1000000000\n", "output": "13"}, {"input": "10 12 220000011 220000032\n", "output": "11"}, {"input": "3 10 498103029 1063506054\n", "output": "4\n"}, {"input": "13 8 654321109 654321126\n", "output": "13\n"}, {"input": "5 6 1000000000 1000001000\n", "output": "6\n"}, {"input": "3 12 498103029...
code_stdio
[ { "content": "You are an expert Python programmer. 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 an environmental activist at heart but the reality is harsh and you are just a cashier in a cinema. B...
[{"input": "4\n1\n100\n50 1\n49 1\n100\n8\n100 200 100 200 100 200 100 100\n10 2\n15 3\n107\n3\n1000000000 1000000000 1000000000\n50 1\n50 1\n3000000000\n5\n200 100 100 100 100\n69 5\n31 2\n90\n", "output": "-1\n6\n3\n4\n"}, {"input": "4\n1\n100\n50 1\n49 1\n100\n8\n100 200 100 200 100 200 100 100\n10 2\n15 3\n107\n3\n...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nThere are 2N balls, N white and N black, arranged in a row. The integers from 1 through N are written on the ...
[{"input": "2000\nB 1731\nW 1129\nW 285\nB 1447\nW 1836\nW 1278\nW 1648\nW 1593\nW 710\nB 470\nW 264\nW 1693\nW 103\nW 1622\nW 1883\nW 824\nB 1337\nB 115\nW 1645\nB 1682\nW 245\nW 453\nW 606\nW 996\nW 394\nW 1795\nW 1930\nB 809\nB 1761\nW 1552\nW 656\nB 1527\nB 74\nB 1269\nW 527\nB 422\nW 1387\nW 1020\nB 206\nB 815\nW ...
code_stdio
[ { "content": "You are an expert Python programmer. 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 has got an array $a$ consisting of $n$ integers. Let's denote $k$ as the mathematic mean of these el...
[{"input": "4\n4\n8 8 12 14\n3\n50 25 10\n5\n1 4 7 3 5\n7\n-1 2 3 4 1 0 7\n", "output": "0\n0\n2\n0\n"}, {"input": "4\n4\n8 8 12 14\n3\n44 25 10\n5\n1 4 7 3 5\n7\n-1 2 3 4 1 0 7\n", "output": "0\n0\n2\n0\n"}, {"input": "4\n4\n8 8 18 14\n3\n44 25 10\n5\n1 4 7 3 5\n7\n-1 2 3 4 1 0 7\n", "output": "0\n0\n2\n0\n"}, {"input...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nThere are $n$ candles on a Hanukkah menorah, and some of its candles are initially lit. We can describe which...
[{"input": "5\n5\n10010\n11010\n2\n01\n11\n3\n110\n111\n9\n100010111\n111101100\n4\n001011011\n011010111\n", "output": "-1\n1\n-1\n-1\n-1\n"}, {"input": "5\n5\n11000\n01000\n2\n01\n10\n3\n000\n101\n9\n100011111\n101101100\n9\n001001000\n011000101\n", "output": "-1\n2\n-1\n-1\n-1\n"}, {"input": "5\n5\n11000\n11010\n2\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 a directed graph of $n$ vertices and $m$ edges. Vertices are numbered from $1$ to $n$. There is...
[{"input": "50 49\n1 3\n6 46\n47 25\n11 49\n47 10\n26 10\n12 38\n45 38\n24 39\n34 22\n36 3\n21 16\n43 44\n45 23\n2 31\n26 13\n28 42\n43 30\n12 27\n32 44\n24 25\n28 20\n15 19\n6 48\n41 7\n15 17\n8 9\n2 48\n33 5\n33 23\n4 19\n40 31\n11 9\n40 39\n35 27\n14 37\n32 50\n41 20\n21 13\n14 42\n18 30\n35 22\n36 5\n18 7\n4 49\n29...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nRelative B came to Mr. A's house. He is 3 years old and loves blocks. The block he has is shaped like Figure ...
[{"input": "20 21\n1 0\n14 8\n7\n4 0 1 1\n6 -1 1 3\n2 0 3 3\n1 0 5 0\n5 1 7 3\n2 -1 2 7\n2 -1 6 8\n20 20\n9 9\n1 1\n6\n2 0 1 1\n1 0 5 0\n2 1 1 4\n5 0 1 0\n4 1 6 10\n4 0 8 5\n0 0", "output": "NG\nNG\n"}, {"input": "20 21\n1 0\n14 8\n7\n4 0 1 1\n6 -1 1 3\n2 0 3 3\n1 0 5 0\n5 1 7 3\n2 -1 2 7\n2 -1 4 8\n20 20\n9 9\n1 1\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\nThere is BMI (Body Mass Index) as an index showing the degree of obesity. The BMI value is calculated using t...
[{"input": "6\n2 165 27\n-1 317 60\n2 68 72\n11 160 75\n7 185 001\n10 182 113\n3\n3 37 105\n0 229 6\n2 204 75\n0", "output": "11\n2\n"}, {"input": "6\n2 95 27\n-1 317 60\n2 68 72\n11 160 75\n7 185 101\n10 182 113\n3\n3 37 105\n0 229 6\n1 204 75\n0", "output": "11\n1\n"}, {"input": "6\n2 179 27\n-1 317 107\n2 50 72\n11 ...
code_stdio
[ { "content": "You are an expert Python programmer. 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 Aramic language words can only represent objects.\n\nWords in Aramic have special properties: A word is ...
[{"input": "10\nbda bbb cda dca dda dcb bcd dcb ada ddd\n", "output": "6\n"}, {"input": "10\ncda bbb cda dca dda dcb bcd dcb ada ddd\n", "output": "5\n"}, {"input": "10\nbda bbb cda dca dda dcb bcd dcb ada edd\n", "output": "6\n"}, {"input": "10\nbda bbb adc dca dda dcb bcd dcb ada edd\n", "output": "6\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\nIn this Kata, you will be given an array of numbers and a number `n`, and your task will be to determine if `...
[{"input": "[1, 2, 3, 4, 5]\n10", "output": "[true]", "fn_name": "solve"}, {"input": "[1, 2, 3, 4, 5]\n15", "output": "[true]", "fn_name": "solve"}, {"input": "[1, 2, 3, 4, 5]\n8", "output": "[true]", "fn_name": "solve"}, {"input": "[7, 2, 8, 5]\n16", "output": "[false]", "fn_name": "solve"}, {"input": "[3, 1, 5, 7]\n1...
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 Coding Procedures Company (ICPC) writes all its code in Jedi Script (JS) programming language. ...
[{"input": "8\n< > << >> in out fun in>>out\n6\n# let's rock\nin>>out in >> out inout>>outin bin>>out # yay!\nfun>>in>>out funin>>out out>>in <in> > <out>\nin> >> >>> >>>> >>>>>out\n# what's going on here?\n<> <> <> <> <fun> <funfun> <not so fun>\n", "output": "in>>outin>> out a>>b c>>out fun>>in>>outd>>out out>>in<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\nn! = n × (n − 1) × (n − 2) × ... × 3 × 2 × 1\n\nIs called the factorial of n. For example, the factorial of 1...
[{"input": "2\n51\n11000\n0", "output": "0\n12\n2748\n"}, {"input": "2\n58\n10011\n0", "output": "0\n13\n2501\n"}, {"input": "2\n59\n10111\n0", "output": "0\n13\n2525\n"}, {"input": "2\n62\n10110\n0", "output": "0\n14\n2525\n"}, {"input": "2\n50\n10101\n0", "output": "0\n12\n2523\n"}, {"input": "2\n80\n11010\n0", "outp...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nThe Tower of Hanoi is a well-known mathematical puzzle. It consists of three rods, and a number of disks of d...
[{"input": "0 10000 10000\n10000 0 10000\n10000 10000 0\n40\n", "output": "10995116277750000\n"}, {"input": "0 10000 10000\n10000 0 10000\n10000 10000 0\n40\n", "output": "10995116277750000\n"}, {"input": "0 00000 10000\n10000 0 10000\n10000 10000 0\n40\n", "output": "8551757104850000\n"}, {"input": "0 4499 7885\n10073...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nYou are given an integer m as a product of integers a1, a2, ... an <image>. Your task is to find the number o...
[{"input": "50\n675 25000 2025 50 450 31250 3750 225 1350 250 72 187500 12000 281250 187500 30000 45000 90000 90 1200 9000 56250 5760 270000 3125 3796875 2250 101250 40 2500 175781250 1250000 45000 2250 3000 31250 46875 135000 421875000 36000 360 140625000 13500 1406250 229 250 75000 62500 150 6\n", "output": "60487335...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nArpa is researching the Mexican wave.\n\nThere are n spectators in the stadium, labeled from 1 to n. They sta...
[{"input": "1000000000 1000000000 1000000000\n", "output": "1000000000\n"}, {"input": "1000000000 1000000000 1000000000\n", "output": "1000000000\n"}, {"input": "1000000000 1000000000 1400000000\n", "output": "600000000\n"}, {"input": "1000000000 1000000000 1400000000\n", "output": "600000000\n"}, {"input": "1100000000...
code_stdio
[ { "content": "You are an expert Python programmer. 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 robot is standing at the origin of the infinite two-dimensional plane. Each second the robot moves exactly ...
[{"input": "1000\n", "output": "251001\n"}, {"input": "1000\n", "output": "251001\n"}, {"input": "777\n", "output": "303420\n"}, {"input": "998\n", "output": "250000\n"}, {"input": "999\n", "output": "501000\n"}, {"input": "777\n", "output": "303420\n"}, {"input": "999\n", "output": "501000\n"}, {"input": "998\n", "out...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nAs a tradition, every year before IOI all the members of Natalia Fan Club are invited to Malek Dance Club to ...
[{"input": "0110011110111000001101001010101000011011101001001101000000111101010101111101010011101001111010111001\n", "output": "416862683\n"}, {"input": "0111001111110010000001111100110100111110001100100001111111110000010010111010010010010111000110001111\n", "output": "777947548\n"}, {"input": "100000000110101010101111...
code_stdio
[ { "content": "You are an expert Python programmer. 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 takes part in a math show. He is given n tasks, each consists of k subtasks, numbered 1 through k. I...
[{"input": "12 45 2290987\n50912 189025 5162 252398 298767 154151 164139 185891 121047 227693 93549 284244 312843 313833 285436 131672 135248 324541 194905 205729 241315 32044 131902 305884 263 27717 173077 81428 285684 66470 220938 282471 234921 316283 30485 244283 170631 224579 72899 87066 6727 161661 40556 89162 314...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nDemiurges Shambambukli and Mazukta love to watch the games of ordinary people. Today, they noticed two men wh...
[{"input": "50\n1 2\n2 3\n3 4\n4 5\n5 6\n6 7\n7 8\n8 9\n9 10\n10 11\n11 12\n12 13\n13 14\n14 15\n15 16\n16 17\n17 18\n18 19\n19 20\n20 21\n21 22\n22 23\n23 24\n24 25\n25 26\n26 27\n27 28\n28 29\n29 30\n30 31\n31 32\n32 33\n33 34\n34 35\n35 36\n36 37\n37 38\n38 39\n39 40\n40 41\n41 42\n42 43\n43 44\n44 45\n45 46\n46 47\...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nWe have N non-negative integers: A_1, A_2, ..., A_N.\nConsider painting at least one and at most N-1 integers...
[{"input": "20\n1008288677408720767 539403903321871999 1044301017184589821 215886900497862655 504277496111605629 972104334925272829 792625803473366909 972333547668684797 467386965442856573 755861732751878143 1151846447448561405 467257771752201853 683930041385277311 432010719984459389 319104378117934975 6114512914442339...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nCreate a function which checks a number for three different properties.\n\n- is the number prime?\n- is the n...
[{"input": "179424693", "output": "[[false, false, false]]", "fn_name": "number_property"}, {"input": "179424691", "output": "[[true, false, false]]", "fn_name": "number_property"}, {"input": "25", "output": "[[false, false, false]]", "fn_name": "number_property"}, {"input": "131", "output": "[[true, false, false]]", "...
code_functional
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nThe girl Taylor has a beautiful calendar for the year y. In the calendar all days are given with their days o...
[{"input": "105311\n", "output": "105322\n"}, {"input": "99999\n", "output": "100010\n"}, {"input": "99988\n", "output": "100016\n"}, {"input": "99996\n", "output": "100024\n"}, {"input": "50501\n", "output": "50507\n"}, {"input": "50000\n", "output": "50028\n"}, {"input": "99900\n", "output": "99906\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\nNote that girls in Arpa’s land are really attractive.\n\nArpa loves overnight parties. In the middle of one o...
[{"input": "26\n8 10\n52 21\n2 33\n18 34\n30 51\n5 19\n22 32\n36 28\n42 16\n13 49\n11 17\n31 39\n43 37\n50 15\n29 20\n35 46\n47 23\n3 1\n44 7\n9 27\n6 48\n40 24\n26 14\n45 4\n12 25\n41 38\n", "output": "2 1\n1 2\n2 1\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n2 1\n1 2\n1 2\n1 2\n2 1\n2 1\n2 1\n2 1\n2 1\n2 1\n2 1\n2 1\n1 2\n2 1\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\nFor a set $S$ of integers, perform a sequence of the following operations. Note that each value in $S$ must b...
[{"input": "7\n0 -1\n0 2\n0 6\n1 2\n0 -1\n0 -1\n1 20", "output": "1\n2\n3\n1\n3\n3\n0\n"}, {"input": "7\n0 -1\n0 2\n0 5\n1 2\n0 -1\n1 0\n1 20", "output": "1\n2\n3\n1\n3\n0\n0\n"}, {"input": "7\n0 -1\n0 2\n0 6\n1 2\n0 -1\n0 0\n1 20", "output": "1\n2\n3\n1\n3\n4\n0\n"}, {"input": "7\n0 -2\n0 2\n0 6\n1 2\n0 -1\n0 0\n1 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\nMaria participates in a bicycle race.\n\nThe speedway takes place on the shores of Lake Lucerne, just repeati...
[{"input": "24\n-10000 -10000\n-10000 9998\n9998 9998\n9998 -10000\n-6364 -10000\n-6364 6362\n6362 6362\n6362 -6364\n-2728 -6364\n-2728 2726\n2726 2726\n2726 -910\n908 -910\n908 908\n-910 908\n-910 -4546\n4544 -4546\n4544 4544\n-4546 4544\n-4546 -8182\n8180 -8182\n8180 8180\n-8182 8180\n-8182 -10000\n-10000 -10000\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've got a robot, its task is destroying bombs on a square plane. Specifically, the square plane contains n...
[{"input": "24\n-2 -2\n-1 1\n0 1\n1 1\n0 2\n1 -1\n2 -2\n1 -4\n-1 1\n0 -2\n0 -2\n-2 0\n-2 -1\n2 -1\n2 2\n-1 -2\n-2 1\n2 0\n-1 2\n1 2\n-1 -1\n1 0\n2 1\n-2 2\n", "output": "130\n1 1 U\n2\n1 1 D\n3\n1 1 R\n2\n1 1 L\n3\n1 1 L\n1 1 U\n2\n1 1 R\n1 1 D\n3\n1 1 R\n1 1 U\n2\n1 1 L\n1 1 D\n3\n1 2 U\n2\n1 2 D\n3\n1 1 R\n1 1 D\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\nLet $f(x)$ be the sum of digits of a decimal number $x$.\n\nFind the smallest non-negative integer $x$ such t...
[{"input": "7\n1 0\n2 1\n42 7\n1 9\n64 0\n99 0\n99 2\n", "output": "1\n-1\n4\n-1\n19999999\n99999999999\n7997\n"}, {"input": "7\n1 0\n1 1\n42 7\n1 9\n64 0\n99 0\n99 2\n", "output": "1\n0\n4\n-1\n19999999\n99999999999\n7997\n"}, {"input": "7\n1 0\n1 1\n42 7\n13 7\n99 1\n99 0\n99 2\n", "output": "1\n0\n4\n-1\n599998\n999...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nAlmost every text editor has a built-in function of center text alignment. The developers of the popular in B...
[{"input": "8\n\n\n\ny\nW\n\n\n\n3B\n\nw\nV\n\n\n\nL\nSr\n\n\nV\n\n5\n\nAq\n\n\n\nJ\nR\n\n04\nJ\nv\nUh\n\n\n\nY\nG\n4\n\nG\nb\n\n\n9\n\n6\nd\n\n2\n\n\nE\n7\n\nr\n\n\n\n\nKC\ns\nE\n\nab\n4\nx\n\n\n\n\n\nEe\n4\n\nl\n\np\n\nG\nM\n\n\nn\n\n\nm0\n\nw\n\n\nP\n\n\n\n0\n\n\n", "output": "****\n*8 *\n* *\n* *\n* *\n* y*\n*W ...
code_stdio
[ { "content": "You are an expert Python programmer. 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 hero of justice, the Spider, can pull a rope out of his arm and jump from building to building. However, ...
[{"input": "4\n1 -2 0\n2 30 0\n3 33 40\n4 1 60\n2\n1 3\n1 4\n22\n1 0 0\n2 150 40\n3 30 20\n4 180 150\n5 40 80\n6 130 130\n7 72 28\n8 172 118\n9 50 50\n10 160 82\n11 90 105\n12 218 131\n13 130 64\n14 80 140\n15 36 117\n16 190 90\n17 60 100\n18 100 70\n19 130 100\n20 71 69\n21 200 110\n22 120 150\n1\n1 22\n0", "output": ...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n< PREVIOUS KATA\nNEXT KATA >\n\n## Task:\n\nYou have to write a function `pattern` which returns the followin...
[{"input": "10\n-2999", "output": "[\"1 1\\n 2 2 \\n 3 3 \\n 4 4 \\n 5 5 \\n 6 6 \\n 7 7 \\n 8 8 \\n 9 9 \\n 0 \\n 9 9 \\n 8 8 \\n 7 7 ...
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 grid, consisting of $2$ rows and $n$ columns. Each cell of this grid should be colored either...
[{"input": "1000 1000\n", "output": "987824894\n"}, {"input": "1000 1100\n", "output": "961685369\n"}, {"input": "1000 1110\n", "output": "720640362\n"}, {"input": "1000 1010\n", "output": "841013797\n"}, {"input": "1000 500\n", "output": "805290096\n"}, {"input": "1000 1000\n", "output": "987824894"}, {"input": "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\nYou are the top spy of AtCoder Kingdom. To prevent the stolen secret from being handed to AlDebaran Kingdom, ...
[{"input": "32\n3 1 8 1 5 9 4 2 3 3 9 8 11 7 16 4 2 4 8 2 4 4 7 7 3 3 30 4 4 7 2 8", "output": "13\n"}, {"input": "32\n3 1 8 1 5 2 7 2 3 3 9 8 11 7 16 4 2 4 8 2 4 4 7 7 3 3 30 4 4 7 2 8", "output": "12\n"}, {"input": "32\n3 1 4 1 8 11 8 6 5 3 5 8 9 7 9 3 2 3 8 4 6 2 6 4 3 3 8 3 3 7 2 14", "output": "20\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\nLet's say take 2 strings, A and B, and define the similarity of the strings to be the length of the longest p...
[{"input": "\"ababaa\"", "output": "[11]", "fn_name": "string_suffix"}, {"input": "\"aaaaaa\"", "output": "[21]", "fn_name": "string_suffix"}, {"input": "\"aaaaa\"", "output": "[15]", "fn_name": "string_suffix"}, {"input": "\"mnsomn\"", "output": "[8]", "fn_name": "string_suffix"}, {"input": "\"aaaa\"", "output": "[10]...
code_functional