messages
listlengths
1
1
ground_truth
stringlengths
88
726k
dataset
stringclasses
2 values
[ { "content": "Solve the following coding problem using the programming language python:\n\nWe all know that a superhero can transform to certain other superheroes. But not all Superheroes can transform to any other superhero. A superhero with name $s$ can transform to another superhero with name $t$ if $s$ can ...
[{"type": "stdin_stdout", "input": "eieoiiieaiuiiauieeuoueeoudljpjrpxdtqkrdfmhktpqrnkmyggywglpfpfmhrbaiioeuaieaouaoioaiuoiuueuaoouaeeoaaaueauueeiuaueuaeouiaaaieeaeiuouoiooauuoeauaiaoouuauuuuocqschpcxrxrgrcsjmwcbyfvtdxqtwha\naoeaoaoueieeioooiaooeoeoitvplxwkprykbhvxylcnxrhpgqclyjgfpzdpqwlcvouooeueoouieioeuouieoaaueuiiiae...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\n# Task\n\n**_Given_** a **_Divisor and a Bound_** , *Find the largest integer N* , Such That , \n\n# Conditions :\n\n* **_N_** is *divisible by divisor*\n\n* **_N_** is *less than or equal to bound* \n\n* **_N_** is *g...
[{"input": "37\n200", "output": "[185]", "fn_name": "max_multiple"}, {"input": "10\n50", "output": "[50]", "fn_name": "max_multiple"}, {"input": "7\n100", "output": "[98]", "fn_name": "max_multiple"}, {"input": "7\n17", "output": "[14]", "fn_name": "max_multiple"}, {"input": "3\n10", "output": "[9]", "fn_name": "max_mu...
code_functional
[ { "content": "Solve the following coding problem using the programming language python:\n\nPolycarp is flying in the airplane. Finally, it is his favorite time — the lunchtime. The BerAvia company stewardess is giving food consecutively to all the passengers from the 1-th one to the last one. Polycarp is sittin...
[{"type": "stdin_stdout", "input": "5\n\n3 3\n1 1 1\n0 0\n0 1\n\n3 3\n1 1 1\n1 0\n2 1\n\n3 3\n1 1 1\n1 0\n0 1\n\n3 3\n1 1 1\n0 0\n1 0\n\n3 3\n1 1 1\n0 0\n1 1\n", "output": "YYY\nYYN\nYYY\nYYY\nYYY\n"}, {"type": "stdin_stdout", "input": "5\n\n3 3\n1 1 1\n0 0\n0 1\n\n3 3\n1 1 1\n1 0\n2 1\n\n3 3\n1 1 1\n1 0\n0 1\n\n3 3\n1...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nToday's morning was exceptionally snowy. Meshanya decided to go outside and noticed a huge snowball rolling down the mountain! Luckily, there are two stones on that mountain.\n\nInitially, snowball is at height $h$ and it...
[{"type": "stdin_stdout", "input": "71 100\n56 44\n12 85\n", "output": "5053\n"}, {"type": "stdin_stdout", "input": "46 100\n36 81\n99 28\n", "output": "4961\n"}, {"type": "stdin_stdout", "input": "29 100\n30 51\n28 92\n", "output": "5021\n"}, {"type": "stdin_stdout", "input": "93 80\n13 49\n100 21\n", "output": "3220\...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nYou are given a set of n points on the plane. A line containing the origin is called good, if projection of the given set to this line forms a symmetric multiset of points. Find the total number of good lines.\n\nMultiset...
[{"type": "stdin_stdout", "input": "50\n-38 -107\n-34 -75\n-200 -143\n-222 -139\n-34 55\n-102 -79\n48 -99\n2 -237\n-118 -167\n-56 -41\n10 17\n68 -89\n-32 41\n-100 -93\n84 -1\n86 -15\n46 -145\n-58 -117\n8 31\n-36 -61\n-12 21\n-116 79\n88 -205\n70 -103\n-78 -37\n106 -5\n-96 -201\n-60 -103\n-54 45\n-138 -177\n-178 -47\n-1...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nYou are a teacher at a cram school for elementary school pupils.\n\nOne day, you showed your students how to calculate division of fraction in a class of mathematics. Your lesson was kind and fluent, and it seemed everyth...
[{"type": "stdin_stdout", "input": "2 6\n1 16\n3 9\n2 334\n34 79\n0 0", "output": "0 1\n4 0\n0 1\n0 166\n0 13\n"}, {"type": "stdin_stdout", "input": "3 8\n1 5\n3 10\n2 218\n36 198\n0 0", "output": "3 0\n1 0\n1 0\n0 108\n0 2\n"}, {"type": "stdin_stdout", "input": "2 6\n1 16\n3 15\n2 200\n34 62\n0 0", "output": "0 1\n4 0...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nYou are given positive integers A and B.\nFind the K-th largest positive integer that divides both A and B.\nThe input guarantees that there exists such a number.\n\n-----Constraints-----\n - All values in input are integ...
[{"type": "stdin_stdout", "input": "100 100 1\n", "output": "100\n"}, {"type": "stdin_stdout", "input": "100 50 4\n", "output": "5\n"}, {"type": "stdin_stdout", "input": "96 96 12\n", "output": "1\n"}, {"type": "stdin_stdout", "input": "60 60 11\n", "output": "2\n"}, {"type": "stdin_stdout", "input": "93 31 1\n", "outp...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nDreamoon has a string s and a pattern string p. He first removes exactly x characters from s obtaining string s' as a result. Then he calculates $\\operatorname{occ}(s^{\\prime}, p)$ that is defined as the maximal number ...
[{"type": "stdin_stdout", "input": "a\naaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nIn this Kata, you will be given a string and your task is to determine if that string can be a palindrome if we rotate one or more characters to the left.\n\n```Haskell\nsolve(\"4455\") = true, because after 1 rotation, w...
[{"input": "\"qponmlkjihgfeeiefghijklmnopqrsttsr\"", "output": "[false]", "fn_name": "solve"}, {"input": "\"432612345665\"", "output": "[false]", "fn_name": "solve"}, {"input": "\"223456776543\"", "output": "[true]", "fn_name": "solve"}, {"input": "\"zazcbaabc\"", "output": "[true]", "fn_name": "solve"}, {"input": "\"a...
code_functional
[ { "content": "Solve the following coding problem using the programming language python:\n\nLittle Nastya has a hobby, she likes to remove some letters from word, to obtain another word. But it turns out to be pretty hard for her, because she is too young. Therefore, her brother Sergey always helps her.\n\nSerge...
[{"type": "stdin_stdout", "input": "aaaaaaaadbaaabbbbbddaaabdadbbbbbdbbabbbabaabdbbdababbbddddbdaabbddbbbbabbbbbabadaadabaaaadbbabbbaddb\naaaaaaaaaaaaaa\n61 52 5 43 53 81 7 96 6 9 34 78 79 12 8 63 22 76 18 46 41 56 3 20 57 21 75 73 100 94 35 69 32 4 70 95 88 44 68 10 71 98 23 89 36 62 28 51 24 30 74 55 27 80 38 48 93 1...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\n## Task:\n\nYou have to write a function `pattern` which returns the following Pattern(See Examples) upto n number of rows. \n\n* Note:```Returning``` the pattern is not the same as ```Printing``` the pattern.\n\n### Rule...
[{"input": "27", "output": "[\"777777777777777777777777777\\n766666666666666666666666666\\n765555555555555555555555555\\n765444444444444444444444444\\n765433333333333333333333333\\n765432222222222222222222222\\n765432111111111111111111111\\n765432100000000000000000000\\n765432109999999999999999999\\n7654321098888888888...
code_functional
[ { "content": "Solve the following coding problem using the programming language python:\n\nEmuskald is an avid horticulturist and owns the world's longest greenhouse — it is effectively infinite in length.\n\nOver the years Emuskald has cultivated n plants in his greenhouse, of m different plant species numbere...
[{"type": "stdin_stdout", "input": "20 15\n6 8719.787178\n10 13066.663722\n15 58623.690996\n9 184321.819759\n3 227999.294560\n2 279836.330518\n9 282806.308675\n8 311056.507765\n1 312315.562927\n5 459200.373445\n14 563454.265947\n7 647364.984868\n13 679762.0281866578\n4 684192.647497\n1 733119.607626\n7 748637.778398\n1...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nThe Rebel fleet is afraid that the Empire might want to strike back again. Princess Heidi needs to know if it is possible to assign R Rebel spaceships to guard B bases so that every base has exactly one guardian and each ...
[{"type": "stdin_stdout", "input": "10 10\n8530 -3814\n-9330 -6035\n3951 -217\n-9276 8291\n636 -3118\n5024 -2403\n4601 7977\n-3620 -1428\n4954 -9632\n-9852 6553\n-3457 5430\n-8866 -7343\n1020 -5748\n5043 -3820\n-2832 1528\n-5058 -825\n2406 -3530\n9152 -7463\n-8547 7108\n2492 8953\n", "output": "Yes\n"}, {"type": "stdin...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nInput Format\n\n\nN K\na_1 a_2 a_3 ... a_N\n\n\nOutput Format\n\nPrint the minimum cost in one line. In the end put a line break.\n\n\nConstraints\n\n* 1 ≤ K ≤ N ≤ 15\n* 1 ≤ a_i ≤ 10^9\n\n\n\nScoring\n\nSubtask 1 [120 poi...
[{"type": "stdin_stdout", "input": "5 5\n11683 3774 3598 4173 3424", "output": "31773\n"}, {"type": "stdin_stdout", "input": "5 4\n11683 3774 3598 4173 3424", "output": "23510\n"}, {"type": "stdin_stdout", "input": "5 5\n3949 3208 13644 3469 3424", "output": "21140\n"}, {"type": "stdin_stdout", "input": "5 5\n4931 3208...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nMake a function that returns the value multiplied by 50 and increased by 6. If the value entered is a string it should return \"Error\".\n\nNote: in `C#`, you'll always get the input as a string, so the above applies if t...
[{"input": "\"RyanIsCool\"", "output": "[\"Error\"]", "fn_name": "problem"}, {"input": "\"hello\"", "output": "[\"Error\"]", "fn_name": "problem"}, {"input": "1.2", "output": "[66]", "fn_name": "problem"}, {"input": "5", "output": "[256]", "fn_name": "problem"}, {"input": "3", "output": "[156]", "fn_name": "problem"}, ...
code_functional
[ { "content": "Solve the following coding problem using the programming language python:\n\nImplement `String#parse_mana_cost`, which parses [Magic: the Gathering mana costs](http://mtgsalvation.gamepedia.com/Mana_cost) expressed as a string and returns a `Hash` with keys being kinds of mana, and values being th...
[{"input": "\"1wubrg\"", "output": "[{\"*\": 1, \"w\": 1, \"u\": 1, \"b\": 1, \"r\": 1, \"g\": 1}]", "fn_name": "parse_mana_cost"}, {"input": "\"3wubrg\"", "output": "[{\"*\": 3, \"w\": 1, \"u\": 1, \"b\": 1, \"r\": 1, \"g\": 1}]", "fn_name": "parse_mana_cost"}, {"input": "\"wwuubbrrgg\"", "output": "[{\"w\": 2, \"u\":...
code_functional
[ { "content": "Solve the following coding problem using the programming language python:\n\nConsider a table G of size n × m such that G(i, j) = GCD(i, j) for all 1 ≤ i ≤ n, 1 ≤ j ≤ m. GCD(a, b) is the greatest common divisor of numbers a and b.\n\nYou have a sequence of positive integer numbers a_1, a_2, ..., a...
[{"type": "stdin_stdout", "input": "1000000000000 1000000000000 116\n1587924000 7 2 3 4 5 6 1 56 9 10 1 12 13 2 105 16 1 18 1 620 3 14 1 24 25 26 27 4 203 30 1 32 3 2 5 252 1 2 39 40 1 6 7 4 45 2 1 48 1 350 93 52 1 54 5 8 21 58 1 60 1 2 9 224 65 6 1 4 3 10 7 72 1 2 75 4 1 546 1 80 81 62 1 12 35 2 87 8 1 90 13 28 3 2 5 ...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nFox Ciel saw a large field while she was on a bus. The field was a n × m rectangle divided into 1 × 1 cells. Some cells were wasteland, and other each cell contained crop plants: either carrots or kiwis or grapes. \n\nAft...
[{"type": "stdin_stdout", "input": "31 31 31 4\n15 26\n29 15\n17 31\n29 21\n21 3\n9 27\n19 20\n8 19\n5 4\n1 16\n6 17\n5 24\n1 4\n27 30\n16 24\n14 29\n24 31\n6 20\n2 20\n12 26\n26 15\n23 8\n29 10\n11 8\n3 7\n2 26\n15 10\n15 24\n6 10\n31 22\n12 2\n10 3\n6 24\n23 12\n19 1\n", "output": "Grapes\nCarrots\nCarrots\nCarrots\n...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nAn open-top box having a square bottom is placed on the floor. You see a number of needles vertically planted on its bottom.\n\nYou want to place a largest possible spheric balloon touching the box bottom, interfering wit...
[{"type": "stdin_stdout", "input": "5 12\n70 66 70\n0 52 20\n15 27 10\n78 45 10\n20 60 13\n1 100\n54 75 200\n1 10\n90 14 1\n1 11\n54 149 200\n3 10\n53 60 0\n61 38 1\n45 44 1\n4 10\n20 21 10\n20 80 10\n80 20 10\n140 80 10\n0 0", "output": "44.661667\n39.000000\n130.000000\n102.978551\n107.095894\n99.314575\n"}, {"type":...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nThere are $n$ people in this world, conveniently numbered $1$ through $n$. They are using burles to buy goods and services. Occasionally, a person might not have enough currency to buy what he wants or needs, so he borrow...
[{"type": "stdin_stdout", "input": "12 20\n1 3 1000000000\n3 2 1000000000\n1 4 1000000000\n4 2 1000000000\n1 5 1000000000\n5 2 1000000000\n1 6 1000000010\n6 2 1000000000\n1 7 1000000000\n7 2 1000000000\n1 8 1000000000\n8 4 1000000000\n1 9 1000000000\n9 2 1000000000\n1 10 1000000000\n10 2 1000000000\n1 11 1000000000\n11...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nTic-tac-toe is a game in which you win when you put ○ and × alternately in the 3 × 3 squares and line up ○ or × in one of the vertical, horizontal, and diagonal lines (Fig.). 1 to Fig. 3)\n\n<image> | <image> | <image>\n-...
[{"type": "stdin_stdout", "input": "ooosxssxs\nxooswsosx\nooxxxooxo", "output": "o\nd\nd\n"}, {"type": "stdin_stdout", "input": "oopsxssxs\nxooswsosx\noxooxxxoo", "output": "d\nd\nd\n"}, {"type": "stdin_stdout", "input": "oopsxrsxs\nxsoswsoox\nooooxxxox", "output": "d\nd\no\n"}, {"type": "stdin_stdout", "input": "xprmn...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nA new agent called Killjoy invented a virus COVID-2069 that infects accounts on Codeforces. Each account has a rating, described by an integer (it can possibly be negative or very large).\n\nKilljoy's account is already i...
[{"type": "stdin_stdout", "input": "7\n2 7\n7 1313\n2 14\n8 1211\n2 9\n12 121\n2 121\n121 312\n2 121\n136 121\n2 7\n1313 7\n2 8\n1211 8\n", "output": "1\n2\n2\n1\n1\n1\n1\n"}, {"type": "stdin_stdout", "input": "7\n2 7\n7 1313\n2 8\n8 1211\n2 9\n12 121\n2 121\n121 312\n2 121\n312 121\n2 7\n1313 7\n2 8\n1211 8\n", "outpu...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nYou are given a graph with 3 ⋅ n vertices and m edges. You are to find a matching of n edges, or an independent set of n vertices.\n\nA set of edges is called a matching if no two edges share an endpoint.\n\nA set of vert...
[{"type": "stdin_stdout", "input": "1\n8 39\n1 2\n3 4\n5 6\n7 8\n1 9\n3 10\n3 11\n5 12\n5 13\n10 14\n7 15\n9 4\n10 2\n11 2\n12 1\n13 3\n14 2\n15 2\n9 4\n10 4\n11 4\n12 4\n13 4\n14 4\n15 4\n14 6\n10 6\n11 6\n12 6\n13 6\n14 6\n15 6\n9 8\n7 8\n11 8\n12 14\n13 8\n14 8\n15 8\n", "output": "IndSet\n9 11 12 13 15 16 17 18\n"}...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nBizon the Champion isn't just charming, he also is very smart.\n\nWhile some of us were learning the multiplication table, Bizon the Champion had fun in his own manner. Bizon the Champion painted an n × m multiplication t...
[{"type": "stdin_stdout", "input": "500000 500000 250000000000\n", "output": "250000000000\n"}, {"type": "stdin_stdout", "input": "499997 499989 248758432143\n", "output": "225563648440\n"}, {"type": "stdin_stdout", "input": "499997 499989 248758432143\n", "output": "225563648440"}, {"type": "stdin_stdout", "input": "5...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nYou are given a string $s$, consisting of lowercase Latin letters. While there is at least one character in the string $s$ that is repeated at least twice, you perform the following operation:\n\nyou choose the index $i$ ...
[{"type": "stdin_stdout", "input": "1\naaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaabaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\n", "output": "ba\n"}, {"type": "stdin_stdout",...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nFrom tomorrow, the long-awaited summer vacation will begin. So I decided to invite my friends to go out to the sea.\n\nHowever, many of my friends are shy. They would hate it if they knew that too many people would come w...
[{"type": "stdin_stdout", "input": "5\n8 100001\n14 100001\n12 100000\n11 100001\n3 100001", "output": "0\n"}, {"type": "stdin_stdout", "input": "5\n8 100001\n14 100001\n13 100000\n11 100001\n3 100001", "output": "0\n"}, {"type": "stdin_stdout", "input": "5\n8 000001\n14 100001\n13 100000\n11 100001\n3 100001", "output...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nBob is a duck. He wants to get to Alice's nest, so that those two can duck! [Image] Duck is the ultimate animal! (Image courtesy of See Bang) \n\nThe journey can be represented as a straight line, consisting of $n$ segmen...
[{"type": "stdin_stdout", "input": "10\n324839129156 133475576222 1946579156099 185514358673 88712073883 243757012712 950854402304 21947060440 598567289966 674328002732\nGLLLLLLLLW\n", "output": "26365097587258\n"}, {"type": "stdin_stdout", "input": "10\n324839129156 133475576222 987711341463 185514358673 88712073883 2...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nRecently Polycarp started to develop a text editor that works only with correct bracket sequences (abbreviated as CBS). \n\nNote that a bracket sequence is correct if it is possible to get a correct mathematical expressio...
[{"type": "stdin_stdout", "input": "92 51 18\n(()(((()())(()())())())(()())()()()())((()()())(())(())(()((())()())())(())())((())()())()()\nLRLRLLLLRRRLLRRLDLRLRRLRDLDLDLDDRRLRRRLLRDRLDDRLRRD\n", "output": "(()()()()())((()()())(())(())(()((())()())())(())())((())()())()()\n"}, {"type": "stdin_stdout", "input": "86 11 ...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nA lot of people associate Logo programming language with turtle graphics. In this case the turtle moves along the straight line and accepts commands \"T\" (\"turn around\") and \"F\" (\"move 1 unit forward\").\n\nYou are ...
[{"type": "stdin_stdout", "input": "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF\n50\n", "output": "100\n"}, {"type": "stdin_stdout", "input": "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF\n40\n", "output": "...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nFox Ciel has some flowers: r red flowers, g green flowers and b blue flowers. She wants to use these flowers to make several bouquets. There are 4 types of bouquets:\n\n To make a \"red bouquet\", it needs 3 red flowers....
[{"type": "stdin_stdout", "input": "1000000000 1000000000 1000000000\n", "output": "1000000000\n"}, {"type": "stdin_stdout", "input": "1000000000 1000000000 1000000000\n", "output": "1000000000\n"}, {"type": "stdin_stdout", "input": "1000000000 1100000000 1000000000\n", "output": "1033333333\n"}, {"type": "stdin_stdout...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nLet A, B, C, D, E be sets of integers and let U is a universal set that includes all sets under consideration. All elements in any set are different (no repetitions).\n\nu - union of two sets, AuB = {x ∈ U : x ∈ A or x ∈ ...
[{"type": "stdin_stdout", "input": "A 3\n1 2 -1\nB 4\n4 0 0 11\nD 1\n5\nR 0\ncAiBdD\nC 3\n1 2 3\nA 4\n2 7 8 0\nB 3\n3 6 21\nR 0\n(As(AiB))uB", "output": "0 4 11\n0 2 3 6 7 8 21\n"}, {"type": "stdin_stdout", "input": "A 3\n2 3 -1\nB 4\n3 1 10 11\nD 1\n5\nR 0\ncAiBdD\nC 3\n1 2 3\nA 4\n2 10 8 3\nB 3\n2 4 7\nR 0\n(As(AiB))...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nValeric and Valerko missed the last Euro football game, so they decided to watch the game's key moments on the Net. They want to start watching as soon as possible but the connection speed is too low. If they turn on the ...
[{"type": "stdin_stdout", "input": "1000 1 1000\n", "output": "999000\n"}, {"type": "stdin_stdout", "input": "1286 123 1043\n", "output": "9862\n"}, {"type": "stdin_stdout", "input": "1286 187 1043\n", "output": "6130\n"}, {"type": "stdin_stdout", "input": "1705 812 917\n", "output": "1009\n"}, {"type": "stdin_stdout",...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nAs a token of his gratitude, Takahashi has decided to give his mother an integer sequence. The sequence A needs to satisfy the conditions below:\n\n* A consists of integers between X and Y (inclusive).\n* For each 1\\leq ...
[{"type": "stdin_stdout", "input": "15043200 358979323846264338", "output": "35\n"}, {"type": "stdin_stdout", "input": "12899738 158337027091717102", "output": "34\n"}, {"type": "stdin_stdout", "input": "12899738 686618920047839292", "output": "36\n"}, {"type": "stdin_stdout", "input": "1565492 1138463356571161467", "o...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nA monster is chasing after Rick and Morty on another planet. They're so frightened that sometimes they scream. More accurately, Rick screams at times b, b + a, b + 2a, b + 3a, ... and Morty screams at times d, d + c, d + ...
[{"type": "stdin_stdout", "input": "100 100\n100 100\n", "output": "100\n"}, {"type": "stdin_stdout", "input": "100 100\n100 100\n", "output": "100\n"}, {"type": "stdin_stdout", "input": "100 110\n100 100\n", "output": "-1\n"}, {"type": "stdin_stdout", "input": "87 22\n119 64\n", "output": "1849\n"}, {"type": "stdin_st...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nIt all started with a black-and-white picture, that can be represented as an $n \\times m$ matrix such that all its elements are either $0$ or $1$. The rows are numbered from $1$ to $n$, the columns are numbered from $1$ ...
[{"type": "stdin_stdout", "input": "6 4 7\n\n1010\n0001\n0001\n1000\n0111\n0101\n\n1010\n0001\n0001\n1000\n0111\n0101\n\n1010\n0001\n0001\n1000\n0111\n0101\n\n1010\n0001\n0001\n1000\n0111\n0101\n\n1010\n0001\n0001\n1000\n0111\n0101\n\n1010\n0001\n0001\n1000\n0111\n0101\n\n1010\n0001\n0001\n1000\n0111\n0101\n\n1010\n000...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nCreate a function that returns an array containing the first `l` digits from the `n`th diagonal of [Pascal's triangle](https://en.wikipedia.org/wiki/Pascal's_triangle).\n\n`n = 0` should generate the first diagonal of the...
[{"input": "4\n10", "output": "[[1, 5, 15, 35, 70, 126, 210, 330, 495, 715]]", "fn_name": "generate_diagonal"}, {"input": "100\n6", "output": "[[1, 101, 5151, 176851, 4598126, 96560646]]", "fn_name": "generate_diagonal"}, {"input": "3\n10", "output": "[[1, 4, 10, 20, 35, 56, 84, 120, 165, 220]]", "fn_name": "generate_d...
code_functional
[ { "content": "Solve the following coding problem using the programming language python:\n\nPolycarp is wondering about buying a new computer, which costs $c$ tugriks. To do this, he wants to get a job as a programmer in a big company.\n\nThere are $n$ positions in Polycarp's company, numbered starting from one....
[{"type": "stdin_stdout", "input": "3\n4 15\n1 3 20 11\n1 2 13\n4 100\n2 5 10 50\n3 26 12\n2 1000000000\n1 1\n1\n", "output": "5\n14\n1000000000\n"}, {"type": "stdin_stdout", "input": "3\n4 15\n1 6 20 11\n1 2 13\n4 100\n2 7 10 50\n3 26 12\n2 1000000000\n1 1\n1\n", "output": "5\n12\n1000000000\n"}, {"type": "stdin_stdou...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nThere is a binary string $a$ of length $n$. In one operation, you can select any prefix of $a$ with an equal number of $0$ and $1$ symbols. Then all symbols in the prefix are inverted: each $0$ becomes $1$ and each $1$ be...
[{"type": "stdin_stdout", "input": "5\n10\n0111010000\n0100101100\n4\n0000\n0000\n3\n000\n000\n12\n010101010101\n100110011010\n6\n000111\n110100\n", "output": "YES\nYES\nYES\nYES\nNO\n"}, {"type": "stdin_stdout", "input": "5\n10\n0101011000\n1001101000\n4\n0000\n0000\n3\n010\n100\n12\n010101010101\n100110011010\n6\n000...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nWrite a function that receives two strings and returns n, where n is equal to the number of characters we should shift the first string forward to match the second.\n\nFor instance, take the strings \"fatigue\" and \"tigu...
[{"input": "\"123456789!@#$%^&*( )qwerty\"\n\"9!@#$%^&*( )qwerty12345678\"", "output": "[18]", "fn_name": "shifted_diff"}, {"input": "\"doomhouse\"\n\"hoodmouse\"", "output": "[-1]", "fn_name": "shifted_diff"}, {"input": "\"fatigue\"\n\"tiguefa\"", "output": "[5]", "fn_name": "shifted_diff"}, {"input": "\"eecoff\"\n\"c...
code_functional
[ { "content": "Solve the following coding problem using the programming language python:\n\n## Task\nYou need to implement two functions, `xor` and `or`, that replicate the behaviour of their respective operators:\n\n- `xor` = Takes 2 values and returns `true` if, and only if, one of them is truthy.\n- `or` = Ta...
[{"input": "false\nfalse", "output": "[false]", "fn_name": "func_or"}, {"input": "true\nfalse", "output": "[true]", "fn_name": "func_or"}, {"input": "true\ntrue", "output": "[true]", "fn_name": "func_or"}, {"input": "null\n[]", "output": "[false]", "fn_name": "func_or"}, {"input": "0\n11", "output": "[true]", "fn_name"...
code_functional
[ { "content": "Solve the following coding problem using the programming language python:\n\nIn the capital city of Berland, Bertown, demonstrations are against the recent election of the King of Berland. Berland opposition, led by Mr. Ovalny, believes that the elections were not fair enough and wants to organize...
[{"type": "stdin_stdout", "input": "100 10\n9199\n89 409 428 408 309 400 259 393 212 273 472 654 533 774 663 484 695 801 587 518 521 578 767 644 532 785 500 944 582 680 899 882 589 601 614 633 877 543 770 614 852 715 932 627 639 658 765 957 898 545 977 751 740 869 885 831 834 702 934 954 500 626 605 921 755 661 707 952...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nA browser-based puzzle game called \"Bubble Puzzle\" is now popular on the Internet.\n\nThe puzzle is played on a 4 × 4 grid, and initially there are several bubbles in the grid squares. Each bubble has a state expressed ...
[{"type": "stdin_stdout", "input": "2 4 3 4\n2 1 2 4\n3 3 2 2\n0 3 3 3", "output": "-1\n"}, {"type": "stdin_stdout", "input": "2 4 3 4\n2 1 2 0\n3 3 2 2\n0 3 3 3", "output": "-1\n"}, {"type": "stdin_stdout", "input": "2 1 4 1\n2 2 4 2\n2 4 4 1\n0 4 4 1", "output": "-1\n"}, {"type": "stdin_stdout", "input": "2 4 3 3\n2 ...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nWrite\n\n```python\nfunction combine()\n```\n\nthat combines arrays by alternatingly taking elements passed to it.\n\nE.g\n\n```python\ncombine(['a', 'b', 'c'], [1, 2, 3]) == ['a', 1, 'b', 2, 'c', 3]\ncombine(['a', 'b', '...
[{"input": "[{\"a\": 2, \"b\": 1}, {\"a\": 1, \"b\": 2}]\n[1, 2, 3, 4]\n[5, 6]\n[7]", "output": "[[{\"a\": 2, \"b\": 1}, 1, 5, 7, {\"a\": 1, \"b\": 2}, 2, 6, 3, 4]]", "fn_name": "combine"}, {"input": "[\"a\", \"b\", \"c\"]\n[1, 2, 3, 4, 5]\n[6, 7]\n[8]", "output": "[[\"a\", 1, 6, 8, \"b\", 2, 7, \"c\", 3, 4, 5]]", "fn_...
code_functional
[ { "content": "Solve the following coding problem using the programming language python:\n\nIn Fire City, there are n intersections and m one-way roads. The i-th road goes from intersection a_i to b_i and has length l_i miles. \n\nThere are q cars that may only drive along those roads. The i-th car starts at int...
[{"type": "stdin_stdout", "input": "4 4\n1 2 0\n2 3 1\n3 1 2\n1 4 3\n3\n1 1 2\n1 2 1\n4 0 1\n", "output": "YES\nYES\nYES\n"}, {"type": "stdin_stdout", "input": "4 4\n1 2 1\n2 3 1\n3 1 2\n1 4 3\n3\n1 1 3\n1 2 4\n4 0 1\n", "output": "\nYES\nNO\nYES\n"}, {"type": "stdin_stdout", "input": "4 4\n1 2 1\n2 3 1\n3 1 2\n1 4 3\n...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nGiven a mixed array of number and string representations of integers, add up the string integers and subtract this from the total of the non-string integers. \n\nReturn as a number.\n\nWrite your solution by modifying thi...
[{"input": "[\"3\", 6, 6, 0, \"5\", 8, 5, \"6\", 2, \"0\"]", "output": "[13]", "fn_name": "div_con"}, {"input": "[8, 0, 0, 8, 5, 7, 2, 3, 7, 8, 6, 7]", "output": "[61]", "fn_name": "div_con"}, {"input": "[\"5\", \"0\", 9, 3, 2, 1, \"9\", 6, 7]", "output": "[14]", "fn_name": "div_con"}, {"input": "[\"1\", \"5\", \"8\", ...
code_functional
[ { "content": "Solve the following coding problem using the programming language python:\n\nThere is a circular pond with a perimeter of K meters, and N houses around them.\nThe i-th house is built at a distance of A_i meters from the northmost point of the pond, measured clockwise around the pond.\nWhen traveli...
[{"type": "stdin_stdout", "input": "20 3\n5 10 15\n", "output": "10\n"}, {"type": "stdin_stdout", "input": "37 3\n-1 0 91", "output": "-54\n"}, {"type": "stdin_stdout", "input": "10 3\n-2 9 50", "output": "-31\n"}, {"type": "stdin_stdout", "input": "10 3\n-2 5 50", "output": "-35\n"}, {"type": "stdin_stdout", "input": ...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nYour math teacher gave you the following problem:\n\nThere are $n$ segments on the $x$-axis, $[l_1; r_1], [l_2; r_2], \\ldots, [l_n; r_n]$. The segment $[l; r]$ includes the bounds, i.e. it is a set of such $x$ that $l \\...
[{"type": "stdin_stdout", "input": "1\n10\n132182352 630066892\n906984407 923129673\n100213482 882571434\n191064823 398771294\n243750814 1483105037\n322757488 608184251\n241900265 682732740\n197067927 815099563\n17475338 866870249\n271628366 729808874\n", "output": "508213113\n"}, {"type": "stdin_stdout", "input": "1\n...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nLet's denote a $k$-step ladder as the following structure: exactly $k + 2$ wooden planks, of which\n\n two planks of length at least $k+1$ — the base of the ladder; $k$ planks of length at least $1$ — the steps of the l...
[{"type": "stdin_stdout", "input": "4\n4\n1 12 1 3\n3\n1 3 1\n5\n2 1 3 1 2\n3\n1 1 2\n", "output": "2\n0\n1\n0\n"}, {"type": "stdin_stdout", "input": "4\n4\n1 12 1 3\n3\n1 3 1\n5\n2 1 3 4 2\n3\n1 1 2\n", "output": "2\n0\n2\n0\n"}, {"type": "stdin_stdout", "input": "4\n4\n1 3 1 3\n3\n3 3 2\n5\n2 3 3 4 2\n3\n1 1 2\n", "o...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nRead problems statements in Mandarin Chinese and Russian. \n\nChef wants to hire a new assistant. He published an advertisement regarding that in a newspaper. After seeing the advertisement, many candidates have applied ...
[{"type": "stdin_stdout", "input": "2\n109\n1", "output": "110\n1\n"}, {"type": "stdin_stdout", "input": "2\n185\n1", "output": "228\n1\n"}, {"type": "stdin_stdout", "input": "2\n15\n12", "output": "24\n28\n"}, {"type": "stdin_stdout", "input": "2\n208\n1", "output": "434\n1\n"}, {"type": "stdin_stdout", "input": "2\n7...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nYou have a fraction $\\frac{a}{b}$. You need to find the first occurrence of digit c into decimal notation of the fraction after decimal point.\n\n\n-----Input-----\n\nThe first contains three single positive integers a, ...
[{"type": "stdin_stdout", "input": "99999 100000 13\n", "output": "-1\n"}, {"type": "stdin_stdout", "input": "69168 84860 4\n", "output": "107\n"}, {"type": "stdin_stdout", "input": "25102 31579 2\n", "output": "174\n"}, {"type": "stdin_stdout", "input": "13805 15538 3\n", "output": "164\n"}, {"type": "stdin_stdout", "...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nOhana Matsumae is trying to clean a room, which is divided up into an n by n grid of squares. Each square is initially either clean or dirty. Ohana can sweep her broom over columns of the grid. Her broom is very strange: ...
[{"type": "stdin_stdout", "input": "20\n10101011101000011010\n11111010001100110101\n01011100010000001111\n10110100000101010011\n11010001110111101101\n00100110011011101010\n01000110101011001100\n01101100111101101101\n10111010010100111100\n00010010110001101110\n10111110010000101010\n10010111110100100100\n1101011100111111...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nChef recently saw the movie Matrix. He loved the movie overall but he didn't agree with some things in it. Particularly he didn't agree with the bald boy when he declared - There is no spoon. Being a chef, he understands ...
[{"type": "stdin_stdout", "input": "3\n3 6\nabDefb\nbSooon\nNIKHil\n6 6\naaaaaa\nssssst\nxuisdP\noooooo\nioowoo\nbdylan\n6 5\njhfdb\ncacac\nopqrs\nddddd\nindia\nyucky", "output": "There is indeed no spoon!\nThere is indeed no spoon!\nThere is indeed no spoon!\n"}, {"type": "stdin_stdout", "input": "3\n3 6\nbfeDba\nbnpo...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nThumbelina has had an accident. She has found herself on a little island in the middle of a swamp and wants to get to the shore very much.\n\nOne can get to the shore only by hills that are situated along a straight line ...
[{"type": "stdin_stdout", "input": "200 72 29\n201 145 169 163 32 126 131 71 26 130 2 61 110 17 179 114 79 30 192 91 141 70 101 119 185 66 72 76 164 144 106 162 122 146 119 181 184 61 131 131 140 152 60 65 183 154 32 33 108 77 29 102 67 5 125 26 126 104 20 89 183 21 126 195 198 24 123 173 135 164 141 32\n160 65 136 22 ...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nThe year of 2012 is coming...\n\nAccording to an ancient choradrican legend in this very year, in 2012, Diablo and his brothers Mephisto and Baal will escape from hell, and innumerable hordes of demons will enslave the hu...
[{"type": "stdin_stdout", "input": "22\nCleo likes Snowy\nCleo likes Troll\nChapay likes Dracul\nSnowy likes Troll\nDracul likes Chapay\nDracul likes Snowy\nChapay likes Cleo\nSnowy likes Chapay\nDracul likes Troll\nAnka likes Hexadecimal\nSnowy likes Anka\nHexadecimal likes Cleo\nHexadecimal likes Troll\nDracul likes ...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nAndrewid the Android is a galaxy-famous detective. He is now investigating the case of vandalism at the exhibition of contemporary art.\n\nThe main exhibit is a construction of n matryoshka dolls that can be nested one in...
[{"type": "stdin_stdout", "input": "100 19\n6 62 72 83 91 94 97\n3 61 84 99\n1 63\n5 46 53 56 69 78\n5 41 43 49 74 89\n5 55 57 79 85 87\n3 47 59 98\n3 64 76 82\n3 48 66 75\n2 60 88\n2 67 77\n4 40 51 73 95\n41 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 44 71 ...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nSunake is in the form of a polygonal line consisting of n vertices (without self-intersection). First, Sunake-kun's i-th vertex is at (xi, yi). You can move continuously by translating or rotating, but you cannot deform (...
[{"type": "stdin_stdout", "input": "11\n63 106\n87 143\n102 132\n115 169\n74 145\n41 177\n56 130\n28 102\n19 124\n0 156\n22 183", "output": "Impossible\n"}, {"type": "stdin_stdout", "input": "11\n63 106\n87 143\n102 132\n115 169\n74 145\n41 177\n56 130\n28 102\n19 124\n0 294\n22 183", "output": "Impossible\n"}, {"type"...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nIt's been a while since I played with A, B, and C. Mr. A and Mr. B became players, and Mr. C became a referee and played a badminton singles game. The rules decided by the three people are as follows.\n\n* 3 Play the game...
[{"type": "stdin_stdout", "input": "AABBAAABABAABBBAABA\nAABBBABBABBAAABABABAAB\nBABAABAABABABBAAAB\nAABABAAABBAABBBABAA\nAAAAAAAAAAA\nABBBBBBBBBB\n0", "output": "11 8\n10 12\n11 7\n11 8\n11 0\n0 11\n"}, {"type": "stdin_stdout", "input": "ABAABBBAABABAAABBAA\nAABBBABBABBAAABABABAAB\nBABAABAABABABBAAAB\nAABABAAABBAABBBA...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nMike and Ann are sitting in the classroom. The lesson is boring, so they decided to play an interesting game. Fortunately, all they need to play this game is a string $s$ and a number $k$ ($0 \\le k < |s|$).\n\nAt the beg...
[{"type": "stdin_stdout", "input": "wfyjbwcuxjrvmunfbrhethdmepeampvjcypavwoolteucetnqntytdfstvunnfyvngydjcohnwgtfddcnvuewxcafwureiupfeljqydwtickfbokoytlxtuwmvmvflemfvcksszlwgcwtamzovectkzxuzdtvbujyfpvcruvzvgglozwktwawcbkkwkookmuhjlcyjvfrnzmgpglvnbrujtbvtwrsqbulusfwzulxnadaqbijfrsvteqqoirfaolhfbgorxdwigwxcydbfxhvhqzjqir...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nChef has a nice complete binary tree in his garden. Complete means that each node has exactly two sons, so the tree is infinite. Yesterday he had enumerated the nodes of the tree in such a way: \n- Let's call the nodes' l...
[{"type": "stdin_stdout", "input": "4\nlrl\nrll\nr\nlllr\n\n", "output": "10\n14\n4\n13\n"}, {"type": "stdin_stdout", "input": "4\nrll\nrll\nr\nlllr", "output": "14\n14\n4\n13\n"}, {"type": "stdin_stdout", "input": "4\nlrl\nrll\nr\nrlll", "output": "10\n14\n4\n27\n"}, {"type": "stdin_stdout", "input": "4\nlrl\nrll\nr\n...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nYou are given an undirected graph with n vertices. There are no edge-simple cycles with the even length in it. In other words, there are no cycles of even length that pass each edge at most once. Let's enumerate vertices ...
[{"type": "stdin_stdout", "input": "12 12\n5 1\n5 11\n1 11\n8 11\n8 9\n5 12\n6 9\n7 11\n9 3\n9 10\n4 12\n10 2\n78\n1 1\n1 2\n1 3\n1 4\n1 5\n1 6\n1 7\n1 8\n1 9\n2 10\n1 11\n1 12\n2 2\n2 3\n2 4\n2 5\n2 6\n2 7\n2 8\n3 9\n2 10\n2 11\n2 12\n3 3\n3 4\n3 5\n3 6\n4 7\n3 8\n3 9\n3 10\n3 11\n3 12\n4 4\n4 5\n4 6\n4 7\n4 8\n4 10\n...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nAt many competitions that have a word «cup» in its official name the winner is presented with an actual cup. This time the organizers of one unusual programming competition have decided to please the winner even more and ...
[{"type": "stdin_stdout", "input": "QDpiNBmCRFWxpdbfGOzvvOcemjructoAdEwegTvbVbfWWRPGyEAxGdDRWVlqNyGWMWHMrHAIZpyxvgaflrsVZhhZRouvpxrKXFZa\n", "output": "5 20\nQDpiNBmCRFWxpdbfGOzv\nvOcemjructoAdEwegTvb\nVbfWWRPGyEAxGdDRWVlq\nNyGWMWHMrHAIZpyxvgaf\nlrsVZhhZRouvpxrKXFZa\n"}, {"type": "stdin_stdout", "input": "QDpiNBmCRFWxp...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\n# Task\n Pero has been into robotics recently, so he decided to make a robot that checks whether a deck of poker cards is complete.\n\n He’s already done a fair share of work - he wrote a programme that recognizes the sui...
[{"input": "\"P05P01P02P03P13P09P11P07K01P12K03K02K13K12K10K08H03H02H13H12H10H08T01T03T02T13T12T10T08P04K07H02T07H06T11K11T05K05H05H11\"", "output": "[[-1, -1, -1, -1]]", "fn_name": "cards_and_pero"}, {"input": "\"P01K02P03P11K09K10P13P10\"", "output": "[[8, 10, 13, 13]]", "fn_name": "cards_and_pero"}, {"input": "\"P01...
code_functional
[ { "content": "Solve the following coding problem using the programming language python:\n\nAlexey, a merry Berland entrant, got sick of the gray reality and he zealously wants to go to university. There are a lot of universities nowadays, so Alexey is getting lost in the diversity — he has not yet decided what ...
[{"type": "stdin_stdout", "input": "50\n69 6 6\n22 1 1\n23 3 3\n60 13 13\n13 3 3\n7 4 7\n6 1 1\n49 7 9\n68 8 8\n20 2 2\n34 1 1\n143 5 5\n22 1 1\n77 58 65\n10 3 3\n72 5 5\n47 1 1\n82 3 3\n92 8 8\n34 1 1\n42 9 10\n63 14 14\n10 3 3\n38 2 2\n80 6 6\n79 5 5\n53 5 5\n44 7 7\n85 2 2\n24 2 2\n57 3 3\n95 29 145\n77 6 6\n24 1 1\...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nproblem\n\nAOR Ika is studying to pass the test.\n\nAOR Ika-chan solved the $ N $ question. After that, round the solved problem according to the following procedure.\n\n1. Check the correctness of the answer.\n2. If the ...
[{"type": "stdin_stdout", "input": "3\nnxx", "output": "2\n"}, {"type": "stdin_stdout", "input": "3\nnwx", "output": "3\n"}, {"type": "stdin_stdout", "input": "3\nxxo", "output": "1\n"}, {"type": "stdin_stdout", "input": "3\nxwn", "output": "3\n"}, {"type": "stdin_stdout", "input": "3\nowx", "output": "3\n"}, {"type": ...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nA bracket sequence is called regular if it is possible to obtain correct arithmetic expression by inserting characters «+» and «1» into this sequence. For example, sequences «(())()», «()» and «(()(()))» are regular, whil...
[{"type": "stdin_stdout", "input": "))())))))))())))))()()))()()))))())))))()))))))))))))(()))())(()))))(()))))())))((((()()))))()))()))\n", "output": "48\n"}, {"type": "stdin_stdout", "input": ")))()))()))))()((((())))()))))(()))))(())()))(()))))))))))))())))))()))))()()))()())))))())))))))())\n", "output": "48\n"}, {...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nFox Ciel is playing a card game with her friend Jiro.\n\nJiro has n cards, each one has two attributes: position (Attack or Defense) and strength. Fox Ciel has m cards, each one has these two attributes too. It's known th...
[{"type": "stdin_stdout", "input": "36 30\nATK 116\nATK 120\nATK 122\nATK 120\nATK 116\nATK 118\nATK 123\nDEF 2564\nATK 123\nDEF 1810\nATK 124\nATK 120\nDEF 2598\nATK 119\nDEF 2103\nATK 123\nATK 118\nATK 118\nATK 123\nDEF 1988\nATK 122\nATK 120\nDEF 2494\nATK 122\nATK 124\nATK 117\nATK 121\nATK 118\nATK 117\nATK 122\nA...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\n## Task:\n\nYou have to write a function **pattern** which returns the following Pattern(See Examples) upto (2n-1) rows, where n is parameter.\n\n### Rules/Note:\n* If the Argument is 0 or a Negative Integer then it shoul...
[{"input": "7", "output": "[\" 1 \\n 121 \\n 12321 \\n 1234321 \\n 123454321 \\n 12345654321 \\n1234567654321\\n 12345654321 \\n 123454321 \\n 1234321 \\n 12321 \\n 121 \\n 1 \"]", "fn_name": "pattern"}, {"input": "3", "output": "[\" 1 \\n 121 \\n12321\\n 12...
code_functional
[ { "content": "Solve the following coding problem using the programming language python:\n\nThere is a frog staying to the left of the string $s = s_1 s_2 \\ldots s_n$ consisting of $n$ characters (to be more precise, the frog initially stays at the cell $0$). Each character of $s$ is either 'L' or 'R'. It means...
[{"type": "stdin_stdout", "input": "6\nLRLRRLL\nL\nLLR\nRRRR\nLLLLLL\nR\n", "output": "3\n2\n3\n1\n7\n1\n"}, {"type": "stdin_stdout", "input": "6\nRRLRLLL\nL\nLLR\nRRRR\nLLLLLL\nR\n", "output": "4\n2\n3\n1\n7\n1\n"}, {"type": "stdin_stdout", "input": "6\nMRLRRLL\nL\nLLR\nRRRR\nLLLLLL\nR\n", "output": "3\n2\n3\n1\n7\n1\...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nToday in the scientific lyceum of the Kingdom of Kremland, there was a biology lesson. The topic of the lesson was the genomes. Let's call the genome the string \"ACTG\".\n\nMaxim was very boring to sit in class, so the t...
[{"type": "stdin_stdout", "input": "50\nROWGGKNUITVHOBMKZXOZNBZMQGSFERNCZDFKLRBCFVVDXJEFLP\n", "output": "13\n"}, {"type": "stdin_stdout", "input": "50\nALWLSFLXYPQYMIWXMYMXFYMIVFYJDTJAIGVOAUDAIIAHKNNVTX\n", "output": "13\n"}, {"type": "stdin_stdout", "input": "50\nHKKUWHLYYKBLLEHKVNIRYAPVFTAPRIFUZELKGRDXZNCNWHSAFG\n",...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nYour task is very simple. Just write a function `isAlphabetic(s)`, which takes an input string `s` in lowercase and returns `true`/`false` depending on whether the string is in alphabetical order or not.\n\nFor example, `...
[{"input": "\"codewars\"", "output": "[false]", "fn_name": "alphabetic"}, {"input": "\"asd\"", "output": "[false]", "fn_name": "alphabetic"}, {"input": "\"door\"", "output": "[true]", "fn_name": "alphabetic"}, {"input": "\"cell\"", "output": "[true]", "fn_name": "alphabetic"}, {"input": "\"z\"", "output": "[true]", "fn...
code_functional
[ { "content": "Solve the following coding problem using the programming language python:\n\nYou wrote down all integers from $0$ to $10^n - 1$, padding them with leading zeroes so their lengths are exactly $n$. For example, if $n = 3$ then you wrote out 000, 001, ..., 998, 999.\n\nA block in an integer $x$ is a ...
[{"type": "stdin_stdout", "input": "2352\n", "output": "388795058 433322746 541969001 523323201 867893102 537695799 837561050 990678065 688882179 577079614 937069914 960273782 761665782 282484628 787581089 314410468 983373531 353249698 130693309 82500826 144964998 247781749 108001361 947489703 358119467 770902487 73956...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nYaroslav thinks that two strings s and w, consisting of digits and having length n are non-comparable if there are two numbers, i and j (1 ≤ i, j ≤ n), such that s_{i} > w_{i} and s_{j} < w_{j}. Here sign s_{i} represents...
[{"type": "stdin_stdout", "input": "10\n?8?528?91?\n1???60??54\n", "output": "1000000000\n"}, {"type": "stdin_stdout", "input": "10\n?8?258?91?\n1???60??54\n", "output": "1000000000\n"}, {"type": "stdin_stdout", "input": "10\n0????19?01\n????164759\n", "output": "1000000000\n"}, {"type": "stdin_stdout", "input": "10\n2...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nYou are an immigration officer in the Kingdom of AtCoder. The document carried by an immigrant has some number of integers written on it, and you need to check whether they meet certain criteria.\nAccording to the regulat...
[{"type": "stdin_stdout", "input": "100\n768 125 109 300 471 697 999 760 529 42 373 15 59 387 75 823 850 330 756 661 700 610 99 156 367 481 720 588 477 65 513 600 569 531 970 97 456 223 963 625 823 612 421 633 774 529 190 835 245 263 861 456 893 293 762 270 955 457 65 941 787 700 617 813 550 70 807 217 683 935 732 320 ...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nNearly each project of the F company has a whole team of developers working on it. They often are in different rooms of the office in different cities and even countries. To keep in touch and track the results of the proj...
[{"type": "stdin_stdout", "input": "100 5\n- 60\n- 58\n+ 25\n- 32\n+ 86\n", "output": "95\n1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 26 27 28 29 30 31 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 59 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 8...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nYou are given $n$ integers $a_1, a_2, \\ldots, a_n$. You choose any subset of the given numbers (possibly, none or all numbers) and negate these numbers (i. e. change $x \\to (-x)$). What is the maximum number of differen...
[{"type": "stdin_stdout", "input": "1\n30\n1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30\n", "output": "30\n"}, {"type": "stdin_stdout", "input": "4\n3\n100 -100 100\n4\n100 0 0 0\n5\n0 0 0 0 0\n7\n100 3 -2 0 -100 4 5\n", "output": "2\n2\n1\n7\n"}, {"type": "stdin_stdout", "input": "3...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nThere is a 120 minute videotape with standard recording. When I set the VCR counter to 00:00:00 with the tape completely rewound and recorded in standard recording mode, I got a certain counter value. Enter this counter v...
[{"type": "stdin_stdout", "input": "1 36 0\n-1 -1 -1", "output": "00:24:00\n01:12:00\n"}, {"type": "stdin_stdout", "input": "0 30 0\n-1 -1 -1", "output": "01:30:00\n04:30:00\n"}, {"type": "stdin_stdout", "input": "0 32 0\n-1 -1 -1", "output": "01:28:00\n04:24:00\n"}, {"type": "stdin_stdout", "input": "1 16 0\n-1 -1 -1"...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nThe zombies are gathering in their secret lair! Heidi will strike hard to destroy them once and for all. But there is a little problem... Before she can strike, she needs to know where the lair is. And the intel she has i...
[{"type": "stdin_stdout", "input": "10\n0000000000\n0000000000\n0000000000\n0000000000\n0000000000\n0000000000\n0012100000\n0024200000\n0012100000\n0000000000\n", "output": "Yes\n"}, {"type": "stdin_stdout", "input": "10\n0000000000\n0122210000\n0244420100\n0122210000\n0000000000\n0000000000\n0000000000\n0000000000\n00...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nThe start of the new academic year brought about the problem of accommodation students into dormitories. One of such dormitories has a a × b square meter wonder room. The caretaker wants to accommodate exactly n students ...
[{"type": "stdin_stdout", "input": "1000000000 1000000000 1000000000\n", "output": "1000000000000000000\n1000000000 1000000000\n"}, {"type": "stdin_stdout", "input": "1000000000 1000000000 1000000000\n", "output": "1000000000000000000\n1000000000 1000000000\n"}, {"type": "stdin_stdout", "input": "1000001000 1000000000 ...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nN programmers are going to participate in the preliminary stage of DDCC 20XX. Due to the size of the venue, however, at most 9 contestants can participate in the finals.\n\nThe preliminary stage consists of several rounds...
[{"type": "stdin_stdout", "input": "3\n1 0\n0 10\n7 2", "output": "12\n"}, {"type": "stdin_stdout", "input": "3\n1 0\n0 17\n7 2", "output": "19\n"}, {"type": "stdin_stdout", "input": "3\n1 1\n0 17\n7 2", "output": "20\n"}, {"type": "stdin_stdout", "input": "3\n1 0\n0 27\n7 2", "output": "29\n"}, {"type": "stdin_stdout"...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nThere are n points on the plane, the i-th of which is at (x_i, y_i). Tokitsukaze wants to draw a strange rectangular area and pick all the points in the area.\n\nThe strange area is enclosed by three lines, x = l, y = a a...
[{"type": "stdin_stdout", "input": "35\n8 1\n6 8\n4 1\n1 2\n1 4\n5 10\n10 8\n9 1\n9 9\n10 2\n6 5\n8 8\n7 6\n10 6\n9 4\n4 9\n3 2\n1 8\n3 9\n7 3\n3 7\n2 7\n3 8\n3 1\n2 2\n5 5\n7 2\n4 10\n6 3\n5 1\n8 10\n4 3\n9 8\n9 7\n3 10\n", "output": "316"}, {"type": "stdin_stdout", "input": "35\n4 2\n9 6\n3 10\n2 5\n7 9\n6 9\n10 7\n6...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nThere are N towns in the State of Atcoder, connected by M bidirectional roads.\nThe i-th road connects Town A_i and B_i and has a length of C_i.\nJoisino is visiting R towns in the state, r_1,r_2,..,r_R (not necessarily i...
[{"type": "stdin_stdout", "input": "4 6 3\n2 3 4\n1 2 4\n2 3 3\n4 3 1\n1 4 1\n4 2 2\n3 1 6\n", "output": "3\n"}, {"type": "stdin_stdout", "input": "4 6 3\n2 3 4\n1 2 4\n2 3 6\n4 3 1\n1 4 1\n4 2 2\n3 1 6", "output": "3\n"}, {"type": "stdin_stdout", "input": "4 6 3\n2 3 4\n1 2 4\n2 3 6\n4 3 1\n1 4 1\n4 1 2\n3 1 6", "outp...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nThere is a given sequence of integers a1, a2, ..., an, where every number is from 1 to 3 inclusively. You have to replace the minimum number of numbers in it so that all the numbers in the sequence are equal to each other...
[{"type": "stdin_stdout", "input": "30\n2 1 3 2 3 2 2 2 2 3 2 2 3 2 1 1 3 1 3 2 1 2 3 1 1 3 3 1 3 1\n", "output": "19\n"}, {"type": "stdin_stdout", "input": "30\n2 1 3 2 3 2 2 2 2 3 2 2 1 2 1 1 3 1 3 2 1 2 3 1 1 3 3 1 3 1\n", "output": "19\n"}, {"type": "stdin_stdout", "input": "30\n2 1 3 2 3 2 2 2 2 3 2 2 1 2 1 1 3 1 ...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nA very easy task for you!\n\nYou have to create a method, that corrects a given date string.\nThere was a problem in addition, so many of the date strings are broken.\nDate-Format is european. That means \"DD.MM.YYYY\".\n...
[{"input": "\"03.12.2016\"", "output": "[\"03.12.2016\"]", "fn_name": "date_correct"}, {"input": "\"30.02.2016\"", "output": "[\"01.03.2016\"]", "fn_name": "date_correct"}, {"input": "\"40.06.2015\"", "output": "[\"10.07.2015\"]", "fn_name": "date_correct"}, {"input": "\"11.13.2014\"", "output": "[\"11.01.2015\"]", "fn...
code_functional
[ { "content": "Solve the following coding problem using the programming language python:\n\nNowadays it is becoming increasingly difficult to park a car in cities successfully. Let's imagine a segment of a street as long as L meters along which a parking lot is located. Drivers should park their cars strictly pa...
[{"type": "stdin_stdout", "input": "50 3 1\n30\n1 9\n2 1\n1 6\n1 5\n1 8\n1 1\n2 6\n1 7\n2 3\n2 8\n1 7\n2 4\n2 5\n2 11\n1 2\n2 15\n1 6\n1 3\n2 17\n1 9\n1 3\n2 18\n1 3\n2 23\n2 21\n1 8\n1 2\n2 27\n1 8\n2 29\n", "output": "0\n0\n9\n17\n28\n28\n0\n0\n0\n9\n15\n0\n6\n0\n11\n27\n"}, {"type": "stdin_stdout", "input": "50 3 2\...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nKarl is developing a key storage service. Each user has a positive integer key.\n\nKarl knows that storing keys in plain text is bad practice. So, instead of storing a key, he decided to store a fingerprint of a key. Howe...
[{"type": "stdin_stdout", "input": "100\n1\n3\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n14\n22\n23\n24\n25\n26\n27\n28\n29\n30\n31\n32\n33\n34\n35\n36\n37\n38\n39\n40\n19\n42\n43\n44\n45\n46\n47\n20\n49\n50\n65\n52\n53\n54\n55\n56\n57\n58\n59\n60\n61\n62\n63\n64\n65\n66\n67\n68\n69\n70\n71\n72\n...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nAndrey needs one more problem to conduct a programming contest. He has n friends who are always willing to help. He can ask some of them to come up with a contest problem. Andrey knows one value for each of his fiends — t...
[{"type": "stdin_stdout", "input": "100\n0.01 0.01 0.01 0.01 0.01 0.01 0.01 0.01 0.01 0.01 0.01 0.01 0.8612181095398133 0.01 0.01 0.01 0.01 0.01 0.01 0.01 0.01 0.01 0.01 0.01 0.01 0.01 0.01 0.01 0.01 0.01 0.01 0.01 0.01 0.01 0.01 0.01 0.01 0.01 0.01 0.01 0.01 0.01 0.01 0.01 0.01 0.01 0.01 0.01 0.01 0.01 0.01 0.01 0.01 ...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nKolya is going to make fresh orange juice. He has n oranges of sizes a_1, a_2, ..., a_{n}. Kolya will put them in the juicer in the fixed order, starting with orange of size a_1, then orange of size a_2 and so on. To be p...
[{"type": "stdin_stdout", "input": "100 1000 1083\n992 616 818 359 609 783 263 989 501 929 362 394 919 1081 870 830 1097 975 62 346 531 367 323 457 707 360 949 334 867 116 478 417 961 963 1029 114 867 1008 988 916 983 1077 959 1322 572 961 579 318 721 337 488 717 111 70 416 685 987 130 353 107 61 191 827 849 106 815 21...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nVasya studies divisibility rules at school. Here are some of them:\n\n * Divisibility by 2. A number is divisible by 2 if and only if its last digit is divisible by 2 or in other words, is even.\n * Divisibility by 3. A...
[{"type": "stdin_stdout", "input": "30 100\n", "output": "2-type\n2\n"}, {"type": "stdin_stdout", "input": "10 100\n", "output": "2-type\n2\n"}, {"type": "stdin_stdout", "input": "10 25\n", "output": "2-type\n2\n"}, {"type": "stdin_stdout", "input": "70 14\n", "output": "2-type\n1\n"}, {"type": "stdin_stdout", "input":...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nYou are standing on the $\\mathit{OX}$-axis at point $0$ and you want to move to an integer point $x > 0$.\n\nYou can make several jumps. Suppose you're currently at point $y$ ($y$ may be negative) and jump for the $k$-th...
[{"type": "stdin_stdout", "input": "12\n1\n2\n3\n4\n5\n1\n2\n3\n4\n5\n1\n2\n", "output": "1\n3\n2\n3\n4\n1\n3\n2\n3\n4\n1\n3\n"}, {"type": "stdin_stdout", "input": "12\n1\n2\n3\n4\n5\n1\n2\n3\n4\n5\n1\n2\n", "output": "1\n3\n2\n3\n4\n1\n3\n2\n3\n4\n1\n3\n"}, {"type": "stdin_stdout", "input": "12\n1\n2\n3\n4\n5\n2\n2\n3...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nwrite me a function `stringy` that takes a `size` and returns a `string` of alternating `'1s'` and `'0s'`.\n\nthe string should start with a `1`.\n\na string with `size` 6 should return :`'101010'`.\n\nwith `size` 4 shoul...
[{"input": "28", "output": "[\"1010101010101010101010101010\"]", "fn_name": "stringy"}, {"input": "26", "output": "[\"10101010101010101010101010\"]", "fn_name": "stringy"}, {"input": "12", "output": "[\"101010101010\"]", "fn_name": "stringy"}, {"input": "5", "output": "[\"10101\"]", "fn_name": "stringy"}, {"input": "3"...
code_functional
[ { "content": "Solve the following coding problem using the programming language python:\n\nTwo famous competing companies ChemForces and TopChemist decided to show their sets of recently discovered chemical elements on an exhibition. However they know that no element should be present in the sets of both compan...
[{"type": "stdin_stdout", "input": "10\n598654597 975579682\n117777072 31932499\n223851456 1477480177\n988262691 654502493\n967529230 543358150\n835120075 101574205\n809901567 613170206\n152157661 479980560\n859252956 158469817\n614959273 735298093\n10\n1156316033 361325206\n341655282 740807372\n239996693 809030434\n81...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nIn this problem, a $n \\times m$ rectangular matrix $a$ is called increasing if, for each row of $i$, when go from left to right, the values strictly increase (that is, $a_{i,1}<a_{i,2}<\\dots<a_{i,m}$) and for each colum...
[{"type": "stdin_stdout", "input": "10 4\n4 9 11 12\n8 11 13 18\n13 16 18 21\n15 21 0 24\n17 0 21 29\n21 26 0 33\n26 31 33 35\n30 32 35 37\n33 37 40 43\n34 41 46 51\n", "output": "-1\n"}, {"type": "stdin_stdout", "input": "10 4\n4 9 11 12\n8 11 13 18\n13 16 18 21\n15 21 0 24\n17 0 21 29\n21 26 0 33\n26 31 33 35\n30 32 ...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nIahub is a big fan of tourists. He wants to become a tourist himself, so he planned a trip. There are n destinations on a straight road that Iahub wants to visit. Iahub starts the excursion from kilometer 0. The n destina...
[{"type": "stdin_stdout", "input": "50\n3987477 8934938 4067156 6712855 7269334 5039822 9533601 9335400 5992073 2619268 438734 8620973 4347619 4307947 2249161 815221 7615258 8244100 8341666 5908546 6646952 4812769 6215114 7479369 6290438 5623785 6466133 9953199 3525873 4326034 3510072 8117068 2342953 1717542 9766539 65...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nPupils decided to go to amusement park. Some of them were with parents. In total, n people came to the park and they all want to get to the most extreme attraction and roll on it exactly once.\n\nTickets for group of x pe...
[{"type": "stdin_stdout", "input": "100 1000 1000\n0000010100101100110100101111001111111111100101111100111011110001011110110111111010000000101000111000\n", "output": "100000\n"}, {"type": "stdin_stdout", "input": "100 1000 1000\n0000010100101100110100101111001111111111100101111100111011110001011110110111111010000000101...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nCreate a function\n\n```python\nhas_two_cube_sums(n)\n```\n\nwhich checks if a given number `n` can be written as the sum of two cubes in two different ways: `n = a³+b³ = c³+d³`.\nAll the numbers `a`, `b`, `c` and `d` sho...
[{"input": "46163", "output": "[false]", "fn_name": "has_two_cube_sums"}, {"input": "4103", "output": "[false]", "fn_name": "has_two_cube_sums"}, {"input": "4102", "output": "[false]", "fn_name": "has_two_cube_sums"}, {"input": "4105", "output": "[false]", "fn_name": "has_two_cube_sums"}, {"input": "4106", "output": "[...
code_functional
[ { "content": "Solve the following coding problem using the programming language python:\n\nYou have an array of numbers. \nYour task is to sort ascending odd numbers but even numbers must be on their places.\n\nZero isn't an odd number and you don't need to move it. If you have an empty array, you need to retu...
[{"input": "[1, 2, 3, 4, 5, 6, 7, 8, 9, 0]", "output": "[[1, 2, 3, 4, 5, 6, 7, 8, 9, 0]]", "fn_name": "sort_array"}, {"input": "[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]", "output": "[[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]]", "fn_name": "sort_array"}, {"input": "[0, 1, 2, 3, 4, 9, 8, 7, 6, 5]", "output": "[[0, 1, 2, 3, 4, 5, 8, 7, 6, 9]]...
code_functional
[ { "content": "Solve the following coding problem using the programming language python:\n\nYour task is simply to count the total number of lowercase letters in a string.\n\n## Examples\n\nWrite your solution by modifying this code:\n\n```python\ndef lowercase_count(strng):\n\t\n```\n\nYour solution should impl...
[{"input": "\"abcABC123!@#$%^&*()_-+=}{[]|':;?/>.<,~\"", "output": "[3]", "fn_name": "lowercase_count"}, {"input": "\"ABC123!@#$%^&*()_-+=}{[]|':;?/>.<,~\"", "output": "[0]", "fn_name": "lowercase_count"}, {"input": "\"abcdefghijklmnopqrstuvwxyz\"", "output": "[26]", "fn_name": "lowercase_count"}, {"input": "\"abcABC12...
code_functional
[ { "content": "Solve the following coding problem using the programming language python:\n\nYou are given two integers a and b. Determine if a+b=15 or a\\times b=15 or neither holds.\n\nNote that a+b=15 and a\\times b=15 do not hold at the same time.\n\nConstraints\n\n* 1 \\leq a,b \\leq 15\n* All values in inpu...
[{"type": "stdin_stdout", "input": "-3 -5", "output": "*\n"}, {"type": "stdin_stdout", "input": "11 -1", "output": "x\n"}, {"type": "stdin_stdout", "input": "15 -1", "output": "x\n"}, {"type": "stdin_stdout", "input": "29 -1", "output": "x\n"}, {"type": "stdin_stdout", "input": "13 -1", "output": "x\n"}, {"type": "stdi...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nThree people, A, B and C, are trying to communicate using transceivers.\nThey are standing along a number line, and the coordinates of A, B and C are a, b and c (in meters), respectively.\nTwo people can directly communic...
[{"type": "stdin_stdout", "input": "-1 000 -1 15", "output": "Yes\n"}, {"type": "stdin_stdout", "input": "-1 100 -1 15", "output": "Yes\n"}, {"type": "stdin_stdout", "input": "-1 100 -1 12", "output": "Yes\n"}, {"type": "stdin_stdout", "input": "-1 100 -1 13", "output": "Yes\n"}, {"type": "stdin_stdout", "input": "-1 1...
code_stdio
[ { "content": "Solve the following coding problem using the programming language python:\n\nPetya is the most responsible worker in the Research Institute. So he was asked to make a very important experiment: to melt the chocolate bar with a new laser device. The device consists of a rectangular field of n × m c...
[{"type": "stdin_stdout", "input": "20\n100 200 100 1 100 100\n100 200 1 100 100 100\n2 2 1 1 2 2\n100 100 50 50 1 1\n10 10 5 5 1 1\n100 100 99 1 1 99\n100 100 1 99 99 1\n100 100 1 10 10 1\n100 100 1 1 10 10\n9 6 1 3 3 1\n1000000000 1000000000 1 1 1000000000 1000000000\n9 4 1 4 4 1\n6 4 1 1 5 4\n6 2 1 1 5 2\n8 2 1 1 5 ...
code_stdio