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\nWrite a function that takes two arguments, and returns a new array populated with the elements **that only appear once, in either one array or the other, taken only once**; display order should follow what appears in arr1... | [{"input": "[\"tartar\", \"blanket\", \"domino\"]\n[\"blanket\"]", "output": "[[\"tartar\", \"domino\"]]", "fn_name": "hot_singles"}, {"input": "[10, 200, 30]\n[10, 20, 3, 4, 5, 5, 5, 200]", "output": "[[30, 20, 3, 4, 5]]", "fn_name": "hot_singles"}, {"input": "[77, \"basketweave\"]\n[78, 42, \"basketweave\"]", "output... | code_functional |
[
{
"content": "Solve the following coding problem using the programming language python:\n\n# Summation\n\nWrite a program that finds the summation of every number from 1 to num. The number will always be a positive integer greater than 0.\n\nFor example:\n```if-not:racket\n~~~\nsummation(2) -> 3\n1 + 2\n\nsumma... | [{"input": "213", "output": "[22791]", "fn_name": "summation"}, {"input": "100", "output": "[5050]", "fn_name": "summation"}, {"input": "22", "output": "[253]", "fn_name": "summation"}, {"input": "8", "output": "[36]", "fn_name": "summation"}, {"input": "1", "output": "[1]", "fn_name": "summation"}] | code_functional |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nHofstadter sequences are a family of related integer sequences, among which the first ones were described by an American professor Douglas Hofstadter in his book Gödel, Escher, Bach. \n\n### Task\nToday we will be impleme... | [{"input": "1000", "output": "[502]", "fn_name": "hofstadter_Q"}, {"input": "100", "output": "[56]", "fn_name": "hofstadter_Q"}, {"input": "10", "output": "[6]", "fn_name": "hofstadter_Q"}, {"input": "1", "output": "[1]", "fn_name": "hofstadter_Q"}, {"input": "3", "output": "[2]", "fn_name": "hofstadter_Q"}, {"input": ... | code_functional |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nThe city of Kyoto is well-known for its Chinese plan: streets are either North-South or East-West. Some streets are numbered, but most of them have real names.\nCrossings are named after the two streets crossing there, e.... | [{"type": "stdin_stdout", "input": "7\nShijo-Kawaramachi\nKarasuma-Imadegawa\nKawaramachi-Imadegawa\nNishioji-Shijo\nKarasuma-Gojo\nTorimaru-Rokujo\nRokujo-Karasuma\n6\nShijo-Karasuma\nImadegawa-Nishioji\nNishioji-Gojo\nShijo-Torimaru\nTorimaru-Gojo\nShijo-Kawabata\n4\n1jo-Midosuji\nMidosuji-2jo\n2jo-Omotesando\nOmotes... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nIt's time polar bears Menshykov and Uslada from the zoo of St. Petersburg and elephant Horace from the zoo of Kiev got down to business. In total, there are n tasks for the day and each animal should do each of these task... | [{"type": "stdin_stdout", "input": "19\n895 1302 724 952 340 952 939 1302 724 952 939 340 340 1844 770 976 435 1302 1302\n", "output": "YES\n5 12 13 17 3 9 15 1 7 11 4 6 10 16 2 8 18 19 14\n12 5 13 17 3 9 15 1 7 11 4 6 10 16 2 8 18 19 14\n12 13 5 17 3 9 15 1 7 11 4 6 10 16 2 8 18 19 14\n"}, {"type": "stdin_stdout", "in... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nWe have N cards. A number a_i is written on the i-th card.\n\nAlice and Bob will play a game using these cards. In this game, Alice and Bob alternately take one card. Alice goes first.\n\nThe game ends when all the cards ... | [{"type": "stdin_stdout", "input": "4\n20 18 2 18\n", "output": "18\n"}, {"type": "stdin_stdout", "input": "4\n20 18 2 12", "output": "12\n"}, {"type": "stdin_stdout", "input": "4\n139 4 2 5", "output": "136\n"}, {"type": "stdin_stdout", "input": "4\n139 1 2 5", "output": "135\n"}, {"type": "stdin_stdout", "input": "4\... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nIn this Kata, you will be given two integers `n` and `k` and your task is to remove `k-digits` from `n` and return the lowest number possible, without changing the order of the digits in `n`. Return the result as a string... | [{"input": "1284569\n1", "output": "[\"124569\"]", "fn_name": "solve"}, {"input": "1284569\n2", "output": "[\"12456\"]", "fn_name": "solve"}, {"input": "123056\n1", "output": "[\"12056\"]", "fn_name": "solve"}, {"input": "1284569\n3", "output": "[\"1245\"]", "fn_name": "solve"}, {"input": "123056\n2", "output": "[\"105... | code_functional |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nEach employee of the \"Blake Techologies\" company uses a special messaging app \"Blake Messenger\". All the stuff likes this app and uses it constantly. However, some important futures are missing. For example, many user... | [{"type": "stdin_stdout", "input": "28 7\n1-a 1-b 1-c 1-d 1-e 1-f 1-t 1-a 1-b 1-c 1-d 1-e 1-f 1-j 1-a 1-b 1-c 1-d 1-e 1-f 1-g 1-a 1-b 1-c 1-d 1-e 1-f 2-g\n1-a 1-b 1-c 1-d 1-e 1-f 1-g\n", "output": "2\n"}, {"type": "stdin_stdout", "input": "28 7\n1-a 1-b 1-c 1-d 1-e 1-f 1-t 1-a 1-b 1-c 1-d 1-e 1-f 1-j 1-a 1-b 1-c 1-d 1-... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nYou will be given a fruit which a farmer has harvested, your job is to see if you should buy or sell.\n\nYou will be given 3 pairs of fruit. Your task is to trade your harvested fruit back into your harvested fruit via th... | [{"input": "[[\"orange\", \"apple\"], [\"pear\", \"orange\"], [\"apple\", \"pear\"]]\n\"apple\"", "output": "[[\"sell\", \"sell\", \"sell\"]]", "fn_name": "buy_or_sell"}, {"input": "[[\"apple\", \"orange\"], [\"pear\", \"orange\"], [\"apple\", \"pear\"]]\n\"apple\"", "output": "[[\"buy\", \"sell\", \"sell\"]]", "fn_nam... | code_functional |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nSergey attends lessons of the N-ish language. Each lesson he receives a hometask. This time the task is to translate some sentence to the N-ish language. Sentences of the N-ish language can be represented as strings consi... | [{"type": "stdin_stdout", "input": "ttspivgoupgupvgpusvppogsseueusuglpiugssviuutlvgvugtpovuvspvpipggooplgvgugpogvesppulovugsvuougveiivgvslllviogpvtolepglguuellotpvgevspvoiiggiiplppgosuguvtstttpielteuglspgeoeeuivtptggltoltpgliviotsospvitupiopisoetupvvspooilsopslpoloptigstspoiuutiuvvuvlpplvioitsuvlpvtleveslslovolloogsgpv... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\n<image>\n\n\nAs shown in the figure above, cut a convex polygon g by a line p1p2 and print the area of the cut polygon which is on the left-hand side of the line.\n\ng is represented by a sequence of points p1, p2,..., pn... | [{"type": "stdin_stdout", "input": "4\n-2 1\n9 2\n3 5\n0 1\n2\n1 1 1 9\n-1 15 -1 0", "output": "0.257575758\n15.545454545\n"}, {"type": "stdin_stdout", "input": "4\n-1 1\n9 1\n2 5\n0 3\n2\n1 1 1 9\n0 15 -1 0", "output": "3.500000000\n20.994871795\n"}, {"type": "stdin_stdout", "input": "4\n-1 1\n9 1\n2 5\n0 3\n2\n1 1 1 ... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nThere is a string s of length 3 or greater. No two neighboring characters in s are equal.\n\nTakahashi and Aoki will play a game against each other. The two players alternately performs the following operation, Takahashi ... | [{"type": "stdin_stdout", "input": "bceab", "output": "Second\n"}, {"type": "stdin_stdout", "input": "bacba", "output": "First\n"}, {"type": "stdin_stdout", "input": "badba", "output": "First\n"}, {"type": "stdin_stdout", "input": "cadba", "output": "First\n"}, {"type": "stdin_stdout", "input": "dadba", "output": "Firs... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nSnuke received a positive integer N from Takahashi. A positive integer m is called a favorite number when the following condition is satisfied:\n\n* The quotient and remainder of N divided by m are equal, that is, \\lfloo... | [{"type": "stdin_stdout", "input": "1000010000000", "output": "2716922731275\n"}, {"type": "stdin_stdout", "input": "1000011000000", "output": "3307289212967\n"}, {"type": "stdin_stdout", "input": "1100011000000", "output": "2999416055122\n"}, {"type": "stdin_stdout", "input": "1110011000000", "output": "3146654438234\... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nA shop sells N kinds of fruits, Fruit 1, \\ldots, N, at prices of p_1, \\ldots, p_N yen per item, respectively. (Yen is the currency of Japan.)\nHere, we will choose K kinds of fruits and buy one of each chosen kind. Find... | [{"type": "stdin_stdout", "input": "1000 1000\n1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 100... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nWe need to write some code to return the original price of a product, the return type must be of type decimal and the number must be rounded to two decimal places.\n\nWe will be given the sale price (discounted price), an... | [{"input": "458.2\n17.13", "output": "[552.91]", "fn_name": "discover_original_price"}, {"input": "373.85\n11.2", "output": "[421]", "fn_name": "discover_original_price"}, {"input": "75.75\n25", "output": "[101]", "fn_name": "discover_original_price"}, {"input": "75\n25", "output": "[100]", "fn_name": "discover_origina... | code_functional |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nGiven few numbers, you need to print out the digits that are not being used.\n\nExample:\n\n```python\nunused_digits(12, 34, 56, 78) # \"09\"\nunused_digits(2015, 8, 26) # \"3479\"\n```\n\nNote:\n\n- Result string should ... | [{"input": "1\n11\n111\n1111\n11111", "output": "[\"023456789\"]", "fn_name": "unused_digits"}, {"input": "364\n500\n715\n730", "output": "[\"289\"]", "fn_name": "unused_digits"}, {"input": "864\n896\n744", "output": "[\"01235\"]", "fn_name": "unused_digits"}, {"input": "93\n10\n11\n40", "output": "[\"25678\"]", "fn_na... | code_functional |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nEach year in the castle of Dwarven King there is a competition in growing mushrooms among the dwarves. The competition is one of the most prestigious ones, and the winner gets a wooden salad bowl. This year's event brough... | [{"type": "stdin_stdout", "input": "10 6 1 48\n239 632\n976 315\n797 112\n1 835\n938 862\n531 884\n422 607\n152 331\n413 677\n622 978\n", "output": "5 3788.56\n10 3673.36\n2 3360.12\n6 3289.08\n4 2606.20\n3 2598.64\n9 2525.24\n7 2315.84\n1 2210.84\n8 1184.72\n"}, {"type": "stdin_stdout", "input": "10 6 1 41\n239 632\n9... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nImagine that you have a twin brother or sister. Having another person that looks exactly like you seems very unusual. It's hard to say if having something of an alter ego is good or bad. And if you do have a twin, then yo... | [{"type": "stdin_stdout", "input": "100\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 31 32 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 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 ... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nThis kata is blatantly copied from inspired by This Kata\nWelcome\n\nthis is the second in the series of the string iterations kata!\n\nHere we go!\n\n--------------------------------------------------------------------... | [{"input": "\"String for test: incommensurability\"\n1", "output": "[\"ySttirliinbga rfuosrn etmemsotc:n i\"]", "fn_name": "string_func"}, {"input": "\"This is a string exemplification!\"\n0", "output": "[\"This is a string exemplification!\"]", "fn_name": "string_func"}, {"input": "\"this_test_will_hurt_you\"\n1234567... | code_functional |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nOne quite ordinary day Valera went to school (there's nowhere else he should go on a week day). In a maths lesson his favorite teacher Ms. Evans told students about divisors. Despite the fact that Valera loved math, he di... | [{"type": "stdin_stdout", "input": "1000000000 2000000000 2\n", "output": "500000001\n"}, {"type": "stdin_stdout", "input": "200000000 2000000000 1800000011\n", "output": "1\n"}, {"type": "stdin_stdout", "input": "1500000000 2000000000 11\n", "output": "10389612\n"}, {"type": "stdin_stdout", "input": "1100000000 200000... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nServal is fighting with a monster.\nThe health of the monster is H.\nIn one attack, Serval can decrease the monster's health by A.\nThere is no other way to decrease the monster's health.\nServal wins when the monster's h... | [{"type": "stdin_stdout", "input": "10000 1\n", "output": "10000\n"}, {"type": "stdin_stdout", "input": "10000 10000\n", "output": "1\n"}, {"type": "stdin_stdout", "input": "11000 1", "output": "11000\n"}, {"type": "stdin_stdout", "input": "10010 1", "output": "10010\n"}, {"type": "stdin_stdout", "input": "10001 1", "o... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nA **pandigital number** is one that has its digits from ```1``` to ```9``` occuring only once (they do not have the digit 0).\n\nThe number ```169```, is the first pandigital square, higher than ```100```, having its squa... | [{"input": "1750\n3\n5", "output": "[[[13, 2197], [17, 4913], [18, 5832], [19, 6859], [21, 9261]]]", "fn_name": "pow_root_pandigit"}, {"input": "1728\n3\n4", "output": "[[[13, 2197], [17, 4913], [18, 5832], [19, 6859]]]", "fn_name": "pow_root_pandigit"}, {"input": "388\n2\n3", "output": "[[[23, 529], [24, 576], [25, 62... | code_functional |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nYou are given an array of n integer numbers a_0, a_1, ..., a_{n} - 1. Find the distance between two closest (nearest) minimums in it. It is guaranteed that in the array a minimum occurs at least two times.\n\n\n-----Input... | [{"type": "stdin_stdout", "input": "85\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 31 32 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 58 59 60 61 62 63 64 65 72 67 68 69 70 71 72 73 74 119 76 77 78 79 80 81 82 83 84 1\n", "output": "84\n"}, {"type": "s... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nAlice and Bob play ping-pong with simplified rules.\n\nDuring the game, the player serving the ball commences a play. The server strikes the ball then the receiver makes a return by hitting the ball back. Thereafter, the ... | [{"type": "stdin_stdout", "input": "12\n1 1\n2 1\n1 7\n1 1\n2 1\n1 7\n1 1\n2 1\n1 7\n1 1\n2 1\n1 7\n", "output": "0 1\n1 1\n0 7\n0 1\n1 1\n0 7\n0 1\n1 1\n0 7\n0 1\n1 1\n0 7\n"}, {"type": "stdin_stdout", "input": "12\n1 1\n2 1\n1 7\n1 1\n2 1\n1 7\n1 1\n2 1\n1 7\n1 1\n2 1\n1 7\n", "output": "0 1\n1 1\n0 7\n0 1\n1 1\n0 7\... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nProgrammer Vasya is studying a new programming language &K*. The &K* language resembles the languages of the C family in its syntax. However, it is more powerful, which is why the rules of the actual C-like languages are ... | [{"type": "stdin_stdout", "input": "10\ntypedef &void**** youdyfpinzk\ntypeof &youdyfpinzk***\ntypedef &&&&youdyfpinzk****** nfbsgpjzhxzskmxc\ntypeof nfbsgpjzhxzskmxc***\ntypedef &&&void*** puerqioirikxej\ntypeof &puerqioirikxej********\ntypedef &puerqioirikxej******** xzgzsamjdufuyxz\ntypeof &xzgzsamjdufuyxz******\nty... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nThere are N cats. We number them from 1 through N.\n\nEach of the cats wears a hat. Cat i says: \"there are exactly a_i different colors among the N - 1 hats worn by the cats except me.\"\n\nDetermine whether there exists... | [{"type": "stdin_stdout", "input": "5\n3 4 3 4 3", "output": "Yes\n"}, {"type": "stdin_stdout", "input": "5\n3 4 3 3 3", "output": "No\n"}, {"type": "stdin_stdout", "input": "4\n1 0 -1 2", "output": "No\n"}, {"type": "stdin_stdout", "input": "4\n1 0 -1 3", "output": "No\n"}, {"type": "stdin_stdout", "input": "4\n1 1 -1... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nOur friendly friend Pete is really a nice person, but he tends to be rather... Inappropriate.\n\nAnd possibly loud, if given enough ethanol and free rein, so we ask you to write a function that should take its not always ... | [{"input": "\"What the hell am I doing here? And where is my wallet? PETE SMASH!\"", "output": "[\"W**t t*e h**l am i d***g h**e? A*d w***e is my w****t? P**e s***h!\"]", "fn_name": "pete_talk"}, {"input": "\"I want to punch someone in the face\"\n[\"drink\", \"job\", \"girls\"]", "output": "[\"I w**t to p***h s*****e ... | code_functional |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nStepan had a favorite string s which consisted of the lowercase letters of the Latin alphabet. \n\nAfter graduation, he decided to remember it, but it was a long time ago, so he can't now remember it. But Stepan remembers... | [{"type": "stdin_stdout", "input": "200\n200 180 160 140 122 106 92 79 69 60 52 45 38 32 26 20 14 8 4 2 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nThis is the easy version of the problem. The difference between the versions is in the constraints on the array elements. You can make hacks only if all versions of the problem are solved.\n\nYou are given an array [a_1, ... | [{"type": "stdin_stdout", "input": "100\n92 42 58 62 24 59 62 100 92 62 54 100 62 82 91 62 100 100 62 100 100 62 92 92 92 62 92 92 62 92 62 92 88 100 100 36 62 92 16 92 62 100 62 92 35 62 100 92 92 62 93 100 100 62 76 100 62 62 92 62 92 50 100 8 7 62 100 18 92 62 92 92 100 62 32 92 92 62 37 76 100 39 62 92 62 41 62 62 ... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nYou are given a string s consisting of lowercase English letters and a number k. Let's call a string consisting of lowercase English letters beautiful if the number of occurrences of each letter in that string is divisibl... | [{"type": "stdin_stdout", "input": "12\n12 3\nzazasqzqsasq\n1 2\ny\n1 1\na\n15 5\nabccbaabccbazaa\n16 8\ncadjfdsljfdkljds\n6 2\nbaazaa\n6 3\nbosszb\n6 1\nqwerty\n7 7\ndaaaaaa\n14 2\nacabcbdeffewzc\n18 6\nzzzzzzzzzzzzyyyyyz\n9 4\naabaabbbc\n", "output": "zazasqzqsasq\n-1\na\nabccbaabccbbaac\ncbbbbbbbbccccccc\nbaazbz\nbp... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nThis is the easy version of the problem. The only difference is that in this version q = 1. You can make hacks only if both versions of the problem are solved.\n\nThere is a process that takes place on arrays a and b of l... | [{"type": "stdin_stdout", "input": "100\n45 21 34 56 15 0 46 59 40 39 78 83 29 77 19 30 60 39 90 64 11 47 10 47 35 79 30 13 21 31 26 68 0 67 52 43 29 94 100 76 16 61 74 34 62 63 4 41 78 31 77 21 90 2 43 70 53 15 53 29 47 87 33 20 23 30 55 57 13 25 19 89 10 17 92 24 47 6 4 91 52 9 11 25 81 14 82 75 46 49 66 62 28 84 88 ... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nPolycarp must pay exactly $n$ burles at the checkout. He has coins of two nominal values: $1$ burle and $2$ burles. Polycarp likes both kinds of coins equally. So he doesn't want to pay with more coins of one type than wi... | [{"type": "stdin_stdout", "input": "6\n1001\n42\n0\n131\n1000101010\n12\n", "output": "333 334\n14 14\n0 0\n43 44\n333367004 333367003\n4 4\n"}, {"type": "stdin_stdout", "input": "6\n1001\n42\n0\n131\n1000101010\n0\n", "output": "333 334\n14 14\n0 0\n43 44\n333367004 333367003\n0 0\n"}, {"type": "stdin_stdout", "input"... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nConsider integer coordinates x, y in the Cartesian plan and three functions f, g, h\ndefined by:\n```\nf: 1 <= x <= n, 1 <= y <= n --> f(x, y) = min(x, y)\ng: 1 <= x <= n, 1 <= y <= n --> g(x, y) = max(x, y)\nh: 1 <= x <=... | [{"input": "4000", "output": "[21341334000]", "fn_name": "sumin"}, {"input": "730", "output": "[129938905]", "fn_name": "sumin"}, {"input": "365", "output": "[16275715]", "fn_name": "sumin"}, {"input": "100", "output": "[338350]", "fn_name": "sumin"}, {"input": "15", "output": "[1240]", "fn_name": "sumin"}, {"input": "... | code_functional |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nThere is a rectangular grid of n rows of m initially-white cells each.\n\nArkady performed a certain number (possibly zero) of operations on it. In the i-th operation, a non-empty subset of rows Ri and a non-empty subset ... | [{"type": "stdin_stdout", "input": "50 8\n.....#..\n........\n........\n.....#..\n.....#..\n........\n........\n........\n........\n...#....\n...#....\n........\n...#....\n#.#.#...\n...#....\n...#....\n........\n...#....\n...#....\n...#....\n........\n#.#.#...\n.....#..\n........\n#.#.#...\n#.#.#...\n#.#.#...\n...#....... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nVova decided to clean his room. The room can be represented as the coordinate axis $OX$. There are $n$ piles of trash in the room, coordinate of the $i$-th pile is the integer $p_i$. All piles have different coordinates.\... | [{"type": "stdin_stdout", "input": "5 8\n5 1 2 4 3\n0 1\n0 2\n0 3\n0 4\n0 5\n1 1000000000\n1 1\n1 500000000\n", "output": "3\n2\n1\n0\n0\n0\n0\n0\n499999999\n"}, {"type": "stdin_stdout", "input": "5 8\n5 1 2 4 3\n0 1\n0 2\n0 3\n0 4\n0 5\n1 1000000000\n1 1\n1 500000000\n", "output": "3\n2\n1\n0\n0\n0\n0\n0\n499999999\n"... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nThis is an easier version of the next problem. In this version, $q = 0$.\n\nA sequence of integers is called nice if its elements are arranged in blocks like in $[3, 3, 3, 4, 1, 1]$. Formally, if two elements are equal, e... | [{"type": "stdin_stdout", "input": "100 0\n6 7 100 8 5 61 5 75 59 65 51 47 83 37 34 54 87 46 4 26 21 87 12 97 86 68 60 11 62 76 14 83 29 31 91 62 57 80 47 75 85 97 62 77 91 86 14 25 48 77 83 65 39 61 78 77 45 46 90 74 100 91 86 98 55 5 84 42 91 69 100 4 74 98 60 37 75 44 41 12 15 34 36 1 99 16 7 87 36 26 79 42 41 84 17... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nVasya likes taking part in Codeforces contests. When a round is over, Vasya follows all submissions in the system testing tab.\n\nThere are $n$ solutions, the $i$-th of them should be tested on $a_i$ tests, testing one so... | [{"type": "stdin_stdout", "input": "100 10\n3 114 77 78 105 87 6 122 141 100 75 118 64 18 88 37 109 72 31 101 36 10 62 18 52 17 149 115 22 150 138 48 46 42 104 8 63 21 117 58 87 80 7 131 125 118 67 13 144 43 59 67 74 13 124 77 86 148 107 11 51 9 87 52 147 22 7 22 143 12 121 123 17 35 33 87 91 140 92 38 106 10 66 26 40 ... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nThe game of Berland poker is played with a deck of $n$ cards, $m$ of which are jokers. $k$ players play this game ($n$ is divisible by $k$).\n\nAt the beginning of the game, each player takes $\\frac{n}{k}$ cards from the... | [{"type": "stdin_stdout", "input": "4\n8 3 2\n4 2 4\n12 6 3\n42 0 7\n", "output": "3\n0\n3\n0\n"}, {"type": "stdin_stdout", "input": "4\n12 3 2\n4 2 4\n9 6 3\n42 0 7\n", "output": "3\n0\n1\n0\n"}, {"type": "stdin_stdout", "input": "4\n8 1 2\n4 2 4\n12 6 3\n66 0 7\n", "output": "1\n0\n3\n0\n"}, {"type": "stdin_stdout", ... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nGiven an array of integer $a_1, a_2, \\ldots, a_n$. In one operation you can make $a_i := a_i + 1$ if $i < n$ and $a_i \\leq a_{i + 1}$, or $i = n$ and $a_i \\leq a_1$.\n\nYou need to check whether the array $a_1, a_2, \\... | [{"type": "stdin_stdout", "input": "5\n3\n1 2 5\n1 2 5\n2\n2 2\n1 3\n4\n3 4 1 2\n6 4 2 5\n3\n2 4 1\n4 5 3\n5\n1 2 3 4 5\n6 5 6 7 6\n", "output": "YES\nNO\nNO\nNO\nYES\n"}, {"type": "stdin_stdout", "input": "1\n4\n1 1 1 1\n40000000 40000000 40000000 40000000\n", "output": "YES\n"}, {"type": "stdin_stdout", "input": "1\n... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nOne day, Chef prepared D brand new dishes. He named the i-th dish by a string Si. After the cooking, he decided to categorize each of these D dishes as special or not.\n\nA dish Si is called special if it's name (i.e. the... | [{"type": "stdin_stdout", "input": "3\naba\nabac\nabcd\n", "output": "YES\nNO\nNO\n"}, {"type": "stdin_stdout", "input": "3\ncdd\n_a_a\n_ed[", "output": "YES\nYES\nNO\n"}, {"type": "stdin_stdout", "input": "3\naba\nabac\naacd", "output": "YES\nNO\nNO\n"}, {"type": "stdin_stdout", "input": "3\nfda\n`a`a\nb`Ze", "output"... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nA sequence of square brackets is regular if by inserting symbols \"+\" and \"1\" into it, you can get a regular mathematical expression from it. For example, sequences \"[[]][]\", \"[]\" and \"[[][[]]]\" — are regular, at... | [{"type": "stdin_stdout", "input": "100\n[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]\n", "output": "+- -+\n|+- ... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nYou are given an array $a$, consisting of $n$ integers.\n\nEach position $i$ ($1 \\le i \\le n$) of the array is either locked or unlocked. You can take the values on the unlocked positions, rearrange them in any order an... | [{"type": "stdin_stdout", "input": "5\n3\n1 3 2\n0 0 0\n4\n2 -3 4 -1\n1 1 1 1\n7\n-8 4 -2 -6 4 7 1\n1 0 0 0 1 1 0\n5\n0 1 -4 6 3\n0 0 0 1 1\n6\n-1 7 10 4 -8 -1\n1 0 0 0 0 1\n", "output": "3 2 1 \n2 -3 4 -1 \n-8 4 1 -2 4 7 -6 \n1 0 -4 6 3 \n-1 10 7 4 -8 -1 \n"}, {"type": "stdin_stdout", "input": "5\n3\n1 3 2\n0 0 0\n4\n... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nGiven is a string S consisting of L and R.\nLet N be the length of S. There are N squares arranged from left to right, and the i-th character of S from the left is written on the i-th square from the left.\nThe character ... | [{"type": "stdin_stdout", "input": "RRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRR... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nIn a building where Polycarp lives there are equal number of flats on each floor. Unfortunately, Polycarp don't remember how many flats are on each floor, but he remembers that the flats are numbered from 1 from lower to ... | [{"type": "stdin_stdout", "input": "50 70\n3 3\n80 80\n23 23\n11 11\n87 87\n7 7\n63 63\n61 61\n67 67\n53 53\n9 9\n43 43\n55 55\n27 27\n5 5\n1 1\n99 99\n65 65\n37 37\n60 60\n32 32\n38 38\n81 81\n2 2\n34 34\n17 17\n82 82\n26 26\n71 71\n4 4\n16 16\n19 19\n39 39\n51 51\n6 6\n49 49\n64 64\n83 83\n10 10\n56 56\n30 30\n76 76\... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\n**This Kata is intended as a small challenge for my students**\n\nCreate a function, called ``removeVowels`` (or ``remove_vowels``), that takes a string argument and returns that same string with all vowels removed (vowel... | [{"input": "\"scholarstem\"", "output": "[\"schlrstm\"]", "fn_name": "remove_vowels"}, {"input": "\"high fives!\"", "output": "[\"hgh fvs!\"]", "fn_name": "remove_vowels"}, {"input": "\"codewars\"", "output": "[\"cdwrs\"]", "fn_name": "remove_vowels"}, {"input": "\"drake\"", "output": "[\"drk\"]", "fn_name": "remove_vo... | code_functional |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nAn isogram is a word that has no repeating letters, consecutive or non-consecutive. Implement a function that determines whether a string that contains only letters is an isogram. Assume the empty string is an isogram. Ig... | [{"input": "\"abcdefghijklmnopqrstuwwxyz\"", "output": "[false]", "fn_name": "is_isogram"}, {"input": "\"abcdefghijklmnopqrstuvwxyz\"", "output": "[true]", "fn_name": "is_isogram"}, {"input": "\"thumbscrewjapingly\"", "output": "[true]", "fn_name": "is_isogram"}, {"input": "\"Dermatoglyphics\"", "output": "[true]", "fn... | code_functional |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nA correct expression of the form a+b=c was written; a, b and c are non-negative integers without leading zeros. In this expression, the plus and equally signs were lost. The task is to restore the expression. In other wor... | [{"type": "stdin_stdout", "input": "100277221476489181970323375139380435110027722147648918197032337513938043511002772214764891819703233751393804351100277221476489181970323375139380435120055444295297836394064675027876087022005544429529783639406467502787608702\n", "output": "1002772214764891819703233751393804351100277221... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nThe Olympic Games in Bercouver are in full swing now. Here everyone has their own objectives: sportsmen compete for medals, and sport commentators compete for more convenient positions to give a running commentary. Today ... | [{"type": "stdin_stdout", "input": "614 163 13\n613 -1796 18\n-749 679 12\n", "output": "-481.72161 -447.61301\n"}, {"type": "stdin_stdout", "input": "614 163 21\n613 -468 18\n-749 679 25\n", "output": "-214.30328 -350.95260\n"}, {"type": "stdin_stdout", "input": "614 163 13\n613 -1029 18\n-749 679 25\n", "output": "10... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nPolycarp lives on a coordinate line at the point $x = 0$. He goes to his friend that lives at the point $x = a$. Polycarp can move only from left to right, he can pass one unit of length each second.\n\nNow it's raining, ... | [{"type": "stdin_stdout", "input": "100 50 1\n1 2\n3 4\n5 6\n7 8\n9 10\n11 12\n13 14\n15 16\n17 18\n19 20\n21 22\n23 24\n25 26\n27 28\n29 30\n31 32\n33 34\n35 36\n37 38\n39 40\n41 42\n43 44\n45 46\n47 48\n49 50\n51 52\n53 54\n55 56\n57 58\n59 60\n61 62\n63 64\n65 66\n67 68\n69 70\n71 72\n73 74\n75 76\n77 78\n79 80\n81 ... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nMethodius received an email from his friend Polycarp. However, Polycarp's keyboard is broken, so pressing a key on it once may cause the corresponding symbol to appear more than once (if you press a key on a regular keybo... | [{"type": "stdin_stdout", "input": "10\naaaa\naaaab\naaaa\nbaaaa\na\naaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\na\nb\naaaaa\naaaa\nabcdefghijklmnopqrstuvwxyz\nzabcdefghijklmnopqrstuvwxyz\naaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\naaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaba\naaaaaaaaaaaaaaaaaaa... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nWe often go to supermarkets to buy some fruits or vegetables, and on the tag there prints the price for a kilo. But in some supermarkets, when asked how much the items are, the clerk will say that $a$ yuan for $b$ kilos (... | [{"type": "stdin_stdout", "input": "50 37\n78 49\n96 4\n86 118\n28 4\n19 2\n79 43\n79 92\n95 35\n33 60\n54 84\n90 25\n2 19\n53 21\n86 52\n72 25\n6 8\n41 46\n3 68\n42 89\n33 48\n57 43\n99 45\n1 126\n38 62\n11 50\n55 84\n1 97\n12 67\n51 96\n51 7\n1 100\n79 61\n66 54\n97 93\n52 75\n80 41\n98 73\n29 28\n73 108\n24 73\n3 25... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\n##Background - the Collatz Conjecture:\n\nImagine you are given a positive integer, `n`, then:\n\n* if `n` is even, calculate: `n / 2`\n* if `n` is odd, calculate: `3 * n + 1`\n\nRepeat until your answer is `1`. The Colla... | [{"input": "[75, 226, 113, 340]", "output": "[75]", "fn_name": "longest_collatz"}, {"input": "[340, 113, 226, 75]", "output": "[75]", "fn_name": "longest_collatz"}, {"input": "[75, 113, 226, 75]", "output": "[75]", "fn_name": "longest_collatz"}, {"input": "[64, 64, 27, 64]", "output": "[27]", "fn_name": "longest_collat... | code_functional |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nSunuke received a d-dimensional hypercube with a side length of l1 × ... × ld as a birthday present. Sunuke placed this rectangular parallelepiped so that the range of the i-th coordinate was 0 or more and li or less, and... | [{"type": "stdin_stdout", "input": "5\n12\n27\n15\n17\n149\n123", "output": "867510000\n"}, {"type": "stdin_stdout", "input": "5\n12\n34\n15\n17\n149\n119", "output": "998784000\n"}, {"type": "stdin_stdout", "input": "5\n12\n34\n15\n23\n149\n119", "output": "300622393\n"}, {"type": "stdin_stdout", "input": "5\n12\n27\n... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nAs you have noticed, there are lovely girls in Arpa’s land.\n\nPeople in Arpa's land are numbered from 1 to n. Everyone has exactly one crush, i-th person's crush is person with the number crush_{i}. [Image] \n\nSomeday A... | [{"type": "stdin_stdout", "input": "100\n84 94 72 32 61 90 61 2 76 42 35 82 90 29 51 27 65 99 38 41 44 73 100 58 56 64 54 31 14 58 57 64 90 49 73 80 74 19 31 86 73 44 39 43 28 95 23 5 85 5 74 81 34 44 86 30 50 57 94 56 53 42 53 87 92 78 53 49 78 60 37 63 41 19 15 68 25 77 87 48 23 100 54 27 68 84 43 92 76 55 2 94 100 2... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nYuki made a sugoroku so that everyone can play at the children's association event. In this sugoroku, squares are lined up in a ring, and each square has an integer of 1 or more written on it.\n\nThe player chooses a squa... | [{"type": "stdin_stdout", "input": "8\n2 -1 3 -1 1 4 -1 0", "output": "5\n"}, {"type": "stdin_stdout", "input": "8\n3 -1 3 -1 1 4 -1 0", "output": "6\n"}, {"type": "stdin_stdout", "input": "8\n3 -1 3 -1 2 4 -1 0", "output": "6\n"}, {"type": "stdin_stdout", "input": "8\n3 -1 3 -1 0 4 -1 0", "output": "7\n"}, {"type": "s... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nAnatoly lives in the university dorm as many other students do. As you know, cockroaches are also living there together with students. Cockroaches might be of two colors: black and red. There are n cockroaches living in A... | [{"type": "stdin_stdout", "input": "166\nrbbbbbbbbbbbbrbrrbbrbbbrbbbbbbbbbbrbbbbbbrbbbrbbbbbrbbbbbbbrbbbbbbbrbbrbbbbbbbbrbbbbbbbbbbbbbbrrbbbrbbbbbbbbbbbbbbrbrbbbbbbbbbbbrbbbbbbbbbbbbbbrbbbbbbbbbbbbbbbbbbbbbb\n", "output": "70\n"}, {"type": "stdin_stdout", "input": "166\nrbbbbbbbbbbbbrbrrbbrbbbrbbbbbbbbbbrbbbbbbrbbbrbbb... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nYou can print your name on a billboard ad. Find out how much it will cost you. Each letter has a default price of £30, but that can be different if you are given 2 parameters instead of 1.\n\nYou can not use multiplier \"... | [{"input": "\"Jeong-Ho Aristotelis\"", "output": "[600]", "fn_name": "billboard"}, {"input": "\"Abishai Charalampos\"", "output": "[570]", "fn_name": "billboard"}, {"input": "\"Zoroaster Donnchadh\"", "output": "[570]", "fn_name": "billboard"}, {"input": "\"Hjalmar Liupold\"\n40", "output": "[600]", "fn_name": "billboa... | code_functional |
[
{
"content": "Solve the following coding problem using the programming language python:\n\n# Task\n John is new to spreadsheets. He is well aware of rows and columns, but he is not comfortable with spreadsheets numbering system.\n```\nSpreadsheet Row Column\nA1 R1C1\nD5 ... | [{"input": "\"AA48\"", "output": "[\"R48C27\"]", "fn_name": "spreadsheet"}, {"input": "\"BK12\"", "output": "[\"R12C63\"]", "fn_name": "spreadsheet"}, {"input": "\"R12C63\"", "output": "[\"BK12\"]", "fn_name": "spreadsheet"}, {"input": "\"R31C78\"", "output": "[\"BZ31\"]", "fn_name": "spreadsheet"}, {"input": "\"BZ31\"... | code_functional |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nThe north country is conquered by the great shogun-sama (which means king). Recently many beautiful dice which were made by order of the great shogun-sama were given to all citizens of the country. All citizens received t... | [{"type": "stdin_stdout", "input": "1 2\n10 8\n0 0\n0 1\n3 3\n1 3 5\n2 13 1\n1 0 2\n0 0\n0 2\n3 3\n1 2 4\n4 8 10\n1 1 2\n0 0\n1 2\n2 2\n1 2\n5 4\n1 0\n0 1\n2 3\n1 2 3\n5 5 6\n0 0\n1 2\n0 0", "output": "24\n14\n30\n11\n21\n"}, {"type": "stdin_stdout", "input": "1 2\n10 8\n0 0\n0 1\n3 3\n1 3 5\n2 13 1\n1 0 2\n0 0\n0 2\n3... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nYour program fails again. This time it gets \"Wrong answer on test 233\".\n\nThis is the harder version of the problem. In this version, $1 \\le n \\le 2\\cdot10^5$. You can hack this problem if you locked it. But you can... | [{"type": "stdin_stdout", "input": "100 100\n82 51 14 14 37 17 78 92 64 15 8 86 89 8 87 77 30 15 15 12 100 25 161 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 148 71 14 76 54 81 4 59 46 39 29 92 3 49 22 53 99 118 52 74 31 92 43 70 23 44 9 82 47 7 40 12 9 3 55 37 85 46 22 84 52 98 4... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nBad news came to Mike's village, some thieves stole a bunch of chocolates from the local factory! Horrible! \n\nAside from loving sweet things, thieves from this area are known to be very greedy. So after a thief takes hi... | [{"type": "stdin_stdout", "input": "1000000000000000\n", "output": "4949100894494448\n"}, {"type": "stdin_stdout", "input": "1000000000000000\n", "output": "4949100894494448\n"}, {"type": "stdin_stdout", "input": "999999999999997\n", "output": "4949100894494440\n"}, {"type": "stdin_stdout", "input": "999999999999996\n"... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nYou are given an array $a$ of length $n$. The array is called 3SUM-closed if for all distinct indices $i$, $j$, $k$, the sum $a_i + a_j + a_k$ is an element of the array. More formally, $a$ is 3SUM-closed if for all integ... | [{"type": "stdin_stdout", "input": "4\n3\n-1 0 1\n5\n1 -2 -2 1 -3\n6\n0 0 0 0 0 0\n4\n-1 2 -3 4\n", "output": "YES\nNO\nYES\nNO\n"}, {"type": "stdin_stdout", "input": "1\n3\n0 65536 65536\n", "output": "NO\n"}, {"type": "stdin_stdout", "input": "1\n4\n-3 -1 1 1\n", "output": "YES\n"}, {"type": "stdin_stdout", "input": ... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nMr. Kitayuta has kindly given you a string s consisting of lowercase English letters. You are asked to insert exactly n lowercase English letters into s to make it a palindrome. (A palindrome is a string that reads the sa... | [{"type": "stdin_stdout", "input": "ccxsecrxosqsrsoolxzcoolqllexxssxqoqeqkocerchlxckqschxxczlxscoxhszsoxzxrzohsccsclocxxzshrhzoexxhrohqrrqhorhxxeozhrhszxxcolcsccshozrxzxoszshxocsxlzcxxhcsqkcxlhcrecokqeqoqxssxxellqlooczxloosrsqsoxrcesxcc\n536870712\n", "output": "ccxsecrxosqsrsoolxzcoolqllexxssxqoqeqkocerchlxckqschxxczl... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nSnuke has N integers. Among them, the smallest is A, and the largest is B. We are interested in the sum of those N integers. How many different possible sums there are?\n\nConstraints\n\n* 1 ≤ N,A,B ≤ 10^9\n* A and B are ... | [{"type": "stdin_stdout", "input": "13 -10 2", "output": "133\n"}, {"type": "stdin_stdout", "input": "125 -2 0", "output": "247\n"}, {"type": "stdin_stdout", "input": "109 0 1", "output": "108\n"}, {"type": "stdin_stdout", "input": "109 0 2", "output": "215\n"}, {"type": "stdin_stdout", "input": "19 -7 -2", "output": "... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nDr. Asimov, a robotics researcher, loves to research, but hates houseworks and his house were really dirty. So, he has developed a cleaning robot.\n\nAs shown in the following figure, his house has 9 rooms, where each roo... | [{"type": "stdin_stdout", "input": "1\nC A C\n1\nE C A\n10\nF A B\n0", "output": "0.00000000\n0.00000000\n0.07220459\n"}, {"type": "stdin_stdout", "input": "1\nC A C\n2\nE C A\n10\nF A B\n0", "output": "0.00000000\n0.12500000\n0.07220459\n"}, {"type": "stdin_stdout", "input": "1\nC A C\n1\nF C A\n10\nF A B\n0", "output... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nPolo, the Penguin, likes numbers. He says that the goodness of a number is itself multiplied by the number of digits in it's decimal representation. For example, the goodness of the integer 474 is 474*3 = 1422.\nHelp him ... | [{"type": "stdin_stdout", "input": "1\n13 393", "output": "227157\n"}, {"type": "stdin_stdout", "input": "1\n15 149", "output": "28365\n"}, {"type": "stdin_stdout", "input": "1\n15 260", "output": "96630\n"}, {"type": "stdin_stdout", "input": "1\n13 260", "output": "96684\n"}, {"type": "stdin_stdout", "input": "1\n13 1... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nThere are $n$ people sitting in a circle, numbered from $1$ to $n$ in the order in which they are seated. That is, for all $i$ from $1$ to $n-1$, the people with id $i$ and $i+1$ are adjacent. People with id $n$ and $1$ a... | [{"type": "stdin_stdout", "input": "735134400\n", "output": "1 367567202 735134403 1102701604 1470268805 1837836006 2205403207 2572970408 2940537609 3308104810 3675672011 4043239212 4410806413 4778373614 5145940815 5513508016 5881075217 6248642418 6983776820 7351344021 7718911222 8454045624 8821612825 9189180026 955674... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nMr. Santa asks all the great programmers of the world to solve a trivial problem. He gives them an integer m and asks for the number of positive integers n, such that the factorial of n ends with exactly m zeroes. Are you... | [{"type": "stdin_stdout", "input": "43857\n", "output": "5 \n 175440 175441 175442 175443 175444\n"}, {"type": "stdin_stdout", "input": "27438\n", "output": "5 \n 109760 109761 109762 109763 109764\n"}, {"type": "stdin_stdout", "input": "31693\n", "output": "5 \n 126785 126786 126787 126788 126789\n"}, {"type": "stdin_... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nLittle Tanya decided to present her dad a postcard on his Birthday. She has already created a message — string s of length n, consisting of uppercase and lowercase English letters. Tanya can't write yet, so she found a ne... | [{"type": "stdin_stdout", "input": "DpiNBmCRFWxpdbfGOzvvOcemjructoAdEwegTvbVbfWWRPGyEAxGdDRWVlqNyGWMWHMrHAIZpyxvgaflrsVZhhZRouvpxrKXFZam\nwwPLFtNfPtJXvMLuHjKfYyaRhreNSWSzOvDpqHCGcqllACNPGHxReeFUCmAqIKXYytsSQwIxJzNiiUtgebVuwRmWpRALLyKAzyDPvgIGxALSaeeTIqm\n", "output": "66 12\n"}, {"type": "stdin_stdout", "input": "DpiNB... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nThis is related to my other Kata about cats and dogs.\n\n# Kata Task\n\nI have a cat and a dog which I got as kitten / puppy.\n\nI forget when that was, but I do know their current ages as `catYears` and `dogYears`.\n\nFi... | [{"input": "56\n64", "output": "[[10, 10]]", "fn_name": "owned_cat_and_dog"}, {"input": "15\n15", "output": "[[1, 1]]", "fn_name": "owned_cat_and_dog"}, {"input": "18\n21", "output": "[[1, 1]]", "fn_name": "owned_cat_and_dog"}, {"input": "19\n17", "output": "[[1, 1]]", "fn_name": "owned_cat_and_dog"}, {"input": "24\n24... | code_functional |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nIt is Borya's eleventh birthday, and he has got a great present: n cards with numbers. The i-th card has the number a_{i} written on it. Borya wants to put his cards in a row to get one greater number. For example, if Bor... | [{"type": "stdin_stdout", "input": "4\n2\n1 1\n3\n2 31 12\n3\n21646 67 98\n9\n1 2 3 14 4 11 7 8 9\n", "output": "2\n0\n1\n36288\n"}, {"type": "stdin_stdout", "input": "4\n2\n1 1\n3\n1 31 12\n3\n12345 67 84\n9\n1 2 3 4 5 1 7 8 16\n", "output": "2\n2\n2\n36288\n"}, {"type": "stdin_stdout", "input": "4\n2\n1 1\n3\n1 20 12... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nRoma works in a company that sells TVs. Now he has to prepare a report for the last year.\n\nRoma has got a list of the company's incomes. The list is a sequence that consists of n integers. The total income of the compan... | [{"type": "stdin_stdout", "input": "78 13\n-9961 -9922 -9817 -9813 -9521 -9368 -9361 -9207 -9153 -9124 -9008 -8981 -8951 -8911 -8551 -8479 -8245 -8216 -7988 -7841 -7748 -7741 -7734 -7101 -6846 -6804 -6651 -6526 -6519 -6463 -6297 -6148 -6090 -5845 -5209 -5201 -5161 -5061 -4537 -4529 -4433 -4370 -4266 -4189 -4125 -3945 -... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nGiven are 1-digit positive integers a and b. Consider these two strings: the concatenation of b copies of the digit a, and the concatenation of a copies of the digit b. Which of these is lexicographically smaller?\n\n----... | [{"type": "stdin_stdout", "input": "96 1", "output": "111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111\n"}, {"type": "stdin_stdout", "input": "10 40", "output": "10101010101010101010101010101010101010101010101010101010101010101010101010101010\n"}, {"type": "stdin_stdout",... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nIt's now 260 AD. Shapur, being extremely smart, became the King of Persia. He is now called Shapur, His majesty King of kings of Iran and Aniran.\n\nRecently the Romans declared war on Persia. They dreamed to occupy Armen... | [{"type": "stdin_stdout", "input": "17 17\n00000000000000000000000000000000000000000000000000000000000000000000000000000\n", "output": "0\n"}, {"type": "stdin_stdout", "input": "34 17\n00000000000000000000000000000000000000000000000000000000000000000000000000000\n", "output": "0\n"}, {"type": "stdin_stdout", "input": "... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nWe have a board with H horizontal rows and W vertical columns of squares. There is a bishop at the top-left square on this board. How many squares can this bishop reach by zero or more movements?\n\nHere the bishop can on... | [{"type": "stdin_stdout", "input": "1001000000 1000000000", "output": "500500000000000000\n"}, {"type": "stdin_stdout", "input": "1001000000 1100000000", "output": "550550000000000000\n"}, {"type": "stdin_stdout", "input": "1001000010 1100000000", "output": "550550005500000000\n"}, {"type": "stdin_stdout", "input": "10... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nSnuke has N integers: 1,2,\\ldots,N. He will choose K of them and give those to Takahashi.\n\nHow many ways are there to choose K consecutive integers?\n\nConstraints\n\n* All values in input are integers.\n* 1 \\leq K \\... | [{"type": "stdin_stdout", "input": "1 -159", "output": "161\n"}, {"type": "stdin_stdout", "input": "119 -1", "output": "121\n"}, {"type": "stdin_stdout", "input": "2 -107", "output": "110\n"}, {"type": "stdin_stdout", "input": "0 -159", "output": "160\n"}, {"type": "stdin_stdout", "input": "112 -1", "output": "114\n"},... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nSasha grew up and went to first grade. To celebrate this event her mother bought her a multiplication table $M$ with $n$ rows and $n$ columns such that $M_{ij}=a_i \\cdot a_j$ where $a_1, \\dots, a_n$ is some sequence of ... | [{"type": "stdin_stdout", "input": "10\n0 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000\n1000000000 0 1 1 1 1 1 1 1 1\n1000000000 1 0 1 1 1 1 1 1 1\n1000000000 1 1 0 1 1 1 1 1 1\n1000000000 1 1 1 0 1 1 1 1 1\n1000000000 1 1 1 1 0 1 1 1 1\n1000000000 1 1 1 1 1 0 1 1 1... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nYou are given a program that consists of $n$ instructions. Initially a single variable $x$ is assigned to $0$. Afterwards, the instructions are of two types:\n\nincrease $x$ by $1$;\n\ndecrease $x$ by $1$.\n\nYou are give... | [{"type": "stdin_stdout", "input": "2\n8 4\n-+--+--+\n1 8\n2 8\n2 5\n1 1\n4 10\n+-++\n1 1\n1 2\n2 2\n1 3\n2 3\n3 3\n1 4\n2 4\n3 4\n4 4\n", "output": "\n1\n2\n4\n4\n3\n3\n4\n2\n3\n2\n1\n2\n2\n2\n"}, {"type": "stdin_stdout", "input": "2\n8 4\n-+--+--+\n1 8\n2 8\n2 5\n1 1\n4 10\n+-++\n1 1\n1 2\n2 2\n1 3\n2 3\n3 3\n1 4\n2 ... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nDevelopers often face with regular expression patterns. A pattern is usually defined as a string consisting of characters and metacharacters that sets the rules for your search. These patterns are most often used to check... | [{"type": "stdin_stdout", "input": "100\nb?\nb?\nb?\nb?\nb?\nb?\nb?\nb?\nb?\nb?\nb?\nb?\nb?\nb?\nb?\nb?\nb?\nb?\nb?\nb?\nb?\nb?\nb?\nb?\nb?\nb?\nb?\n?b\nb?\nb?\nb?\nb?\nb?\nb?\nb?\nb?\nb?\nb?\nb?\nb?\nb?\nb?\nb?\nb?\nb?\nb?\nb?\nb?\nb?\nb?\nb?\nb?\nb?\nb?\nb?\nb?\nb?\nb?\nb?\nb?\nb?\nb?\nb?\nb?\nb?\nb?\nb?\nb?\nb?\nb?\... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nFedya studies in a gymnasium. Fedya's maths hometask is to calculate the following expression:(1^{n} + 2^{n} + 3^{n} + 4^{n}) mod 5\n\nfor given value of n. Fedya managed to complete the task. Can you? Note that given num... | [{"type": "stdin_stdout", "input": "124356983594583453458888889\n", "output": "0\n"}, {"type": "stdin_stdout", "input": "124356983594583453458888889\n", "output": "0\n"}, {"type": "stdin_stdout", "input": "1134974\n", "output": "0\n"}, {"type": "stdin_stdout", "input": "1236642\n", "output": "0\n"}, {"type": "stdin_std... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nKuroni is very angry at the other setters for using him as a theme! As a punishment, he forced them to solve the following problem:\n\nYou have an array $a$ consisting of $n$ positive integers. An operation consists of ch... | [{"type": "stdin_stdout", "input": "10\n648137704891 648137704891 648137704891 648137704891 648137704891 648137704891 648137704891 648137704891 648137704891 724560300002\n", "output": "2\n"}, {"type": "stdin_stdout", "input": "5\n169999847 169999847 169999847 300469729580 169999847\n", "output": "3\n"}, {"type": "stdin... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nSonya decided to organize an exhibition of flowers. Since the girl likes only roses and lilies, she decided that only these two kinds of flowers should be in this exhibition.\n\nThere are $n$ flowers in a row in the exhib... | [{"type": "stdin_stdout", "input": "1582 10\n587 646\n1148 843\n326 875\n439 485\n465 521\n330 387\n405 480\n477 115\n572 376\n715 771\n", "output": "01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nLong ago, when Petya was a schoolboy, he was very much interested in the Petr# language grammar. During one lesson Petya got interested in the following question: how many different continuous substrings starting with the... | [{"type": "stdin_stdout", "input": "bgphoaomnjcjhgkgbflfclbjmkbfonpbmkdomjmkahaoclcbijdjlllnpfkbilgiiidbabgojbbfmliemhicaanadbaahagmfdldbbklelkihlcbkhchlikhefeeafbhkabfdlhnnjnlimbhneafcfeapcbeifgcnaijdnkjpikedmdbhahhgcijddfmamdiaapaeimdhfblpkedamifbbdndmmljmdcffcpmanndeeclnpnkdoieiahchdnkdmfnbocnimclgckdcbp\npcbeifgcna... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nIn Aizuwakamatsu City, there is a first city called \"Tokaichi\" on January 10th every year. This Tokaichi has a history of about 600 years and is the largest first city in the Aizu region. It is also well known that Okia... | [{"type": "stdin_stdout", "input": "1593 4311\n4321 2155\n1256 11201\n5310 1455\n2152 5421\n1928 3386\n4528 1578\n1234 4321\n3330 3109\n2739 2199\n0 0", "output": "C 12457\nD 6439\n"}, {"type": "stdin_stdout", "input": "1593 4311\n4321 2155\n1256 12219\n5310 1455\n2152 5421\n1549 3288\n4528 3719\n1234 4321\n3330 2166\n... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nLittle Vasya loves orange juice very much. That's why any food and drink in his kitchen necessarily contains orange juice. There are n drinks in his fridge, the volume fraction of orange juice in the i-th drink equals pi ... | [{"type": "stdin_stdout", "input": "100\n100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 101 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nPatrick has just finished writing a message to his sweetheart Stacey when he noticed that the message didn't look fancy. Patrick was nervous while writing the message, so some of the letters there were lowercase and some ... | [{"type": "stdin_stdout", "input": "MMVESdOCALHJCTBTUWWQRGUUVTTTABKKAAdIINAdKLRLLVLODHDXDPMcQfUhPNHFBJSDRGsHZNORSCPNvKOOIuZnZAmTPUCoPNlR\n", "output": "13\n"}, {"type": "stdin_stdout", "input": "MMbJIBhgFXPVpdQHLkWJkAHFIfJSpITTCRzRCzvRPRYECCheOknfINZWuKATDBOrEVKTcWXiYPjtzQMGUSGPNTMCUrvYCSWQHqAi\n", "output": "27\n"}, {... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nThere are N people (with different names) and K clubs. For each club you know the list of members (so you have K unordered lists). Each person can be a member of many clubs (and also 0 clubs) and two different clubs might... | [{"type": "stdin_stdout", "input": "119107271329329921", "output": "-1\n"}, {"type": "stdin_stdout", "input": "33213408621377322", "output": "-1\n"}, {"type": "stdin_stdout", "input": "26939847318901699", "output": "-1\n"}, {"type": "stdin_stdout", "input": "12809773843701327", "output": "-1\n"}, {"type": "stdin_stdout... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nMike received an array $a$ of length $n$ as a birthday present and decided to test how pretty it is.\n\nAn array would pass the $i$-th prettiness test if there is a way to get an array with a sum of elements totaling $s_i... | [{"type": "stdin_stdout", "input": "2\n5 5\n1 2 3 4 5\n1\n5\n9\n12\n6\n5 5\n6 1 3 2 3\n1\n2\n3\n15\n11\n", "output": "Yes\nYes\nYes\nNo\nYes\nYes\nYes\nYes\nYes\nNo\n"}, {"type": "stdin_stdout", "input": "2\n5 5\n1 2 3 4 5\n1\n5\n3\n12\n6\n5 5\n6 1 3 2 3\n1\n2\n3\n15\n11\n", "output": "Yes\nYes\nYes\nNo\nYes\nYes\nYes\... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\n# Task\n Your task is to find the similarity of given sorted arrays `a` and `b`, which is defined as follows: \n \n you take the number of elements which are present in both arrays and divide it by the number of elements ... | [{"input": "[0, 1, 3, 4, 5, 6, 9, 14, 15, 16, 17, 18, 19]\n[1, 4, 10, 12, 13, 14, 15, 16]", "output": "[0.3125]", "fn_name": "similarity"}, {"input": "[1, 2, 6, 8, 9]\n[0, 1, 4, 5, 6, 8, 9]", "output": "[0.5]", "fn_name": "similarity"}, {"input": "[1, 2, 4, 6, 7]\n[2, 3, 4, 7]", "output": "[0.5]", "fn_name": "similarit... | code_functional |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nDolphin resides in two-dimensional Cartesian plane, with the positive x-axis pointing right and the positive y-axis pointing up.\nCurrently, he is located at the point (sx,sy). In each second, he can move up, down, left o... | [{"type": "stdin_stdout", "input": "-49 -32 -1 -4", "output": "UUUUUUUUUUUUUUUUUUUUUUUUUUUURRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRDDDDDDDDDDDDDDDDDDDDDDDDDDDDLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLUUUUUUUUUUUUUUUUUUUUUUUUUUUUURRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRDRDDDDDDDDDDDDDDDDDDDDDDDD... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nYou like playing chess tournaments online.\n\nIn your last tournament you played $n$ games. For the sake of this problem, each chess game is either won or lost (no draws). When you lose a game you get $0$ points. When you... | [{"type": "stdin_stdout", "input": "8\n5 2\nWLWLL\n6 5\nLLLWWL\n7 4\nLWLWLWL\n15 5\nWWWLLLWWWLLLWWW\n40 38\nLLWLWLWWWLWLLWLWWWLWLLWLLWLLLLWLLWWWLWWL\n1 0\nL\n1 0\nL\n6 0\nWLLWLW\n", "output": "7\n11\n13\n26\n79\n0\n0\n3\n"}, {"type": "stdin_stdout", "input": "8\n5 2\nWLWLL\n6 5\nLLLWWL\n7 4\nLWLWLWL\n15 2\nWWWLLLWWWLLL... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nVasya commutes by train every day. There are n train stations in the city, and at the i-th station it's possible to buy only tickets to stations from i + 1 to a_{i} inclusive. No tickets are sold at the last station.\n\nL... | [{"type": "stdin_stdout", "input": "10\n2 10 8 7 8 8 10 9 10\n", "output": "63\n"}, {"type": "stdin_stdout", "input": "10\n2 10 8 7 8 8 10 9 10\n", "output": "63\n"}, {"type": "stdin_stdout", "input": "10\n2 10 8 7 8 9 10 9 10\n", "output": "62\n"}, {"type": "stdin_stdout", "input": "10\n3 10 8 7 8 9 10 9 10\n", "outpu... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nAfter many years of research, Ikta has acquired the ability to predict the future! The time and money he spent on this research was enormous, but it's finally time to be rewarded. To get the money back, Ikta decided to st... | [{"type": "stdin_stdout", "input": "3 3 10\n18 1 13\n15 3 3\n5 10 0", "output": "100\n"}, {"type": "stdin_stdout", "input": "3 3 10\n10 14 13\n14 2 6\n5 4 1", "output": "28\n"}, {"type": "stdin_stdout", "input": "3 3 10\n18 4 13\n15 3 3\n5 11 1", "output": "34\n"}, {"type": "stdin_stdout", "input": "3 3 10\n18 4 13\n15... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nProgrammer Vasya is studying a new programming language &K*. The &K* language resembles the languages of the C family in its syntax. However, it is more powerful, which is why the rules of the actual C-like languages are ... | [{"type": "stdin_stdout", "input": "10\ntypedef &void**** youdyfpinzk\ntypeof &youdyfpinzk***\ntypedef &&&&youdyfpinzk****** nfbsgpjzhxzskmxc\ntypeof nfbsgpjzhxzskmxc***\ntypedef &&&void*** puerqioirikxej\ntypeof &puerqioirikxej********\ntypedef &puerqioirikxej******** xzgzsamjdufuyxz\ntypeof &xzgzsamjdufuyxz******\nty... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nIn the army, it isn't easy to form a group of soldiers that will be effective on the battlefield. The communication is crucial and thus no two soldiers should share a name (what would happen if they got an order that Bob ... | [{"type": "stdin_stdout", "input": "50 2\nYES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES\n", "output": "Ab Ac Ad Ae Af Ag Ah Ai Aj Ak Al Am An Ao Ap Aq Ar As At Au Av Aw A... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nAtCoDeer the deer found two rectangles lying on the table, each with height 1 and width W.\nIf we consider the surface of the desk as a two-dimensional plane, the first rectangle covers the vertical range of [0,1] and the... | [{"type": "stdin_stdout", "input": "-1 -1 100", "output": "102\n"}, {"type": "stdin_stdout", "input": "-1 -1 101", "output": "103\n"}, {"type": "stdin_stdout", "input": "-1 -1 111", "output": "113\n"}, {"type": "stdin_stdout", "input": "0 -116 -1", "output": "115\n"}, {"type": "stdin_stdout", "input": "-2 -1 111", "out... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nStudent Valera is an undergraduate student at the University. His end of term exams are approaching and he is to pass exactly n exams. Valera is a smart guy, so he will be able to pass any exam he takes on his first try. ... | [{"type": "stdin_stdout", "input": "1\n1001000000 999999999\n", "output": "999999999\n"}, {"type": "stdin_stdout", "input": "1\n1101010000 523461264\n", "output": "523461264\n"}, {"type": "stdin_stdout", "input": "1\n1101000000 193606579\n", "output": "193606579\n"}, {"type": "stdin_stdout", "input": "1\n1101000000 142... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nConsider a football tournament where n teams participate. Each team has two football kits: for home games, and for away games. The kit for home games of the i-th team has color x_{i} and the kit for away games of this tea... | [{"type": "stdin_stdout", "input": "30\n25 8\n25 4\n21 9\n25 1\n7 16\n23 21\n22 17\n27 29\n7 29\n20 3\n13 23\n7 13\n16 18\n25 14\n13 17\n28 15\n10 23\n25 18\n2 3\n23 13\n30 8\n13 15\n20 15\n11 29\n10 23\n5 16\n4 14\n4 30\n7 20\n11 1\n", "output": "29 29\n31 27\n29 29\n29 29\n30 28\n30 28\n29 29\n29 29\n29 29\n29 29\n31... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nПрошло много лет, и на вечеринке снова встретились n друзей. С момента последней встречи техника шагнула далеко вперёд, появились фотоаппараты с автоспуском, и теперь не требуется, чтобы один из друзей стоял с фотоаппарат... | [{"type": "stdin_stdout", "input": "42\n13 62\n114 242\n265 839\n756 349\n298 476\n533 704\n348 277\n554 573\n654 112\n429 836\n574 766\n909 415\n163 891\n532 983\n873 457\n719 117\n1 302\n170 634\n166 585\n721 231\n208 609\n128 246\n845 726\n604 119\n859 110\n568 515\n656 913\n113 166\n794 566\n834 860\n983 596\n545 8... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nYou are given n segments on a number line, numbered from 1 to n. The i-th segments covers all integer points from l_i to r_i and has a value w_i.\n\nYou are asked to select a subset of these segments (possibly, all of the... | [{"type": "stdin_stdout", "input": "45 100\n86 90 344\n67 71 63\n84 87 423\n96 98 297\n85 86 144\n75 80 489\n24 25 17\n75 78 363\n1 3 349\n17 19 146\n35 38 39\n90 93 236\n34 35 463\n59 64 259\n97 100 185\n71 75 214\n80 84 124\n63 67 324\n85 88 204\n47 51 420\n22 24 38\n30 34 41\n94 96 42\n3 6 312\n51 56 440\n84 85 337\... | code_stdio |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.