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\nThe prime number sequence starts with: `2,3,5,7,11,13,17,19...`. Notice that `2` is in position `one`. \n\n`3...
[{"input": "2000\n200000", "output": "[183035206]", "fn_name": "solve"}, {"input": "3000\n400000", "output": "[650120994]", "fn_name": "solve"}, {"input": "4000\n500000", "output": "[972664400]", "fn_name": "solve"}, {"input": "1000\n100000", "output": "[52114889]", "fn_name": "solve"}, {"input": "500\n10000", "output"...
code_functional
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nThere is a game called \"I Wanna Be the Guy\", consisting of n levels. Little X and his friend Little Y are a...
[{"input": "100\n75 83 69 73 30 76 37 48 14 41 42 21 35 15 50 61 86 85 46 3 31 13 78 10 2 44 80 95 56 82 38 75 77 4 99 9 84 53 12 11 36 74 39 72 43 89 57 28 54 1 51 66 27 22 93 59 68 88 91 29 7 20 63 8 52 23 64 58 100 79 65 49 96 71 33 45\n83 50 89 73 34 28 99 67 77 44 19 60 68 42 8 27 94 85 14 39 17 78 24 21 29 63 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\nWay to go! Heidi now knows how many brains there must be for her to get one. But throwing herself in the mids...
[{"input": "1000000000\n", "output": "231564544\n"}, {"input": "1000000000\n", "output": "231564544\n"}, {"input": "1000000100\n", "output": "231564594\n"}, {"input": "1000010100\n", "output": "231569594\n"}, {"input": "1038818275\n", "output": "519409137\n"}, {"input": "536870910\n", "output": "134217727\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\nAfter years of hard work scientists invented an absolutely new e-reader display. The new display has a larger...
[{"input": "10\n1101010101\n1110101010\n0111010101\n1011101010\n0101110101\n1010111010\n0101011101\n1010101110\n0101010111\n1010101011\n", "output": "100\n"}, {"input": "10\n1111100000\n0010100000\n0110111000\n0000001000\n1011001010\n0010100001\n0010111000\n0011001010\n0000110010\n0000001100\n", "output": "20\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\nIn this Kata, you will be given a string and your task will be to return a list of ints detailing the count o...
[{"input": "\"RYT'>s&gO-.CM9AKeH?,5317tWGpS<*x2ukXZD\"", "output": "[[15, 8, 6, 9]]", "fn_name": "solve"}, {"input": "\"@mw>0=QD-iAx!rp9TaG?o&M%l$34L.nbft\"", "output": "[[7, 13, 4, 10]]", "fn_name": "solve"}, {"input": "\"P*K4%>mQUDaG$h=cx2?.Czt7!Zn16p@5H\"", "output": "[[9, 9, 6, 9]]", "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\nLittle penguin Polo adores integer segments, that is, pairs of integers [l; r] (l ≤ r). \n\nHe has a set that...
[{"input": "47 21\n3 5\n-422 -417\n60 60\n-348 -348\n-3 -3\n-364 -361\n-49 -41\n-436 -430\n-250 -244\n-33 -26\n-162 -158\n-90 -88\n-357 -352\n-339 -337\n-25 -19\n-69 -67\n-261 -260\n-292 -283\n12 18\n44 44\n-277 -275\n-301 -293\n-108 -98\n-180 -172\n-327 -318\n-314 -309\n-12 -7\n-134 -130\n33 35\n-190 -184\n-65 -55\n-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\nYou are given a tree consisting of n nodes. You generate an array from the tree by marking nodes one by one.\...
[{"input": "6\n2 1\n2 3\n6 1\n1 4\n1 5\n", "output": "750000011\n"}, {"input": "6\n2 1\n1 3\n6 1\n1 4\n2 5\n", "output": "416666675\n"}, {"input": "6\n2 1\n2 3\n6 1\n1 4\n4 5\n", "output": "666666677\n"}, {"input": "6\n2 1\n1 3\n6 1\n2 4\n4 5\n", "output": "500000009\n"}, {"input": "6\n2 1\n2 3\n6 1\n2 4\n4 5\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\nIn Berland, $n$ different types of banknotes are used. Banknotes of the $i$-th type have denomination $10^{a_...
[{"input": "4\n3 27\n0 1 2\n2 777\n0 2\n3 255\n0 1 3\n10 1000000000\n0 1 2 3 4 5 6 7 8 9\n", "output": "1099\n67999\n148999\n999999920999999999\n"}, {"input": "4\n3 22\n0 1 4\n2 1121\n0 2\n3 192\n0 1 2\n10 1000000000\n0 1 2 3 4 5 6 7 8 9\n", "output": "149\n102399\n17599\n999999920999999999\n"}, {"input": "4\n3 27\n0 1...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSnuke has a calculator. It has a display and two buttons.\n\nInitially, the display shows an integer x. Snuke...
[{"input": "-10 -23", "output": "15\n"}, {"input": "110 -1", "output": "110\n"}, {"input": "-10 -63", "output": "55\n"}, {"input": "273 -1", "output": "273\n"}, {"input": "141 -1", "output": "141\n"}, {"input": "174 -1", "output": "174\n"}, {"input": "141 -2", "output": "140\n"}, {"input": "264 -2", "output": "263\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 marketing team is spending way too much time typing in hashtags. \nLet's help them with our own Hashtag...
[{"input": "\"Looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong Cat\"", "output": "[false]", "fn_name": "generate_hashtag"}, {"input": "\"codewars is nice\"", "output": "[\"#CodewarsIsNice\"]", "fn_name": "gen...
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\nEntrance Examination\n\nThe International Competitive Programming College (ICPC) is famous for its research o...
[{"input": "5 2 4\n100\n90\n82\n70\n65\n5 2 4\n100\n170\n80\n75\n65\n3 1 2\n5000\n6502\n3000\n4 2 3\n10000\n10100\n8000\n8000\n4 2 3\n10000\n10000\n10000\n8000\n5 2 3\n100\n80\n136\n60\n111\n0 0 0", "output": "3\n2\n2\n2\n3\n3\n"}, {"input": "5 2 3\n100\n161\n82\n70\n65\n5 2 4\n100\n90\n25\n144\n65\n3 1 2\n5000\n6502\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\nEach New Year Timofey and his friends cut down a tree of n vertices and bring it home. After that they paint ...
[{"input": "10\n5 7\n4 5\n10 2\n4 6\n1 2\n3 4\n8 5\n4 9\n2 3\n15 15 15 15 5 15 26 18 15 15\n", "output": "YES\n5\n"}, {"input": "10\n5 7\n4 5\n10 2\n4 6\n1 2\n3 4\n8 5\n4 9\n2 3\n15 15 15 15 5 15 42 18 15 15\n", "output": "YES\n5\n"}, {"input": "10\n5 7\n4 5\n10 2\n3 6\n1 2\n3 4\n8 5\n4 9\n2 3\n15 15 15 15 5 15 26 18 1...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nGift Exchange Party\n\nA gift exchange party will be held at a school in TKB City.\n\nFor every pair of stude...
[{"input": "4 3\n1 2\n2 3\n1 3\n4 3\n1 2\n1 3\n1 4\n15 6\n1 7\n1 3\n1 4\n2 3\n3 4\n3 4\n0 0", "output": "0 1\n0 1\n0 2\n"}, {"input": "3 3\n1 2\n2 3\n1 3\n4 3\n1 2\n1 3\n1 4\n4 6\n1 2\n1 3\n1 2\n2 3\n3 4\n2 4\n0 0", "output": "1 1\n0 1\n1 2\n"}, {"input": "3 3\n2 2\n2 3\n2 3\n4 3\n1 2\n1 3\n1 4\n4 6\n1 4\n1 3\n1 4\n2 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\nYou are given a string s consisting of lowercase Latin letters. Character c is called k-dominant iff each sub...
[{"input": "gfliflgfhhdkceacdljgkegmdlhcgkcmlelmbbbmdddgdeeljjhgbbffmemmmkhebgkhadkdajabcjkcgbkgbaeacdedlkklfech\n", "output": "17\n"}, {"input": "gfliflgfhhdkceacdljgkegmdlhcgkcmlelmbbbmdddgdeeljjhgbbffmemmmjhebgkhadkdajabcjkcgbkgbaeacdedlkklfech\n", "output": "17\n"}, {"input": "hceflkkldedcaeabgkbgckjcbajadkdahkgbeh...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nJ - Tree Reconstruction\n\nProblem Statement\n\nYou have a directed graph. Some non-negative value is assigne...
[{"input": "18 2\n1 1\n1 3\n1 13\n2 4\n3 0\n5 6\n0 9\n5 12\n0 10\n6 3\n7 9\n5 10\n9 1", "output": "1\n"}, {"input": "18 2\n1 1\n1 3\n1 9\n2 4\n3 0\n5 6\n0 9\n5 12\n0 10\n6 3\n7 9\n5 10\n9 1", "output": "1\n"}, {"input": "9 2\n1 1\n1 3\n1 11\n2 4\n3 0\n5 6\n4 9\n5 10\n6 20\n6 8\n7 9\n5 10\n9 1", "output": "1\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\nA prime number is a number which has exactly two distinct divisors: one and itself. For example, numbers 2, 7...
[{"input": "13 17\n", "output": "YES\n"}, {"input": "23 29\n", "output": "YES\n"}, {"input": "43 47\n", "output": "YES\n"}, {"input": "17 19\n", "output": "YES\n"}, {"input": "11 13\n", "output": "YES\n"}, {"input": "19 23\n", "output": "YES\n"}, {"input": "37 41\n", "output": "YES\n"}, {"input": "31 37\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\n4 different points on the plane Read the coordinates of $ A (x_a, y_a) $, $ B (x_b, y_b) $, $ C (x_c, y_c) $,...
[{"input": "1.0,0.0,0.1,0.1,0.0,0.1,0.0,0.0\n0.3,0.1,0.1,1.1,0.0,0.3,0.0,0.0", "output": "YES\nYES\n"}, {"input": "0.0,0.0,1.0,0.0,1.0,1.0,0.0,0.1\n0.3,0.1,0.1,1.1,0.0,0.3,0.0,0.0", "output": "YES\nYES\n"}, {"input": "0.0,0.0,1.0,0.0,1.0,1.0,0.0,0.1\n0.3,0.1,0.1,1.1,0.0,0.4,0.0,0.0", "output": "YES\nYES\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 two strings of equal length $s$ and $t$ consisting of lowercase Latin letters. You may perform ...
[{"input": "3\nxabb\naabx\ntechnocup\ntechnocup\na\nz\n", "output": "YES\nYES\nNO\n"}, {"input": "3\nxabb\naabx\nteohnccup\ntechnocup\na\nz\n", "output": "YES\nYES\nNO\n"}, {"input": "3\nxabb\naabx\ntdohnccup\ntechnocup\na\nz\n", "output": "YES\nYES\nNO\n"}, {"input": "3\nxabb\nxbaa\ntdohnccup\ntechnocup\na\nz\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\nA group of university students wants to get to the top of a mountain to have a picnic there. For that they de...
[{"input": "100 100 100\n", "output": "179"}, {"input": "100 0 100\n", "output": "179"}, {"input": "100 100 0\n", "output": "178"}, {"input": "0 100 100\n", "output": "179"}, {"input": "45 52 14\n", "output": "106\n"}, {"input": "50 28 30\n", "output": "102\n"}, {"input": "99 97 42\n", "output": "177\n"}, {"input": "90...
code_stdio
[ { "content": "You are an expert Python programmer. 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 that takes a list of one or more non-negative integers, and arranges them such that they fo...
[{"input": "[422, 995, 500, 202, 772, 230, 258, 144, 752]", "output": "[995772752500422258230202144]", "fn_name": "largest_arrangement"}, {"input": "[451, 850, 85, 283, 4, 734, 605, 499, 249]", "output": "[858507346054994514283249]", "fn_name": "largest_arrangement"}, {"input": "[70, 7, 81, 28, 336, 246, 817, 77, 4, 55...
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\nAfter passing a test, Vasya got himself a box of $n$ candies. He decided to eat an equal amount of candies ea...
[{"input": "3345775397705614178\n", "output": "131353216887383264\n"}, {"input": "2750054323692292581\n", "output": "107965550311522536\n"}, {"input": "1000000000000000000\n", "output": "39259424579862572\n"}, {"input": "1000000000000000000\n", "output": "39259424579862572\n"}, {"input": "1288212249779732665\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\nDid you ever hear about 'Dragon Food' ? Its used to refer to the chocolates bought for your loved ones :). Po...
[{"input": "3\n21 1 7\n2 1 1\n6 16 1", "output": "1966080\n3\n48\n"}, {"input": "3\n21 1 7\n2 0 1\n6 16 1", "output": "1966080\n2\n48\n"}, {"input": "3\n21 1 1\n2 0 1\n6 16 1", "output": "1572864\n2\n48\n"}, {"input": "3\n21 1 1\n2 0 1\n6 16 0", "output": "1572864\n2\n32\n"}, {"input": "3\n11 1 7\n2 1 1\n6 16 7", "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\nKurt reaches nirvana when he finds the product of all the digits of some positive integer. Greater value of t...
[{"input": "1000000000\n", "output": "387420489\n"}, {"input": "2000000000\n", "output": "387420489\n"}, {"input": "1382011913\n", "output": "387420489\n"}, {"input": "1999999999\n", "output": "387420489\n"}, {"input": "1999999998\n", "output": "387420489\n"}, {"input": "1616324002\n", "output": "387420489\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\nA widely known among some people Belarusian sport programmer Lesha decided to make some money to buy a one sq...
[{"input": "4\ntfggs qnehos igekv rnmr\n10\n8 ccj ccj qnehos igekv rnmr ccj igekv qnehos\n8 rnmr igekv gydhj tfggs ccj tfggs rnmr rnmr\n8 gydhj qnehos igekv ccj tfggs gydhj qnehos ccj\n8 tfggs igekv rnmr rnmr rnmr tfggs rnmr ccj\n8 jjwek gydhj gydhj tfggs igekv igekv rnmr ccj\n8 rnmr tfggs rnmr tfggs rnmr gydhj ccj qne...
code_stdio
[ { "content": "You are an expert Python programmer. 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 will define Ginkgo numbers and multiplication on Ginkgo numbers.\n\nA Ginkgo number is a pair <m, n> where...
[{"input": "8\n10 -1\n-2 12\n1 3\n6 -1\n1 -40\n-8 0\n-4 1\n2 -1", "output": "P\nC\nC\nP\nP\nC\nP\nP\n"}, {"input": "8\n10 -1\n0 2\n-1 2\n4 0\n0 -25\n-4 0\n-2 -1\n2 -1", "output": "P\nC\nP\nC\nC\nC\nP\nP\n"}, {"input": "8\n10 -1\n-1 4\n0 3\n6 -1\n2 -23\n-13 0\n-2 1\n2 0", "output": "P\nP\nP\nP\nC\nC\nP\nC\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 an array $a$ consisting of $n$ positive integers. Find a non-empty subset of its elements such ...
[{"input": "14\n1\n2\n1\n1\n2\n2 2\n2\n2 1\n2\n1 2\n2\n1 1\n3\n2 2 2\n3\n2 2 1\n3\n2 1 2\n3\n2 1 1\n3\n1 2 2\n3\n1 2 1\n3\n1 1 2\n3\n1 1 1\n", "output": "1\n1\n-1\n1\n1\n1\n1\n1\n2\n2\n1 2\n1\n1\n1\n1\n1\n1\n1\n1\n1\n2\n1\n2\n2\n1 2\n2\n1 2\n"}, {"input": "14\n1\n2\n1\n1\n2\n2 2\n2\n2 1\n2\n1 2\n2\n1 1\n3\n2 2 2\n3\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\nJump is a simple one-player game:\n\nYou are initially at the first cell of an array of cells containing non-...
[{"input": "[11, 6, 11, 0, 2, 1, 14, 3, 7, 6, 2, 1, 10, 6, 0, 0, 8, 10, 2, 12, 13, 11, 14, 6, 1, 4, 14, 3, 10, 4, 14, 2, 3, 10, 8, 13, 14, 8, 2, 13, 11, 14, 0, 1, 6, 2, 1, 6, 8, 2, 0, 12, 4, 9, 2, 6, 8, 14, 4, 14, 4, 10, 8, 7, 12, 11, 0, 3, 8, 0, 13, 9, 9, 11, 10, 13, 12, 1, 0, 10, 14, 6, 1, 11, 7, 8, 6, 2, 1, 3, 1, 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\nYou are given a sequence of positive integers a1, a2, ..., an. Find all such indices i, that the i-th element...
[{"input": "15\n1 1 1 1 1 1 1 1 1 1 1 1 1 1 1\n", "output": "15\n1 2 3 4 5 6 7 8 9 10 11 12 13 14 15\n"}, {"input": "10\n3 3 3 3 3 4 3 3 3 2\n", "output": "8\n1 2 3 4 5 7 8 9\n"}, {"input": "10\n15 7 10 7 7 7 4 4 7 2\n", "output": "5\n2 4 5 6 9\n"}, {"input": "15\n1 1 1 1 1 1 1 1 1 1 1 2 1 1 1\n", "output": "0\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\nSnark and Philip are preparing the problemset for the upcoming pre-qualification round for semi-quarter-final...
[{"input": "10 4\n1 0 1 0\n1 0 0 1\n1 1 0 1\n1 0 1 1\n1 1 0 1\n1 0 1 0\n0 0 0 0\n0 0 1 0\n1 0 1 0\n0 0 1 1\n", "output": "YES\n"}, {"input": "10 4\n1 0 1 0\n1 0 1 0\n0 1 1 1\n1 0 1 1\n1 1 0 1\n1 0 0 1\n0 1 1 1\n0 0 0 1\n1 1 1 1\n1 0 1 0\n", "output": "YES\n"}, {"input": "10 4\n0 0 1 1\n0 0 1 1\n0 0 1 1\n0 0 1 1\n0 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\nWrite a program which reads a sequence A of n elements and an integer M, and outputs \"yes\" if you can make ...
[{"input": "5\n-1 5 10 1 21\n8\n1 8 31 11 16 14 001 40", "output": "yes\nno\nyes\nyes\nyes\nyes\nyes\nno\n"}, {"input": "5\n1 5 13 3 21\n8\n0 4 17 11 22 21 010 42", "output": "yes\nyes\nyes\nno\nyes\nyes\nno\nyes\n"}, {"input": "5\n1 5 7 3 21\n8\n0 4 17 11 22 21 010 42", "output": "yes\nyes\nno\nyes\nyes\nyes\nyes\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\nCasimir has a rectangular piece of paper with a checkered field of size $n \\times m$. Initially, all cells o...
[{"input": "8\n2 3 1\n*.*\n...\n4 9 2\n*.*.*...*\n.*.*...*.\n..*.*.*..\n.....*...\n4 4 1\n*.*.\n****\n.**.\n....\n5 5 1\n.....\n*...*\n.*.*.\n..*.*\n...*.\n5 5 2\n.....\n*...*\n.*.*.\n..*.*\n...*.\n4 7 1\n*.....*\n.....*.\n..*.*..\n...*...\n3 3 1\n***\n***\n***\n3 5 1\n*...*\n.***.\n.**..\n", "output": "NO\nYES\nYES\nY...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nGildong is playing with his dog, Badugi. They're at a park that has $n$ intersections and $n-1$ bidirectional...
[{"input": "3\n3\n1 2\n2 3\n4\n1 2\n2 3\n3 4\n5\n1 2\n2 3\n3 4\n4 5\n3 6\n6 7\n5 13\n", "output": "2\n3\n4\n"}, {"input": "3\n3\n1 2\n2 3\n4\n1 2\n2 3\n3 4\n4\n1 2\n1 3\n3 4\n1 5\n3 8\n6 13\n5 8\n", "output": "2\n3\n2\n"}, {"input": "3\n3\n1 2\n2 3\n4\n1 2\n2 3\n3 4\n4\n1 2\n1 3\n3 4\n1 5\n3 8\n5 13\n5 8\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\nWe have a directed weighted graph with N vertices. Each vertex has two integers written on it, and the intege...
[{"input": "6\n43 35\n97 26\n77 48\n133 16\n110 5\n154 15", "output": "140\n"}, {"input": "6\n43 35\n97 26\n77 48\n133 31\n110 5\n154 15", "output": "155\n"}, {"input": "6\n43 35\n97 26\n77 48\n133 36\n110 5\n154 15", "output": "160\n"}, {"input": "6\n43 35\n97 26\n46 48\n133 40\n010 5\n55 20", "output": "136\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\nA bracket sequence is called regular if it is possible to obtain correct arithmetic expression by inserting c...
[{"input": "12\n(??)\n(??)\n(??)\n(??)\n(??)\n(??)\n(??)\n(??)\n(??)\n(??)\n(??)\n(??)\n", "output": "YES\nYES\nYES\nYES\nYES\nYES\nYES\nYES\nYES\nYES\nYES\nYES\n"}, {"input": "12\n(??)\n(??)\n(??)\n(??)\n(??)\n(??)\n(??)\n(??)\n(??)\n(??)\n(??)\n(??)\n", "output": "YES\nYES\nYES\nYES\nYES\nYES\nYES\nYES\nYES\nYES\nYES...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n# Task\n You are given a `moment` in time and space. What you must do is break it down into time and space, t...
[{"input": "\"12:30 am\"", "output": "[[false, false, true]]", "fn_name": "moment_of_time_in_space"}, {"input": "\"12:02 pm\"", "output": "[[false, true, false]]", "fn_name": "moment_of_time_in_space"}, {"input": "\"01:00 pm\"", "output": "[[true, false, false]]", "fn_name": "moment_of_time_in_space"}, {"input": "\"11:...
code_functional
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nA witch named Marie lived deep in a remote forest. Since she is a witch, she magically covers everything she ...
[{"input": "5 4\n1 2\n2 3\n3 4\n4 5\n4 6\n1 2\n1 3\n1 4\n2 4\n2 4\n3 4\n5 0\n0 0", "output": "yes\nno\nyes\n"}, {"input": "5 4\n1 2\n2 3\n3 4\n4 5\n7 6\n1 2\n1 3\n1 4\n2 4\n2 4\n3 4\n5 0\n0 0", "output": "yes\nno\nyes\n"}, {"input": "5 4\n1 2\n2 3\n3 4\n4 5\n4 6\n1 2\n1 3\n1 4\n2 4\n2 1\n3 4\n5 0\n0 0", "output": "yes\...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nYou are given the strings $a$ and $b$, consisting of lowercase Latin letters. You can do any number of the fo...
[{"input": "5\na\na\nabcd\nbc\nhello\ncodeforces\nhello\nhelo\ndhjakjsnasjhfksafasd\nadjsnasjhfksvdafdser\n", "output": "\n0\n2\n13\n3\n20\n"}, {"input": "5\na\na\nabcd\nbc\nhello\ncodeforces\nhello\nhelo\ndhjakjsnasjhfksafasd\nadjsnasjhfksvdafdser\n", "output": "0\n2\n13\n3\n20\n"}, {"input": "5\na\na\nabcc\nbc\nhello...
code_stdio
[ { "content": "You are an expert Python programmer. 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 flower shop has got n bouquets, and the i-th bouquet consists of a_{i} flowers. Vasya, the manager of the s...
[{"input": "25\n742168 377547 485672 437223 96307 902863 759104 747933 512899 410317 588598 666688 823202 257684 520631 910066 168864 71499 899972 565350 764848 754913 929040 864132 289976\n", "output": "10\n"}, {"input": "25\n742168 377547 485672 437223 96307 902863 759104 747933 512899 410317 588598 666688 823202 257...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nHeidi's friend Jenny is asking Heidi to deliver an important letter to one of their common friends. Since Jen...
[{"input": "11\n1 0 6646\n2 0 8816\n3 2 9375\n4 2 5950\n5 1 8702\n6 2 2657\n7 2 885\n8 7 2660\n9 2 5369\n10 6 3798\n", "output": "18191\n"}, {"input": "11\n1 0 6646\n2 0 8816\n3 2 9375\n4 2 5950\n5 1 8702\n6 2 2657\n7 2 885\n8 7 2660\n9 2 5369\n10 6 3798\n", "output": "18191\n"}, {"input": "11\n1 0 6646\n2 0 8816\n3 2 ...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nYou are given an array $a$ consisting of $n$ integers.\n\nYour task is to determine if $a$ has some subsequen...
[{"input": "15\n16\n1 1 1 1 1 1 1 1 1 1 1 1 5 12 12 14\n18\n12 14 12 15 17 16 11 5 15 15 7 15 15 14 16 16 11 11\n13\n4 9 11 7 13 9 10 1 3 7 12 5 9\n3\n3 2 2\n6\n6 3 2 2 3 1\n20\n2 2 4 4 5 5 5 5 5 5 5 5 5 5 6 8 10 12 12 17\n25\n1 1 6 10 8 8 9 10 14 16 16 16 16 16 16 16 16 16 16 16 16 18 21 21 23\n15\n6 1 5 3 15 10 14 15...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nAlice likes snow a lot! Unfortunately, this year's winter is already over, and she can't expect to have any m...
[{"input": "13\n1 1 1 1 1 1 1 1 1 1 1 1 1\n1 1 1 1 1 1 1 1 1 1 1 1 1\n", "output": "1 1 1 1 1 1 1 1 1 1 1 1 1\n"}, {"input": "13\n1 1 1 1 1 1 1 1 1 1 1 1 1\n1 1 1 1 1 1 1 1 1 1 1 1 1\n", "output": "1 1 1 1 1 1 1 1 1 1 1 1 1 "}, {"input": "13\n1 1 1 1 1 1 1 1 1 1 1 1 1\n1 1 1 1 1 1 2 1 1 1 1 1 1\n", "output": "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\n### Tongues\n\nGandalf's writings have long been available for study, but no one has yet figured out what lan...
[{"input": "\"0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789\"", "output": "[\"0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789\"]", "fn_name": "tongues"}, {"input": "\"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa...
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\nLuntik came out for a morning stroll and found an array $a$ of length $n$. He calculated the sum $s$ of the e...
[{"input": "5\n5\n1 2 3 4 1\n2\n1010 1000\n2\n1 0\n5\n3 -1 2 -1 1\n5\n2 1 0 3 0\n", "output": "2\n0\n2\n1\n4\n"}, {"input": "5\n5\n1 2 3 4 1\n2\n1001 1000\n2\n1 0\n5\n3 -1 2 -1 1\n5\n2 2 0 3 0\n", "output": "2\n0\n2\n1\n0\n"}, {"input": "5\n5\n1 2 3 4 1\n2\n1001 1000\n2\n1 0\n5\n3 -1 2 -1 2\n5\n2 2 0 3 0\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\nSnuke has N strings. The i-th string is s_i.\n\nLet us concatenate these strings into one string after arrang...
[{"input": "9\nBEWPVCRWH\nZQNZYIJX\nBAVREA\nPA\nHJMYITEOX\nBCJHMRMNK\nBP\nQVFABZ\nPRGKSPUNA", "output": "4\n"}, {"input": "9\nBEWPVCRWH\nZQNZYIJX\nAERVAB\nPA\nHJMYITEOX\nBCJHMRMNK\nBP\nQVFABZ\nPRGKSPUNA", "output": "4\n"}, {"input": "9\nBEWPVCRWH\nZQNZYIJX\nAERVAB\nPA\nHJMYITEOX\nBCJHMRMNK\nPB\nQVFABZ\nPRGKSPUNA", "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\nThere are N stones, numbered 1, 2, \\ldots, N. For each i (1 \\leq i \\leq N), the height of Stone i is h_i.\...
[{"input": "10 1\n65 19 34 219 208 10 13 13 39 118", "output": "563\n"}, {"input": "5 1\n40 19 34 219 155 10 13 11 80 118", "output": "285\n"}, {"input": "5 1\n40 19 34 219 208 10 13 11 20 118", "output": "232\n"}, {"input": "6 1\n40 10 34 219 155 10 20 11 80 118", "output": "448\n"}, {"input": "5 1\n40 18 34 219 155 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\nWrite a function called calculate that takes 3 values. The first and third values are numbers. The second val...
[{"input": "3.2\n\"+\"\n8", "output": "[11.2]", "fn_name": "calculate"}, {"input": "3.2\n\"-\"\n8", "output": "[-4.8]", "fn_name": "calculate"}, {"input": "3.2\n\"*\"\n8", "output": "[25.6]", "fn_name": "calculate"}, {"input": "3.2\n\"/\"\n8", "output": "[0.4]", "fn_name": "calculate"}, {"input": "-3\n\"/\"\n0", "outpu...
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\nEvery evening Vitalya sets n alarm clocks to wake up tomorrow. Every alarm clock rings during exactly one min...
[{"input": "100 40 20\n148 120 37 65 188 182 199 131 97 174 157 113 62 63 193 8 72 152 138 5 90 48 133 83 197 118 123 2 181 151 53 115 78 177 144 33 196 19 85 104 77 34 173 198 136 44 3 22 86 200 23 129 68 176 29 58 121 56 79 15 159 183 171 60 141 54 158 106 30 17 116 105 190 59 36 46 169 142 165 112 155 126 101 125 38...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nUjan decided to make a new wooden roof for the house. He has $n$ rectangular planks numbered from $1$ to $n$....
[{"input": "10\n1\n1\n2\n2 1\n3\n3 1 2\n3\n2 2 2\n4\n4 1 4 2\n5\n5 4 3 4 1\n5\n1 2 3 4 5\n6\n3 2 1 6 2 2\n10\n4 5 2 9 6 10 3 7 1 8\n10\n1 3 2 2 2 9 10 10 9 10\n", "output": "1\n1\n2\n2\n2\n3\n3\n2\n5\n5\n"}, {"input": "10\n1\n1\n2\n2 1\n3\n3 1 2\n3\n2 2 2\n4\n4 1 4 1\n5\n5 4 3 2 1\n5\n1 2 3 4 5\n6\n3 2 1 6 2 2\n10\n4 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\n\"Duel!\"\n\nBetting on the lovely princess Claris, the duel between Tokitsukaze and Quailty has started.\n\n...
[{"input": "30 27\n000000000010110000101111111111\n", "output": "tokitsukaze\n"}, {"input": "30 27\n100000000010110000101111111111\n", "output": "tokitsukaze\n"}, {"input": "30 16\n100000000010110000101111111111\n", "output": "once again\n"}, {"input": "30 7\n000000000010110000101111111111\n", "output": "once again\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\nThis time Baby Ehab will only cut and not stick. He starts with a piece of paper with an array a of length n ...
[{"input": "6 3\n2 3 10 12 5 14\n1 6\n2 4\n3 5\n", "output": "4\n2\n2\n"}, {"input": "6 3\n1 3 10 6 10 14\n1 6\n2 4\n3 5\n", "output": "4\n2\n3\n"}, {"input": "6 3\n1 5 10 6 10 14\n1 6\n2 4\n3 5\n", "output": "5\n3\n3\n"}, {"input": "6 3\n1 5 10 6 10 14\n1 6\n3 4\n3 5\n", "output": "5\n2\n3\n"}, {"input": "6 3\n1 5 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\nYour friend has n cards.\n\nYou know that each card has a lowercase English letter on one side and a digit on...
[{"input": "01234567890123456789012345678901234567890123456789\n", "output": "25\n"}, {"input": "qwertyuioplkjhgfdsazxcvbnmqwertyuioplkjhgfdsazxcvb\n", "output": "10\n"}, {"input": "kaq7jyialrfp4ilkni90eq8v3amcbygon7py0hb8z26fbl8ss1\n", "output": "13\n"}, {"input": "l3rw91a4m25l8iytxyeuixsegzcbm4h41ornf3pixkrmwznrzc\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 received a whatsup message from an unknown number. Could it be from that girl/boy with a foreign accent y...
[{"input": "\"Hallo, wie geht's dir?\"", "output": "[true]", "fn_name": "validate_hello"}, {"input": "\"hombre! Hola!\"", "output": "[true]", "fn_name": "validate_hello"}, {"input": "\"hallo, salut\"", "output": "[true]", "fn_name": "validate_hello"}, {"input": "\"ciao bella!\"", "output": "[true]", "fn_name": "validat...
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 we all know, Chef is cooking string for long days, his new discovery on string is the longest common patte...
[{"input": "4\nabcd\nxyz\nabcd\nbcda\nacba\nacaa\nCodechef\nelfedcc", "output": "0\n4\n3\n5\n"}, {"input": "4\nbdca\nxyz\nabcd\nbcda\nabca\nacaa\nCodechff\nelfedcc", "output": "0\n4\n3\n4\n"}, {"input": "4\nbdca\nyyz\nabdd\nbcda\nabca\nacaa\nCodechff\nelfedcc", "output": "0\n3\n3\n4\n"}, {"input": "4\nabcd\nxyz\nabcd\n...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nA few years ago Sajjad left his school and register to another one due to security reasons. Now he wishes to ...
[{"input": "120494\n", "output": "60246\n"}, {"input": "116591\n", "output": "58295\n"}, {"input": "110052\n", "output": "55025\n"}, {"input": "101000\n", "output": "50499\n"}, {"input": "150380\n", "output": "75189\n"}, {"input": "159531\n", "output": "79765\n"}, {"input": "175733\n", "output": "87866\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\nThis is a harder version of the problem. In this version $n \\le 500\\,000$\n\nThe outskirts of the capital a...
[{"input": "100\n82 51 81 14 37 17 78 92 64 15 8 86 89 8 87 77 66 10 15 12 100 25 92 47 21 78 20 63 13 49 41 36 41 79 16 87 87 69 3 76 80 60 100 49 70 59 72 8 38 71 45 97 71 14 76 54 81 4 59 46 39 29 92 3 49 22 53 99 59 52 74 31 92 43 42 23 44 9 82 47 7 40 12 9 3 55 37 85 46 22 84 52 98 41 21 77 63 17 62 91\n", "output...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nThis problem differs from one which was on the online contest.\n\nThe sequence a1, a2, ..., an is called incr...
[{"input": "83\n95 164 123 111 177 71 38 225 103 59 210 209 117 139 115 140 66 21 39 84 14 227 0 43 90 233 96 98 232 237 108 139 55 220 14 225 134 39 68 167 193 125 86 216 87 14 94 75 255 24 165 98 177 191 239 123 98 90 29 52 155 231 187 90 180 1 31 237 167 145 242 115 61 190 47 41 61 206 191 248 126 196 26\n49\n234 13...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nEleven wants to choose a new name for herself. As a bunch of geeks, her friends suggested an algorithm to cho...
[{"input": "1000\n", "output": "OOOoOooOooooOoooooooOooooooooooooOooooooooooooooooooooOoooooooooooooooooooooooooooooooooOooooooooooooooooooooooooooooooooooooooooooooooooooooooOooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooOooooooooooooooooooooooooooooooooooooooooooooooooooooooo...
code_stdio
[ { "content": "You are an expert Python programmer. 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 found a mysterious function f. The function takes two strings s1 and s2. These strings must consist only ...
[{"input": "tgharsjyihroiiahwgbjezlxvlterxivdhtzjcqegzmtigqmrehvhiyjeywegxaseoyoacouijudbiruoghgxvxadwzgdxtnxlds\ntghaksjsdhkoiiahegbjexlfrctercipdhmvjbgegxdtggqdpbhvhiseehhegnaseoooacnsijubbirjnghgsvpadhaadrtimfdp\n", "output": "tghaksjsdhkoiiahegbjexlfrctercipdhmvjbgegxdtggqdpbhvhiseehhegnaseoooacnsijubbirjnghgsvpadh...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSanta has $n$ candies and he wants to gift them to $k$ kids. He wants to divide as many candies as possible b...
[{"input": "5\n5 3\n19 4\n12 7\n10 2\n100001 44619\n", "output": "4\n18\n10\n10\n100001\n"}, {"input": "5\n5 3\n12 4\n12 7\n10 2\n100001 44619\n", "output": "4\n12\n10\n10\n100001\n"}, {"input": "5\n10 2\n1 11\n5 11\n11 1\n110001 90586\n", "output": "10\n1\n5\n11\n110001\n"}, {"input": "5\n10 2\n2 11\n5 11\n11 1\n11000...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nTakahashi and Aoki will play a game with a number line and some segments. Takahashi is standing on the number...
[{"input": "5\n-3 0\n-1 -1\n7 6\n18 11\n-2 -1", "output": "54\n"}, {"input": "5\n-3 0\n-1 -1\n7 8\n3 11\n-1 -1", "output": "24\n"}, {"input": "5\n-3 1\n-2 0\n7 8\n16 11\n-1 -1", "output": "48\n"}, {"input": "5\n-3 0\n-1 -1\n7 8\n9 11\n-1 -1", "output": "36\n"}, {"input": "5\n-3 0\n-1 -1\n7 6\n3 11\n-1 -1", "output": "2...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nThis is the hard version of the problem. The difference between the versions is that the hard version does re...
[{"input": "3\n14 1\n+--++---++-++-\n1 14\n14 3\n+--++---+++---\n1 14\n6 12\n1 10\n4 10\n+-+-\n1 2\n1 2\n1 2\n1 4\n2 2\n2 3\n2 4\n3 3\n3 4\n4 4\n", "output": "2\n1 2\n2\n1 9\n1\n9\n2\n1 2\n2\n1 2\n2\n1 2\n2\n1 2\n2\n1 3\n1\n2\n2\n2 3\n1\n3\n1\n3\n2\n3 4\n1\n4\n"}, {"input": "3\n14 1\n+--++---++-++-\n1 14\n14 3\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\nTaro and Hanako are playing card games. They have n cards each, and they compete n turns. At each turn Taro a...
[{"input": "3\nact dog\nfish fish\nlion tiger", "output": "1 7\n"}, {"input": "3\nact god\nfish fith\nlion tiger", "output": "0 9\n"}, {"input": "3\nuea goe\ndirh giuh\nnojk tiger", "output": "3 6\n"}, {"input": "3\nvea hpg\njrie giug\nnpjk rhget", "output": "6 3\n"}, {"input": "3\nv`f ggn\njrhd jgug\njnok ehrug", "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\nA Ministry for Defense sent a general to inspect the Super Secret Military Squad under the command of the Col...
[{"input": "100\n66 66 66 66 66 66 66 66 66 66 66 66 66 66 66 66 66 66 66 66 66 66 66 55 66 66 66 66 66 66 66 66 66 66 66 66 66 66 66 66 66 66 66 66 66 66 66 66 66 66 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 153 95 95 95\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\nAt first, let's define function $f(x)$ as follows: $$ \\begin{matrix} f(x) & = & \\left\\{ \\begin{matrix} \\...
[{"input": "1000000000000000000 1\n", "output": "1000000000000000000\n"}, {"input": "1000000000000000000 100\n", "output": "31249999999999998\n"}, {"input": "1000000000000000000 10000\n", "output": "244140624999998\n"}, {"input": "1000000000000000000 100000000\n", "output": "29802322386\n"}, {"input": "1000000000000000...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nArthur has bought a beautiful big table into his new flat. When he came home, Arthur noticed that the new tab...
[{"input": "30\n20 27 26 17 29 9 25 13 6 21 15 1 14 22 26 2 15 18 20 23 27 9 15 29 11 2 19 23 14 12\n133 199 22 151 9 134 196 119 197 189 117 84 156 6 61 195 98 197 145 75 142 85 187 24 159 3 60 138 156 161\n", "output": "2804\n"}, {"input": "30\n20 27 26 17 29 9 25 13 6 21 15 1 14 22 26 2 15 18 20 23 27 9 15 29 11 2 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\nOne player came to a casino and found a slot machine where everything depends only on how he plays. The rules...
[{"input": "66\n909090909090909090909090909090909909090909090909090909090909090909\n190909090909090909090909090909090090909090909090909090909090909091\n", "output": "9736\n33 -1\n32 1\n31 -1\n30 1\n29 -1\n28 1\n27 -1\n26 1\n25 -1\n24 1\n23 -1\n22 1\n21 -1\n20 1\n19 -1\n18 1\n17 -1\n16 1\n15 -1\n14 1\n13 -1\n12 1\n11 -1...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n-----Input-----\n\nThe input consists of a single string of uppercase letters A-Z. The length of the string i...
[{"input": "ALKALINITY\n", "output": "YES\n"}, {"input": "ALLALINITY\n", "output": "YES\n"}, {"input": "YTINILALLA\n", "output": "YES\n"}, {"input": "UNSCRAMBLE\n", "output": "NO\n"}, {"input": "ALKALINITY\n", "output": "YES"}, {"input": "TNSCRAMBLE\n", "output": "NO\n"}, {"input": "TNSARCMBLE\n", "output": "NO\n"}, {"...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nThere is one apple tree in Arkady's garden. It can be represented as a set of junctions connected with branch...
[{"input": "10\n1 1 2 4 2 4 1 8 8\n", "output": "1 1 1 1 1 1 2 2 3 6 \n"}, {"input": "10\n1 2 2 3 3 4 4 5 5\n", "output": "1 1 1 1 1 2 2 3 5 5 \n"}, {"input": "10\n1 1 1 1 1 1 1 1 1\n", "output": "1 1 1 1 1 1 1 1 1 9 \n"}, {"input": "10\n1 2 2 3 3 4 4 5 5\n", "output": "1 1 1 1 1 2 2 3 5 5 \n"}, {"input": "10\n1 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\nWhen provided with a String, capitalize all vowels\n\nFor example:\n\nInput : \"Hello World!\"\n\nOutput : \"...
[{"input": "\"HelloWorld!\"", "output": "[\"HEllOWOrld!\"]", "fn_name": "swap"}, {"input": "\"abracadabra\"", "output": "[\"AbrAcAdAbrA\"]", "fn_name": "swap"}, {"input": "\"Codewars\"", "output": "[\"COdEwArs\"]", "fn_name": "swap"}, {"input": "\"Sunday\"", "output": "[\"SUndAy\"]", "fn_name": "swap"}, {"input": "\"Mo...
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\nOnce Max found an electronic calculator from his grandfather Dovlet's chest. He noticed that the numbers were...
[{"input": "222145 353252\n", "output": "3860750\n"}, {"input": "222145 353252\n", "output": "3860750\n"}, {"input": "188883 353252\n", "output": "4803878\n"}, {"input": "188883 240204\n", "output": "1479377\n"}, {"input": "443 390308\n", "output": "10631342\n"}, {"input": "426 390308\n", "output": "10631576\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\nGray code is a form of binary encoding where transitions between consecutive numbers differ by only one bit. ...
[{"input": "[1, 0, 1, 0, 1, 0, 1, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 0, 1, 0, 1, 0]", "output": "[[1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 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\nYou've got another problem dealing with arrays. Let's consider an arbitrary sequence containing n (not necess...
[{"input": "100 4755\n5 4 3 5 1 2 5 1 1 3 5 4 4 1 1 1 1 5 4 4 5 1 5 5 1 2 1 3 1 5 1 3 3 3 2 2 2 1 1 5 1 3 4 1 1 3 2 5 2 2 5 5 4 4 1 3 4 3 3 4 5 3 3 3 1 2 1 4 2 4 4 1 5 1 3 5 5 5 5 3 4 4 3 1 2 5 2 3 5 4 2 4 5 3 2 4 2 4 3 1\n", "output": "3 3\n"}, {"input": "100 9043\n4 1 4 2 1 4 2 2 1 1 4 2 4 2 4 1 4 2 2 1 2 2 2 2 1 1 2...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nTakahashi wants to gain muscle, and decides to work out at AtCoder Gym.\nThe exercise machine at the gym has ...
[{"input": "5\n3\n-1\n4\n3\n4", "output": "-1\n"}, {"input": "5\n3\n3\n4\n2\n4\n", "output": "3\n"}, {"input": "5\n1\n3\n5\n2\n4", "output": "-1\n"}, {"input": "5\n1\n3\n5\n4\n4", "output": "-1\n"}, {"input": "5\n1\n3\n5\n2\n5", "output": "-1\n"}, {"input": "5\n3\n-1\n4\n2\n4", "output": "3\n"}, {"input": "5\n1\n3\n5\n...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nThere is a pond with a rectangular shape.\nThe pond is divided into a grid with H rows and W columns of squar...
[{"input": "100 100\noooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo\noooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo\nooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nHamed has recently found a string t and suddenly became quite fond of it. He spent several days trying to fin...
[{"input": "vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv\nvvvvvvvv\n", "output": "2728075\n"}, {"input": "vnssnssnssnssnssnssnssnssnssnssnssnssnssnssnssnssn\nnssnssns\n", "output": "943392\n"}, {"input": "kpjmawawawawawawawawawawawawawawawawawawawawawawaw\nwawawawa\n", "output": "834052\n"}, {"input": "vvvvvvvvvv...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nPolycarpus plays with red and blue marbles. He put n marbles from the left to the right in a row. As it turne...
[{"input": "1000000\n", "output": "986892583"}, {"input": "491526\n", "output": "913830480\n"}, {"input": "470705\n", "output": "732073783\n"}, {"input": "201682\n", "output": "291520502\n"}, {"input": "117284\n", "output": "184689149\n"}, {"input": "728546\n", "output": "731715891\n"}, {"input": "721975\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\nNuske has a grid with N rows and M columns of squares. The rows are numbered 1 through N from top to bottom, ...
[{"input": "5 5 6\n11010\n01110\n10111\n11111\n01010\n1 1 5 5\n1 2 4 5\n2 3 3 5\n3 3 3 2\n3 1 3 5\n1 1 3 4", "output": "-2\n-2\n0\n0\n2\n1\n"}, {"input": "5 5 6\n11010\n01110\n10111\n11111\n01010\n1 1 5 5\n1 2 4 5\n3 3 3 5\n3 3 3 2\n3 1 3 5\n1 1 3 4", "output": "-2\n-2\n1\n0\n2\n1\n"}, {"input": "5 5 6\n11010\n01110\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 grid with n rows and m columns, where each cell has a non-negative integer written on it. We ...
[{"input": "5\n3 4\n0 0 0 0\n0 1 0 0\n-1 0 0 0\n2 2\n3 0\n0 0\n2 2\n0 0\n0 0\n2 3\n-1 0 0\n0 0 0\n4 4\n0 0 0 -1\n0 2 0 2\n0 1 -1 0\n0 0 0 0\n", "output": "YES\n2 3 3 2\n3 4 4 3\n2 3 3 2\nNO\nYES\n2 2\n2 2\nYES\n2 3 2\n2 3 2\nYES\n2 3 3 2\n3 4 4 3\n3 4 4 3\n2 3 3 2\n"}, {"input": "5\n3 4\n0 0 0 0\n0 1 0 0\n-1 0 0 0\n2 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\nFor a positive integer X, let f(X) be the number of positive divisors of X.\nGiven a positive integer N, find...
[{"input": "10000000\n", "output": "838627288460105\n"}, {"input": "11001000", "output": "1020696029789074\n"}, {"input": "11000000", "output": "1020504841032058\n"}, {"input": "11001001", "output": "1020696117797082\n"}, {"input": "11001101", "output": "1020713851493884\n"}, {"input": "11001110", "output": "1020715369...
code_stdio
[ { "content": "You are an expert Python programmer. 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 wrote down two strings s of length n and t of length m consisting of small English letters 'a' and 'b'....
[{"input": "340\nbaa?b?abab??ab??aaabaa???bbbb??abaaaba?a?b?bb?ab?bbaa??aaaa???aaa?b???ba?a??b?bb?bbbabb?bb?a?a?bbbabbba?b?ababbb?b?a??bbb??bb?ababb?abbbbba??aabbaab?aaa??a???bbaa?bb?bb?babaa?bb?a???b?abbb???bb?a?a??b?b?abbba?b??a?bab??baa?aabaabb?abbbab?aa???bbaab?bbab?ba?aab?b?baabb???aaa??bb?ab?aa?aaa????babbbb???ba...
code_stdio
[ { "content": "You are an expert Python programmer. 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 string S, let f(S) be the lexicographically smallest cyclic shift of S. For example, if S = `babca`, f(...
[{"input": "7 32 3", "output": "abbbbbbbbabbbbbbbbacabbbbbbbbacabbbbbbbbac\n"}, {"input": "7 23 3", "output": "abbbbbacacacabbbbbbabbbbbbabbbbbb\n"}, {"input": "17 7 3", "output": "aabaacaacaacaababaababaabab\n"}, {"input": "13 7 3", "output": "aacababaacababaacababab\n"}, {"input": "7 12 3", "output": "abbbabbbacabbba...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nThree numbers A, B and C are the inputs. Write a program to find second largest among them.\n\n-----Input----...
[{"input": "3 \n120 14 400\n10213 312 10\n10 3 450", "output": "120\n312\n10\n"}, {"input": "3 \n117 14 384\n10213 312 10\n10 3 450", "output": "117\n312\n10\n"}, {"input": "3 \n178 14 384\n10213 312 10\n10 3 450", "output": "178\n312\n10\n"}, {"input": "3 \n303 14 384\n10213 312 10\n10 0 450", "output": "303\n312\n10\...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nA family consisting of father bear, mother bear and son bear owns three cars. Father bear can climb into the ...
[{"input": "100 99 98 97\n", "output": "196\n195\n98\n"}, {"input": "100 50 19 10\n", "output": "100\n50\n19\n"}, {"input": "100 50 19 25\n", "output": "100\n51\n25\n"}, {"input": "100 50 19 30\n", "output": "100\n61\n30\n"}, {"input": "99 98 50 97\n", "output": "196\n195\n97\n"}, {"input": "99 50 25 49\n", "output": "...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nEfim just received his grade for the last test. He studies in a special school and his grade can be equal to ...
[{"input": "320 142\n2704701300865535.432223312233434114130011113220102420131323010344144201124303144444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444447444444444444444444444444444444615444444482101673308979557675074444444444444446867245414595534444693160...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nJon Snow now has to fight with White Walkers. He has n rangers, each of which has his own strength. Also Jon ...
[{"input": "119 12 653\n877 938 872 962 590 500 422 249 141 163 609 452 594 768 316 530 838 945 658 636 997 938 941 272 102 8 713 862 572 809 301 462 282 478 12 544 157 204 367 789 136 251 754 43 349 355 560 325 463 659 666 644 992 603 799 597 364 234 903 377 896 92 971 308 617 712 480 772 170 68 318 947 741 568 63 483...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nYou are given an integer $N$ and a string consisting of '+' and digits. You are asked to transform the string...
[{"input": "2000\n0234++7890", "output": "3\n"}, {"input": "2000\n0987++4320", "output": "3\n"}, {"input": "2000\n0947++8320", "output": "3\n"}, {"input": "2000\n0947++3820", "output": "3\n"}, {"input": "2000\n0947++3028", "output": "3\n"}, {"input": "2000\n0947++3128", "output": "3\n"}, {"input": "2000\n09+74+3128", "...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nPrincess'Marriage\n\nMarriage of a princess\n\nEnglish text is not available in this practice contest.\n\nA b...
[{"input": "2 8\n7 6\n4 10\n3 2\n5 10\n3 10\n5 10\n0 0", "output": "18\n110\n"}, {"input": "2 8\n7 6\n4 10\n3 3\n5 10\n3 10\n5 10\n0 0", "output": "18\n100\n"}, {"input": "2 8\n5 6\n5 5\n3 3\n4 10\n13 10\n5 10\n0 0", "output": "10\n190\n"}, {"input": "2 8\n5 6\n5 5\n3 3\n3 10\n13 10\n5 10\n0 0", "output": "10\n180\n"},...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nIvan's classes at the university have just finished, and now he wants to go to the local CFK cafe and eat som...
[{"input": "100\n100\n100\n100\n100\n100\n100\n100\n100\n100\n100\n100\n100\n100\n100\n100\n100\n100\n100\n100\n100\n100\n100\n100\n100\n100\n100\n100\n100\n100\n100\n100\n100\n100\n100\n100\n100\n100\n100\n100\n100\n100\n100\n100\n100\n100\n100\n100\n100\n100\n100\n100\n100\n100\n100\n100\n100\n100\n100\n100\n100\n100...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nAlice has learnt factorization recently. Bob doesn't think she has learnt it properly and hence he has decide...
[{"input": "3\n3\n3 7 13\n3\n2 4 13\n2\n40 10", "output": "8\n8\n15\n"}, {"input": "3\n3\n3 7 13\n3\n2 4 13\n2\n40 12", "output": "8\n8\n24\n"}, {"input": "3\n3\n3 9 6\n3\n3 4 13\n2\n28 5", "output": "10\n12\n12\n"}, {"input": "3\n3\n6 5 14\n3\n2 12 6\n2\n8 6", "output": "24\n15\n10\n"}, {"input": "3\n3\n3 4 14\n3\n2 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\nYou are a *khm*mad*khm* scientist and you decided to play with electron distribution among atom's shells.\nYo...
[{"input": "61", "output": "[[2, 8, 18, 32, 1]]", "fn_name": "atomic_number"}, {"input": "47", "output": "[[2, 8, 18, 19]]", "fn_name": "atomic_number"}, {"input": "50", "output": "[[2, 8, 18, 22]]", "fn_name": "atomic_number"}, {"input": "52", "output": "[[2, 8, 18, 24]]", "fn_name": "atomic_number"}, {"input": "60", ...
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\nStylish is a programming language whose syntax comprises names, that are sequences of Latin alphabet letters,...
[{"input": "5 4\n(Folmow.my.style\n.........starting.from.round.brackets)\n{then.curly.brackets\n.....[.and.finally\n.......square.brackets.]}\n(Thank.you\n{for.showing.me\n[all\nthe.secrets]})\n4 2\n(This.time.I.will.show.you\n.........(how.to.use.round.brackets)\n.........[but.not.about.square.bsackets]\n.........{no...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nDuring the hypnosis session, Nicholas suddenly remembered a positive integer $n$, which doesn't contain zeros...
[{"input": "7\n3\n237\n5\n44444\n3\n337\n2\n35\n3\n773\n1\n4\n30\n626221626221626221626221626221\n", "output": "2\n27\n1\n4\n2\n33\n2\n35\n2\n77\n1\n4\n1\n6\n"}, {"input": "7\n3\n237\n5\n44444\n3\n337\n2\n35\n3\n773\n1\n8\n30\n626221626221626221626221626221\n", "output": "2\n27\n1\n4\n2\n33\n2\n35\n2\n77\n1\n8\n1\n6\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\nIT City company developing computer games invented a new way to reward its employees. After a new game releas...
[{"input": "2558402827158016680\n", "output": "1015239217126197\n"}, {"input": "1000000000000000000\n", "output": "396825396825396\n"}, {"input": "1209365011581446835\n", "output": "479906750627558\n"}, {"input": "1155798879255295086\n", "output": "458650348910831\n"}, {"input": "1000000000000001000\n", "output": "3968...
code_stdio
[ { "content": "You are an expert Python programmer. 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 {\\rm comb}(n,r) be the number of ways to choose r objects from among n objects, disregarding order.\nFro...
[{"input": "5\n20 13 1 4 20", "output": "20 13\n"}, {"input": "5\n36 13 1 8 10", "output": "36 13\n"}, {"input": "5\n36 13 1 8 17", "output": "36 17\n"}, {"input": "5\n1 10 -1 2 16", "output": "16 10\n"}, {"input": "5\n2 11 1 12 15", "output": "15 11\n"}, {"input": "5\n1 10 -1 2 24", "output": "24 10\n"}, {"input": "5\...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nMike has a string s consisting of only lowercase English letters. He wants to change exactly one character fr...
[{"input": "scfwrjevejrwfcs\n", "output": "YES\n"}, {"input": "thdaonpepdoadht\n", "output": "YES\n"}, {"input": "scfwrievejrwfcs\n", "output": "YES\n"}, {"input": "thdaodpepnoadht\n", "output": "YES\n"}, {"input": "jsfzcbnhsccuqsj\n", "output": "NO\n"}, {"input": "mhifbmmmmbmihm\n", "output": "YES\n"}, {"input": "cojh...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nWhen you play the game of thrones, you win, or you die. There is no middle ground.\n\nCersei Lannister, A Gam...
[{"input": "20 53\n1 2\n1 4\n1 5\n1 6\n1 7\n1 8\n1 20\n2 3\n2 6\n2 16\n2 17\n3 6\n3 18\n3 20\n4 6\n4 7\n4 8\n4 9\n4 14\n4 18\n5 11\n5 13\n5 17\n5 18\n5 19\n6 8\n6 13\n7 8\n7 10\n7 15\n7 17\n7 18\n8 15\n8 16\n9 10\n9 15\n10 11\n10 17\n10 20\n11 15\n11 16\n12 14\n12 15\n12 16\n12 19\n14 16\n14 19\n16 17\n16 19\n16 20\n17...
code_stdio
[ { "content": "You are an expert Python programmer. 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_1, a_2, \\dots, a_n$ consisting of $n$ integers.\n\nYou can choose any non-negati...
[{"input": "100\n49 100 2 100 49 49 49 100 2 100 49 49 49 100 2 100 49 49 49 100 2 100 49 49 49 100 2 100 49 49 49 100 2 100 49 49 49 100 2 100 49 49 49 100 2 100 49 49 49 100 2 100 49 49 49 100 2 100 49 49 49 100 2 100 49 49 49 100 2 100 49 49 49 100 2 100 49 49 49 100 2 100 49 49 49 100 2 100 49 49 49 100 2 100 49 49...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nPolycarp takes part in a quadcopter competition. According to the rules a flying robot should:\n\n start the...
[{"input": "-100 -100\n-100 100\n", "output": "406\n"}, {"input": "-100 -100\n100 -100\n", "output": "406\n"}, {"input": "100 -100\n-100 -100\n", "output": "406\n"}, {"input": "-100 100\n-100 -100\n", "output": "406\n"}, {"input": "-100 100\n-100 -192\n", "output": "590\n"}, {"input": "101 -100\n-100 -100\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\nGiven a string ``string`` that contains only letters, you have to find out the number of **unique** strings (...
[{"input": "\"ABcDEFgHIJbaslidbailsbdilasbdkanmsdklhkbHSJKHVDASHVVYQVWKDVDWQUV\"", "output": "[176478346352319876826993574633158714419916931040323433922560000000]", "fn_name": "uniq_count"}, {"input": "\"ABcDEFgHIJbaslidbailsbdilasbdkanmsdklhkbHSJKHVDASH\"", "output": "[34111429518116758488933545882757275627520000000]"...
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\nWoken up by the alarm clock Igor the financial analyst hurried up to the work. He ate his breakfast and sat i...
[{"input": "7 7\n.S.****\n...*.*.\n.****..\n.*.**.*\n..T*...\n***..*.\n**+****\n", "output": "YES\n"}, {"input": "7 7\n.S.****\n...*.*.\n.****..\n.*.**.*\n..T*...\n***..*.\n****+**\n", "output": "YES\n"}, {"input": "7 7\n.S.****\n...*.*.\n.****..\n.****..\n..T*...\n***..*.\n**+****\n", "output": "YES\n"}, {"input": "7 ...
code_stdio