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\nYou are the head of a large enterprise. $n$ people work at you, and $n$ is odd (i. e. $n$ is not divisible by $2$).\n\nYou have to distribute salaries to your employees. Initially, you have $s$ dollars for it, and the $i$... | [{"type": "stdin_stdout", "input": "3\n3 26\n10 12\n1 4\n13 26\n1 1337\n-1 1000000001\n5 26\n4 3\n1 4\n3 7\n2 12\n2 14\n", "output": "12\n1337\n7\n"}, {"type": "stdin_stdout", "input": "3\n3 25\n10 12\n1 4\n10 13\n1 1337\n1 1000000001\n5 26\n4 3\n0 4\n3 11\n2 12\n2 14\n", "output": "12\n1337\n7\n"}, {"type": "stdin_std... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nValery is very interested in magic. Magic attracts him so much that he sees it everywhere. He explains any strange and weird phenomenon through intervention of supernatural forces. But who would have thought that even in ... | [{"type": "stdin_stdout", "input": "150\n0 -2 1 -2 0 0 0 0 -2 0 -2 -1 0 0 2 0 1 -2 1 -1 0 0 0 2 -2 2 -1 0 0 0 -2 0 2 0 1 0 -2 0 -2 -1 -1 -2 -2 2 0 0 1 -2 -2 -1 -2 0 2 1 1 -1 1 0 -2 2 0 0 0 1 -1 0 -2 -1 0 -2 2 1 1 0 0 2 0 0 2 -1 0 0 2 0 2 0 -2 -1 1 -2 1 0 0 -2 -1 -1 0 0 2 -1 -1 -1 -1 -2 0 0 2 -1 -1 1 0 0 1 -1 0 0 -1 2 2... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nOne day Anna got the following task at school: to arrange several numbers in a circle so that any two neighboring numbers differs exactly by 1. Anna was given several numbers and arranged them in a circle to fulfill the t... | [{"type": "stdin_stdout", "input": "50\n363510947 363510954 363510943 363510964 363510969 363510950 363510951 363510960 363510967 363510952 363510956 363510948 363510944 363510946 363510965 363510946 363510963 363510962 363510947 363510955 363510954 363510948 363510961 363510964 363510963 363510945 363510965 363510953 ... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nToday, the memorable AtCoder Beginner Contest 100 takes place. On this occasion, Takahashi would like to give an integer to Ringo.\n\nAs the name of the contest is AtCoder Beginner Contest 100, Ringo would be happy if he ... | [{"type": "stdin_stdout", "input": "9 1", "output": "1000000000000000000\n"}, {"type": "stdin_stdout", "input": "6 40", "output": "40000000000000\n"}, {"type": "stdin_stdout", "input": "7 1", "output": "100000000000000\n"}, {"type": "stdin_stdout", "input": "4 40", "output": "4000000000\n"}, {"type": "stdin_stdout", "i... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\n## Task\n An `ATM` ran out of 10 dollar bills and only has `100, 50 and 20` dollar bills.\n \n Given an amount between `40 and 10000 dollars (inclusive)` and assuming that the ATM wants to use as few bills as possible, de... | [{"input": "250", "output": "[[2, 1, 0]]", "fn_name": "withdraw"}, {"input": "260", "output": "[[2, 0, 3]]", "fn_name": "withdraw"}, {"input": "230", "output": "[[1, 1, 4]]", "fn_name": "withdraw"}, {"input": "40", "output": "[[0, 0, 2]]", "fn_name": "withdraw"}, {"input": "60", "output": "[[0, 0, 3]]", "fn_name": "wit... | code_functional |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nWilbur is playing with a set of n points on the coordinate plane. All points have non-negative integer coordinates. Moreover, if some point (x, y) belongs to the set, then all points (x', y'), such that 0 ≤ x' ≤ x and 0 ≤... | [{"type": "stdin_stdout", "input": "40\n0 0\n0 1\n0 2\n0 3\n0 4\n0 5\n0 6\n0 7\n0 8\n0 9\n0 10\n0 11\n0 12\n1 0\n1 1\n1 2\n1 3\n1 4\n1 5\n1 6\n1 7\n2 0\n3 0\n4 0\n5 0\n6 0\n7 0\n8 0\n9 0\n10 0\n11 0\n12 0\n13 0\n14 0\n15 0\n16 0\n17 0\n18 0\n19 0\n20 0\n0 1 2 -1 -2 3 4 -3 5 6 7 8 0 -4 -5 1 -6 -7 -8 -9 -10 -11 9 2 -12 -... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nOne day Vasya was sitting on a not so interesting Maths lesson and making an origami from a rectangular a mm × b mm sheet of paper (a > b). Usually the first step in making an origami is making a square piece of paper f... | [{"type": "stdin_stdout", "input": "1000000000000 999999999999\n", "output": "1000000000000\n"}, {"type": "stdin_stdout", "input": "1000000000000 999999999999\n", "output": "1000000000000\n"}, {"type": "stdin_stdout", "input": "1000000000000 999999999998\n", "output": "500000000000\n"}, {"type": "stdin_stdout", "input"... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nLittle Petya likes arrays that consist of non-negative integers a lot. Recently his mom has presented him one such array consisting of n elements. Petya immediately decided to find there a segment of consecutive elements,... | [{"type": "stdin_stdout", "input": "99\n3511 2076 9314 3598 7737 271 4110 4454 5830 8661 8584 8227 2236 2626 1025 3806 3162 2837 6071 9627 1836 7729 6629 4054 9377 3261 1325 8859 3610 7616 5052 9736 1249 6224 7031 6074 4196 8075 4005 5419 5664 8214 4391 731 8714 8622 6122 6976 4057 1770 8025 3778 2792 994 5204 1826 608... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nThere is a bus stop near the university. The lessons are over, and n students come to the stop. The i-th student will appear at the bus stop at time ti (all ti's are distinct).\n\nWe shall assume that the stop is located ... | [{"type": "stdin_stdout", "input": "32 5\n15 12\n24 6\n30 13\n35 7\n38 6\n46 6\n47 12\n60 6\n66 9\n71 26\n74 6\n76 15\n104 6\n105 6\n110 15\n124 12\n126 12\n129 9\n131 12\n134 15\n135 15\n141 12\n154 13\n167 9\n171 9\n179 17\n181 15\n185 12\n189 12\n191 6\n192 6\n196 12\n", "output": "53 44 55 47 44 77 86 77 82 101 134... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nA wise man told Kerem \"Different is good\" once, so Kerem wants all things in his life to be different. \n\nKerem recently got a string s consisting of lowercase English letters. Since Kerem likes it when things are diff... | [{"type": "stdin_stdout", "input": "45\naaabbbcccdddeeefffgghhiijjkkkkkkkkkkkkkkkkkkk\n", "output": "-1\n"}, {"type": "stdin_stdout", "input": "45\naaabbbcccdddeeefffgghhiijjkkkkkkkkkkkkkkkkkkk\n", "output": "-1\n"}, {"type": "stdin_stdout", "input": "45\naaabbbcccdedeeefffgghhiijjkkkkkkkkkkkkkkkkkkk\n", "output": "-1\... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nAlice is the leader of the State Refactoring Party, and she is about to become the prime minister. \n\nThe elections have just taken place. There are $n$ parties, numbered from $1$ to $n$. The $i$-th party has received $a... | [{"type": "stdin_stdout", "input": "100\n100 48 48 22 21 27 51 43 53 34 54 37 45 37 27 53 39 53 37 44 55 44 31 36 55 47 45 23 40 32 55 54 40 38 30 25 28 20 39 20 53 50 41 26 29 37 42 55 23 27 51 30 39 50 24 30 22 50 56 32 60 45 50 43 27 25 52 59 47 58 28 56 49 39 33 52 26 46 23 42 45 58 42 50 49 25 28 30 46 43 26 32 40... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\n**Introduction**\n Little Petya very much likes sequences. However, recently he received a sequence as a gift from his mother.\n Petya didn't like it at all! He decided to make a single replacement. After this replacement... | [{"input": "[5, 6, 1, 2, 3, 1, 3, 45, 7, 1000000000]", "output": "[[1, 1, 1, 2, 3, 3, 5, 6, 7, 45]]", "fn_name": "sort_number"}, {"input": "[1, 2, 3, 4, 5]", "output": "[[1, 1, 2, 3, 4]]", "fn_name": "sort_number"}, {"input": "[4, 2, 1, 3, 5]", "output": "[[1, 1, 2, 3, 4]]", "fn_name": "sort_number"}, {"input": "[2, 3,... | code_functional |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nPlaying with Stones\n\nKoshiro and Ukiko are playing a game with black and white stones. The rules of the game are as follows:\n\n1. Before starting the game, they define some small areas and place \"one or more black sto... | [{"type": "stdin_stdout", "input": "4\n24 99\n15 68\n12 155\n95 79", "output": "0\n"}, {"type": "stdin_stdout", "input": "4\n24 99\n15 97\n12 149\n95 79", "output": "0\n"}, {"type": "stdin_stdout", "input": "4\n39 99\n15 97\n12 149\n95 79", "output": "0\n"}, {"type": "stdin_stdout", "input": "4\n24 99\n15 68\n12 90\n95... | 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\nAll Star Code Challenge #18\n\nCreate a function called that accepts 2 string arguments and returns an integer of the count of occurrences the 2nd argument... | [{"input": "\"hello world\"\n\"o\"", "output": "[2]", "fn_name": "str_count"}, {"input": "\"codewars\"\n\"c\"", "output": "[1]", "fn_name": "str_count"}, {"input": "\"hello\"\n\"l\"", "output": "[2]", "fn_name": "str_count"}, {"input": "\"hello\"\n\"e\"", "output": "[1]", "fn_name": "str_count"}, {"input": "\"ggggg\"\n... | code_functional |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nYou are given an array $a$ of $n$ non-negative integers. In one operation you can change any number in the array to any other non-negative integer.\n\nLet's define the cost of the array as $\\operatorname{DIFF}(a) - \\ope... | [{"type": "stdin_stdout", "input": "4\n4 1\n3 0 1 2\n4 1\n0 2 4 5\n7 2\n4 13 0 0 13 1337 1000000000\n6 2\n1 2 8 0 0 0\n", "output": "0\n1\n2\n0\n"}, {"type": "stdin_stdout", "input": "5\n5 1\n1 2 3 4 5\n5 1\n1 2 3 4 5\n5 1\n1 2 3 4 5\n5 1\n1 2 3 4 5\n5 1\n1 2 3 4 5\n", "output": "0\n0\n0\n0\n0\n"}, {"type": "stdin_stdo... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nA text editor is a useful software tool that can help people in various situations including writing and programming. Your job in this problem is to construct an offline text editor, i.e., to write a program that first re... | [{"type": "stdin_stdout", "input": "3\nA sample input\n9\nforward word\ndelete char\nforward word\ndelete char\nforward word\ndelete char\nbackward word\nbackward word\nforward word\nHallow, Word.\n7\nforward char\ndelete word\ninsert \"ello, \"\nforward word\nbackward char\nbackward char\ninsert \"l\"\n\n3\nforward vo... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nPolycarp likes squares and cubes of positive integers. Here is the beginning of the sequence of numbers he likes: $1$, $4$, $8$, $9$, ....\n\nFor a given number $n$, count the number of integers from $1$ to $n$ that Polyc... | [{"type": "stdin_stdout", "input": "20\n1000000000\n1000000000\n1000000000\n1000000000\n1000000000\n1000000000\n1000000000\n1000000000\n1000000000\n1000000000\n1000000000\n1000000000\n1000000000\n1000000000\n1000000000\n1000000000\n1000000000\n1000000000\n1000000000\n1000000000\n", "output": "32591\n32591\n32591\n32591... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nNot so long ago, Vlad came up with an interesting function:\n\n$f_a(x)=\\left\\lfloor\\frac{x}{a}\\right\\rfloor + x mod a$, where $\\left\\lfloor\\frac{x}{a}\\right\\rfloor$ is $\\frac{x}{a}$, rounded down, $x mod a$ — t... | [{"type": "stdin_stdout", "input": "5\n1 4 3\n5 8 4\n6 10 6\n1 1000000000 1000000000\n10 12 8\n", "output": "2\n4\n5\n999999999\n5\n"}, {"type": "stdin_stdout", "input": "3\n1 100 54\n1 100 55\n1 100 56\n", "output": "53\n54\n55\n"}, {"type": "stdin_stdout", "input": "1\n6 999998 9\n", "output": "111118\n"}, {"type": "... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nMr. Chanek has an integer represented by a string $s$. Zero or more digits have been erased and are denoted by the character _. There are also zero or more digits marked by the character X, meaning they're the same digit.... | [{"type": "stdin_stdout", "input": "________\n", "output": "3600000\n"}, {"type": "stdin_stdout", "input": "X_______\n", "output": "3600000\n"}, {"type": "stdin_stdout", "input": "_____X__\n", "output": "3600000\n"}, {"type": "stdin_stdout", "input": "_______X\n", "output": "3600000\n"}, {"type": "stdin_stdout", "input... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nRead problems statements in Mandarin Chinese, Russian and Vietnamese as well. \n\nPrincess Rupsa saw one of her friends playing a special game. The game goes as follows:\n\nN+1 numbers occur sequentially (one at a time) f... | [{"type": "stdin_stdout", "input": "2\n1\n1 0\n2\n10 -1 -1", "output": "0\n999999949\n"}, {"type": "stdin_stdout", "input": "2\n1\n2 4\n2\n1 -1 1", "output": "16\n1000000003\n"}, {"type": "stdin_stdout", "input": "2\n1\n1 2\n2\n1 -1 0", "output": "4\n1000000003\n"}, {"type": "stdin_stdout", "input": "2\n1\n1 2\n2\n1 0 ... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nAizu Gakuen High School holds a school festival every year. The most popular of these is the haunted house. The most popular reason is that 9 classes do haunted houses instead of 1 or 2 classes. Each one has its own uniqu... | [{"type": "stdin_stdout", "input": "1a 132 243\n1c 324 183\n1f 93 199\n2b 372 163\n2c 229 346\n2e 391 206\n3a 118 168\n3b 263 293\n3d 281 102", "output": "1a 375 99300\n1c 507 119700\n1f 292 78300\n2b 535 123300\n2c 575 149600\n2e 597 140000\n3a 286 74000\n3b 556 140500\n3d 383 86800\n"}, {"type": "stdin_stdout", "inpu... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nPetya is preparing for his birthday. He decided that there would be $n$ different dishes on the dinner table, numbered from $1$ to $n$. Since Petya doesn't like to cook, he wants to order these dishes in restaurants.\n\nU... | [{"type": "stdin_stdout", "input": "4\n4\n3 7 4 5\n2 1 2 4\n4\n1 2 3 4\n3 3 3 3\n2\n1 2\n10 10\n2\n10 10\n1 2\n", "output": "5\n3\n2\n3\n"}, {"type": "stdin_stdout", "input": "4\n4\n3 11 4 2\n2 1 2 4\n4\n1 2 3 4\n3 3 3 3\n2\n1 2\n10 10\n2\n10 10\n1 2\n", "output": "3\n3\n2\n3"}, {"type": "stdin_stdout", "input": "4\n4\... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nThere are some stones on Bob's table in a row, and each of them can be red, green or blue, indicated by the characters `R`, `G`, and `B`.\n\nHelp Bob find the minimum number of stones he needs to remove from the table so ... | [{"input": "\"GBRGGRBBBBRRGGGB\"", "output": "[7]", "fn_name": "solution"}, {"input": "\"BGRBBGGBRRR\"", "output": "[4]", "fn_name": "solution"}, {"input": "\"GBBBGGRRGRB\"", "output": "[4]", "fn_name": "solution"}, {"input": "\"RRGGBB\"", "output": "[3]", "fn_name": "solution"}, {"input": "\"RGBRGB\"", "output": "[0]"... | code_functional |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nFor years, the Day of city N was held in the most rainy day of summer. New mayor decided to break this tradition and select a not-so-rainy day for the celebration. The mayor knows the weather forecast for the $n$ days of ... | [{"type": "stdin_stdout", "input": "100 7 7\n1656 322 975 921 115 647 61 232 127 277 839 797 261 968 788 381 191 117 663 959 475 166 471 984 17 473 57 809 65 881 1109 725 587 933 466 537 1017 706 927 173 636 372 644 82 835 893 792 494 808 977 479 109 1858 21 625 104 626 569 524 504 16 257 274 285 404 629 247 609 521 60... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nYou are given n points on a plane. All the points are distinct and no three of them lie on the same line. Find the number of parallelograms with the vertices at the given points.\n\n\n-----Input-----\n\nThe first line of ... | [{"type": "stdin_stdout", "input": "20\n0 17\n1 8\n1 9\n2 5\n2 11\n3 0\n5 10\n5 13\n6 7\n7 3\n12 13\n13 7\n14 16\n15 10\n15 18\n17 2\n17 12\n18 14\n19 18\n20 17\n", "output": "18\n"}, {"type": "stdin_stdout", "input": "20\n0 17\n1 8\n1 9\n2 5\n2 11\n3 0\n5 10\n5 13\n6 7\n7 3\n12 13\n13 7\n14 16\n15 10\n15 18\n17 2\n17 ... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nA well-known art union called \"Kalevich is Alive!\" manufactures objects d'art (pictures). The union consists of n painters who decided to organize their work as follows.\n\nEach painter uses only the color that was assi... | [{"type": "stdin_stdout", "input": "10 3\n6 10 3\n2 7 12\n7 4 7\n10 3 2\n6 5 12\n8 4 4\n5 9 11\n6 7 7\n2 6 10\n2 6 2\n", "output": "19 35 42 44 56 60 71 78 88 90\n"}, {"type": "stdin_stdout", "input": "10 3\n6 10 3\n2 7 12\n7 4 7\n6 3 0\n6 5 12\n8 4 4\n5 15 11\n6 7 3\n2 6 10\n2 6 2\n", "output": "19 35 42 42 54 58 69 7... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nFor some reason in many American cartoons anvils fall from time to time onto heroes' heads. Of course, safes, wardrobes, cruisers, planes fall sometimes too... But anvils do so most of all.\n\nAnvils come in different siz... | [{"type": "stdin_stdout", "input": "90\n1 1\n2 1\n3 1\n4 1\n5 1\n6 1\n7 1\n8 1\n9 1\n1 2\n2 2\n3 2\n4 2\n5 2\n6 2\n7 2\n8 2\n9 2\n1 3\n2 3\n3 3\n4 3\n5 3\n6 3\n7 3\n8 3\n9 3\n1 4\n2 4\n3 4\n4 4\n5 4\n6 4\n7 4\n8 4\n9 4\n1 5\n2 5\n3 5\n4 5\n5 5\n6 5\n7 5\n8 5\n9 5\n1 6\n2 6\n3 6\n4 6\n5 6\n6 6\n7 6\n8 6\n9 6\n1 7\n2 7\n... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nYou are given a simple weighted connected undirected graph, consisting of $n$ vertices and $m$ edges.\n\nA path in the graph of length $k$ is a sequence of $k+1$ vertices $v_1, v_2, \\dots, v_{k+1}$ such that for each $i$... | [{"type": "stdin_stdout", "input": "15 15 23\n13 10 12\n11 14 12\n2 15 5\n4 10 8\n10 2 4\n10 7 5\n3 10 1\n5 6 11\n1 13 8\n9 15 4\n4 2 9\n11 15 1\n11 12 14\n10 8 12\n3 6 11\n", "output": "3250\n"}, {"type": "stdin_stdout", "input": "15 15 23\n13 11 12\n11 14 12\n2 15 5\n4 10 8\n10 2 4\n10 7 5\n3 10 1\n5 6 11\n1 13 8\n9 ... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nThe following problem is well-known: given integers n and m, calculate $2^{n} \\operatorname{mod} m$, \n\nwhere 2^{n} = 2·2·...·2 (n factors), and $x \\operatorname{mod} y$ denotes the remainder of division of x by y.\n\n... | [{"type": "stdin_stdout", "input": "100000000\n100000000\n", "output": "100000000\n"}, {"type": "stdin_stdout", "input": "100000000\n100000000\n", "output": "100000000\n"}, {"type": "stdin_stdout", "input": "100000000\n100001000\n", "output": "100001000\n"}, {"type": "stdin_stdout", "input": "100000000\n110001000\n", "... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nThe R2 company has n employees working for it. The work involves constant exchange of ideas, sharing the stories of success and upcoming challenging. For that, R2 uses a famous instant messaging program Spyke.\n\nR2 has m... | [{"type": "stdin_stdout", "input": "7 6 5\n0 1 0 1 1 1\n0 1 1 0 1 1\n1 0 1 1 1 0\n1 0 1 1 1 1\n1 1 1 1 1 0\n1 1 1 0 1 0\n1 0 1 0 0 0\n4 1\n2 6\n7 3\n7 1\n5 3\n", "output": "1 2 4 4 3 4 2 \n"}, {"type": "stdin_stdout", "input": "7 6 5\n0 1 0 1 1 1\n0 1 1 0 1 1\n1 0 1 1 1 0\n1 0 1 1 1 1\n1 1 1 1 1 0\n1 1 1 0 1 0\n1 0 1 0... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nA classroom in a school has six rows with 3 desks in each row. Two people can use the same desk: one sitting on the left and one sitting on the right. \n\nSome places are already occupied, and some places are vacant. Pety... | [{"type": "stdin_stdout", "input": "..-**-..\n..-**-..\n..-..-..\n..-..-..\n..-..-..\n..-..-..\n", "output": "..-**-..\n..-**-..\n..-..-..\n..-P.-..\n..-..-..\n..-..-..\n"}, {"type": "stdin_stdout", "input": "**-**-**\n**-**-**\n..-**-.*\n**-**-**\n..-..-..\n..-**-..\n", "output": "**-**-**\n**-**-**\n..-**-.*\n**-**-*... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nThe Little Elephant loves to play with color cards.\n\nHe has n cards, each has exactly two colors (the color of the front side and the color of the back side). Initially, all the cards lay on the table with the front sid... | [{"type": "stdin_stdout", "input": "100\n1 2\n2 1\n2 1\n1 2\n1 1\n1 2\n2 1\n1 1\n2 2\n2 1\n2 1\n1 1\n1 1\n2 1\n2 1\n2 1\n2 1\n2 1\n1 1\n2 1\n1 1\n1 1\n2 2\n1 2\n1 2\n1 2\n2 2\n1 2\n1 2\n2 1\n1 2\n2 1\n1 2\n2 2\n1 1\n2 1\n1 2\n2 1\n2 1\n1 2\n2 1\n2 1\n1 2\n2 1\n1 1\n1 2\n1 1\n1 1\n2 2\n2 2\n2 1\n2 1\n1 2\n2 2\n1 1\n2 1\... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nThere is a vampire family of N members. Vampires are also known as extreme gourmets. Of course vampires' foods are human blood. However, not all kinds of blood is acceptable for them. Vampires drink blood that K blood typ... | [{"type": "stdin_stdout", "input": "2 3\n5 4 5\n1 2 3\n3 2 1\n3 5\n1 2 3 4 5\n0 1 -1 1 2\n-1 1 1 2 2\n1 0 3 1 1\n0 0", "output": "Yes\nYes\n"}, {"type": "stdin_stdout", "input": "2 3\n5 4 5\n1 2 3\n3 2 1\n3 5\n1 2 3 7 5\n0 1 -1 1 2\n-1 1 1 2 2\n1 0 3 1 1\n0 0", "output": "Yes\nYes\n"}, {"type": "stdin_stdout", "input":... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nLong time ago there was a symmetric array $a_1,a_2,\\ldots,a_{2n}$ consisting of $2n$ distinct integers. Array $a_1,a_2,\\ldots,a_{2n}$ is called symmetric if for each integer $1 \\le i \\le 2n$, there exists an integer $... | [{"type": "stdin_stdout", "input": "6\n2\n8 12 8 12\n2\n7 7 9 11\n2\n7 11 7 11\n1\n1 1\n4\n40 56 48 40 160 56 117 48\n6\n240 154 210 162 174 154 186 240 174 186 162 210\n", "output": "YES\nNO\nNO\nNO\nNO\nYES\n"}, {"type": "stdin_stdout", "input": "6\n2\n8 12 8 12\n2\n7 7 9 11\n2\n0 11 7 11\n1\n1 1\n4\n40 56 48 40 160 ... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nYou are given an array consisting of $n$ integers $a_1, a_2, \\dots , a_n$ and an integer $x$. It is guaranteed that for every $i$, $1 \\le a_i \\le x$.\n\nLet's denote a function $f(l, r)$ which erases all values such th... | [{"type": "stdin_stdout", "input": "100 100\n98 52 63 2 18 96 31 58 84 40 41 45 66 100 46 71 26 48 81 20 73 91 68 76 13 93 17 29 64 95 79 21 55 75 19 85 54 51 89 78 15 87 43 59 36 1 90 35 65 56 62 28 86 5 82 49 3 99 33 9 92 32 74 69 27 22 77 16 44 94 34 6 57 70 23 12 61 25 8 11 67 47 83 88 10 14 30 7 97 60 42 37 24 38 ... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nThe princess is going to escape the dragon's cave, and she needs to plan it carefully.\n\nThe princess runs at vp miles per hour, and the dragon flies at vd miles per hour. The dragon will discover the escape after t hour... | [{"type": "stdin_stdout", "input": "2\n100\n10\n10\n739\n", "output": "22\n"}, {"type": "stdin_stdout", "input": "1\n100\n1\n1\n1000\n", "output": "152\n"}, {"type": "stdin_stdout", "input": "2\n100\n13\n10\n739\n", "output": "22\n"}, {"type": "stdin_stdout", "input": "1\n100\n2\n1\n1000\n", "output": "151\n"}, {"type"... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nWrite a function that takes one or more arrays and returns a new array of unique values in the order of the original provided arrays.\n\nIn other words, all values present from all arrays should be included in their origi... | [{"input": "[1, 3, 2]\n[5, 2, 1, 4]\n[2, 1]", "output": "[[1, 3, 2, 5, 4]]", "fn_name": "unite_unique"}, {"input": "[]\n[1, 2, 1, 2]\n[2, 1, 1, 2, 1]", "output": "[[1, 2]]", "fn_name": "unite_unique"}, {"input": "[]\n[4, \"a\", 2]\n[]", "output": "[[4, \"a\", 2]]", "fn_name": "unite_unique"}, {"input": "[1, 2]\n[3, 4]"... | code_functional |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nKana was just an ordinary high school girl before a talent scout discovered her. Then, she became an idol. But different from the stereotype, she is also a gameholic. \n\nOne day Kana gets interested in a new adventure ga... | [{"type": "stdin_stdout", "input": "7\n100 3 2\n189 3 4\n28 2 3\n63 2 3\n30 27 14\n10 9 1\n69117 21 2\n", "output": "NO\nNO\nYES\nYES\nYES\nYES\nYES\n"}, {"type": "stdin_stdout", "input": "7\n100 3 2\n189 4 4\n64 2 3\n18 2 3\n19 27 14\n10 9 1\n69117 21 2\n", "output": "NO\nYES\nNO\nYES\nYES\nYES\nYES\n"}, {"type": "std... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nQuite recently a creative student Lesha had a lecture on trees. After the lecture Lesha was inspired and came up with the tree of his own which he called a k-tree.\n\nA k-tree is an infinite rooted tree where:\n\n each v... | [{"type": "stdin_stdout", "input": "100 100 1\n", "output": "988185646\n"}, {"type": "stdin_stdout", "input": "100 50 50\n", "output": "661237556\n"}, {"type": "stdin_stdout", "input": "100 13 11\n", "output": "883875774\n"}, {"type": "stdin_stdout", "input": "90 100 30\n", "output": "697322870\n"}, {"type": "stdin_std... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\n[Image] \n\nAs some of you know, cubism is a trend in art, where the problem of constructing volumetrical shape on a plane with a combination of three-dimensional geometric shapes comes to the fore. \n\nA famous sculptor ... | [{"type": "stdin_stdout", "input": "53\n1014364 40727 75774 243769 314 406417 5272684 14138 10640282 64955 2763 5667043 2121887 204672692 567643 60183 5183 11361359 2792918 199155 174809 16182540 21 392221 19434423 9140891 159733 15438 67903 3816799 616 429181 30392293 413992581 10847741 20771 16366654 1163 414283 1561... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nCreate a program that reads poker hand data and outputs the role for each. However, this issue follows the rules below.\n\n* Poker is a competition with 5 playing cards.\n* No more than 5 cards with the same number.\n* Th... | [{"type": "stdin_stdout", "input": "1,2,4,3,1\n3,3,1,3,12\n12,13,11,12,12\n7,6,7,6,7\n3,3,2,3,3\n6,7,8,9,10\n11,13,11,1,13\n11,12,13,1,1", "output": "one pair\nthree card\nthree card\nfull house\nfour card\nstraight\ntwo pair\none pair\n"}, {"type": "stdin_stdout", "input": "1,2,3,4,1\n2,3,1,3,12\n12,13,11,12,12\n7,6,7... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nDescription\n\nTHE BY DOLM @ STER is a training simulation game scheduled to be released on EXIDNA by 1rem on April 1, 2010. For the time being, it probably has nothing to do with an arcade game where the network connecti... | [{"type": "stdin_stdout", "input": "3 10\nDobkeradops\n7 5 23 10\nPataPata\n1 0 2 1\ndop\n1 7 11 21\n2 300\nBydp System ahplA\n2 11 4 7\nGreen Inferno\n300 300 300 300", "output": "210\n1650\n"}, {"type": "stdin_stdout", "input": "3 10\nDobkeradops\n7 5 23 10\nPataPata\n1 1 2 1\ndop\n1 7 11 14\n2 300\nBydp System Alpha... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nTokitsukaze and CSL are playing a little game of stones.\n\nIn the beginning, there are $n$ piles of stones, the $i$-th pile of which has $a_i$ stones. The two players take turns making moves. Tokitsukaze moves first. On ... | [{"type": "stdin_stdout", "input": "14\n9 9 1000 2000 39999 48888 16 32 123456 959658 111 987584 125632 125468\n", "output": "sjfnb\n"}, {"type": "stdin_stdout", "input": "14\n9 9 1000 2000 39999 48888 16 32 123456 959658 111 987584 125632 125477\n", "output": "cslnb\n"}, {"type": "stdin_stdout", "input": "14\n9 9 1000... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nIn this kata you need to create a function that takes a 2D array/list of non-negative integer pairs and returns the sum of all the \"saving\" that you can have getting the [LCM](https://en.wikipedia.org/wiki/Least_common_... | [{"input": "[[20, 50], [10, 10], [50, 20]]", "output": "[1890]", "fn_name": "sum_differences_between_products_and_LCMs"}, {"input": "[[15, 18], [4, 5], [12, 60]]", "output": "[840]", "fn_name": "sum_differences_between_products_and_LCMs"}, {"input": "[[1, 1], [0, 0], [13, 91]]", "output": "[1092]", "fn_name": "sum_diff... | code_functional |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nThis is yet another problem on regular bracket sequences.\n\nA bracket sequence is called regular, if by inserting \"+\" and \"1\" into it we get a correct mathematical expression. For example, sequences \"(())()\", \"()\... | [{"type": "stdin_stdout", "input": "(?(((???))(??)?)?))))(?)????(()()???(?)????(??(??????)()(????(?)))))??(???(??)?(??)????????(????(?()\n39 78\n1 83\n2 35\n28 89\n53 53\n96 67\n16 46\n43 28\n25 73\n8 97\n57 41\n15 25\n47 49\n23 18\n97 77\n38 33\n68 80\n38 98\n62 8\n61 79\n84 50\n71 48\n12 16\n97 95\n16 70\n72 58\n55 8... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nThe clique problem is one of the most well-known NP-complete problems. Under some simplification it can be formulated as follows. Consider an undirected graph G. It is required to find a subset of vertices C of the maximu... | [{"type": "stdin_stdout", "input": "12\n66 4\n12 4\n60 4\n24 4\n48 4\n0 4\n36 4\n30 4\n6 4\n54 4\n42 4\n18 4\n", "output": "6\n"}, {"type": "stdin_stdout", "input": "12\n66 4\n12 4\n60 4\n24 4\n48 4\n0 4\n36 4\n30 4\n6 4\n54 4\n42 4\n18 4\n", "output": "6"}, {"type": "stdin_stdout", "input": "12\n66 4\n12 4\n60 4\n24 4... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nNot to be confused with chessboard.\n\n [Image] \n\n\n-----Input-----\n\nThe first line of input contains a single integer N (1 ≤ N ≤ 100) — the number of cheeses you have.\n\nThe next N lines describe the cheeses you hav... | [{"type": "stdin_stdout", "input": "42\nquxukow soft\nwcn soft\npbwg soft\nlrp hard\nphdvfz soft\nidkvymji soft\nobq soft\nyhx soft\nijygw soft\nztzz soft\nuwdhnwu soft\ndgnuuej hard\nhntyyzr soft\nqxf hard\nztg soft\nhnpq soft\nuhznu soft\nitelgl hard\nggceadhw hard\nrxq soft\nkznmshem hard\nlri hard\ndalh soft\ngyzzu... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nIf we multiply the integer `717 (n)` by `7 (k)`, the result will be equal to `5019`.\n\nConsider all the possible ways that this last number may be split as a string and calculate their corresponding sum obtained by ... | [{"input": "1611\n3", "output": "[1989]", "fn_name": "next_higher"}, {"input": "100\n3", "output": "[162]", "fn_name": "next_higher"}, {"input": "200\n4", "output": "[260]", "fn_name": "next_higher"}, {"input": "300\n5", "output": "[846]", "fn_name": "next_higher"}, {"input": "500\n7", "output": "[717]", "fn_name": "ne... | code_functional |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nWarawreh created a great company called Nanosoft. The only thing that Warawreh still has to do is to place a large picture containing its logo on top of the company's building.\n\nThe logo of Nanosoft can be described as ... | [{"type": "stdin_stdout", "input": "8 8 8\nRRRRGGGG\nRRRRGGGG\nRRRRGGGG\nRRRRGGGG\nYYYYBBBB\nYYYYBBBB\nYYYYBBBB\nYYYYBBBB\n1 1 8 8\n5 2 5 7\n3 1 8 6\n2 3 5 8\n1 2 6 8\n2 1 5 5\n2 1 7 7\n6 5 7 5\n", "output": "64\n0\n16\n4\n16\n4\n36\n0\n"}, {"type": "stdin_stdout", "input": "8 8 8\nRRRRGGGG\nRRRRGGGG\nRRRRGGGG\nRRRRGGG... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nLet us call two integers $x$ and $y$ adjacent if $\\frac{lcm(x, y)}{gcd(x, y)}$ is a perfect square. For example, $3$ and $12$ are adjacent, but $6$ and $9$ are not.\n\nHere $gcd(x, y)$ denotes the greatest common divisor... | [{"type": "stdin_stdout", "input": "1\n40\n1 1 5 6 2 10 12 10 4 2 17 18 6 3 1 4 1 1 7 2 9 10 3 2 4 1 9 1 1 4 2 7 8 1 7 9 2 17 7 2\n40\n1\n10\n1\n9\n0\n12\n9\n2\n1\n5\n13\n7\n3\n10\n4\n5\n0\n9\n0\n8\n5\n5\n3\n0\n6\n9\n1\n10\n13\n8\n3\n1\n2\n2\n7\n2\n2\n8\n4\n1\n", "output": "24\n24\n24\n24\n16\n24\n24\n24\n24\n24\n24\n2... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nIgor found out discounts in a shop and decided to buy n items. Discounts at the store will last for a week and Igor knows about each item that its price now is a_{i}, and after a week of discounts its price will be b_{i}.... | [{"type": "stdin_stdout", "input": "50 45\n80 125 152 122 85 62 123 195 157 73 8 127 47 193 70 132 131 38 98 115 185 98 68 166 114 53 144 106 141 106 191 123 44 199 35 18 84 169 46 52 129 102 155 130 63 169 116 145 154 41\n155 187 79 106 136 173 17 146 9 47 173 21 37 183 110 74 185 14 82 156 147 25 162 195 26 25 22 80 ... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nYou are given two arrays of length $n$: $a_1, a_2, \\dots, a_n$ and $b_1, b_2, \\dots, b_n$.\n\nYou can perform the following operation any number of times:\n\nChoose integer index $i$ ($1 \\le i \\le n$);\n\nSwap $a_i$ a... | [{"type": "stdin_stdout", "input": "3\n4\n3 3 10 10\n10 10 3 3\n5\n1 2 3 4 5\n6 7 8 9 10\n6\n72 101 108 108 111 44\n10 87 111 114 108 100\n", "output": "0\n8\n218\n"}, {"type": "stdin_stdout", "input": "1\n10\n12345 12345 12345 12345 12345 12345 12345 12345 12345 12345\n1 1 1 1 11 1 1 1 11 1\n", "output": "40\n"}, {"ty... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nWe have A cards, each of which has an integer 1 written on it. Similarly, we also have B cards with 0s and C cards with -1s.\nWe will pick up K among these cards. What is the maximum possible sum of the numbers written on... | [{"type": "stdin_stdout", "input": "206383196 349216559 1444400245 1999999999\n", "output": "-1238017048\n"}, {"type": "stdin_stdout", "input": "206383196 349216559 1444400245 2000000000\n", "output": "-1238017049\n"}, {"type": "stdin_stdout", "input": "1000000000 199342280 739321284 1199342280\n", "output": "100000000... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nThere are $n$ seats in the train's car and there is exactly one passenger occupying every seat. The seats are numbered from $1$ to $n$ from left to right. The trip is long, so each passenger will become hungry at some mom... | [{"type": "stdin_stdout", "input": "100 1000000000\n12 803 439 1031 435 300 497 520 718 573 782 523 328 88 275 159 128 389 920 869 503 80 490 289 22 889 353 799 29 131 1138 123 405 221 727 135 248 348 299 833 19 943 471 410 635 626 784 1205 213 724 550 437 860 536 718 173 406 832 520 748 512 29 466 982 574 848 11 693 9... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nAlice got many presents these days. So she decided to pack them into boxes and send them to her friends.\n\nThere are $n$ kinds of presents. Presents of one kind are identical (i.e. there is no way to distinguish two gift... | [{"type": "stdin_stdout", "input": "1000000000 1000000000\n", "output": "751201557\n"}, {"type": "stdin_stdout", "input": "1000000000 1000000000\n", "output": "751201557"}, {"type": "stdin_stdout", "input": "534571158 222043261\n", "output": "212941625\n"}, {"type": "stdin_stdout", "input": "922338645 900544285\n", "ou... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nYou are given several queries. Each query consists of three integers $p$, $q$ and $b$. You need to answer whether the result of $p/q$ in notation with base $b$ is a finite fraction.\n\nA fraction in notation with base $b$... | [{"type": "stdin_stdout", "input": "11\n1 1000000000000000000 10000000\n4 692 9\n1 2272 333111\n1 9 7\n25 31 1\n13 906830565560158478 22\n1971402979058461 750473176484995605 54\n14 19 23\n4 42409608949005314 23\n3 21914624432020321 46\n3 21914624432020321 47\n", "output": "Finite\nInfinite\nInfinite\nInfinite\nInfinite... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nYou know that the Martians use a number system with base k. Digit b (0 ≤ b < k) is considered lucky, as the first contact between the Martians and the Earthlings occurred in year b (by Martian chronology).\n\nA digital ro... | [{"type": "stdin_stdout", "input": "11 1 199\n10 1 2 1 6 2 0 1 9 9 0 5 5 4 0 1 8 7 7 5 2 5 6 10 7 1 6 8 0 8 10 9 1 8 1 6 1 3 6 1 9 0 5 3 6 8 7 5 10 1 1 10 1 6 10 8 10 10 9 1 3 10 2 3 8 10 6 1 7 7 10 5 2 2 7 2 0 2 1 8 6 5 9 6 7 10 2 9 1 4 2 4 5 4 1 5 6 1 1 1 5 2 6 8 8 3 8 6 5 4 2 1 6 5 0 6 5 4 3 7 4 7 6 8 6 6 6 4 10 4 6... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nGoa'uld Apophis captured Jack O'Neill's team again! Jack himself was able to escape, but by that time Apophis's ship had already jumped to hyperspace. But Jack knows on what planet will Apophis land. In order to save his ... | [{"type": "stdin_stdout", "input": "8 10\n1 2 3\n2 8 3\n1 4 1\n4 3 6\n3 7 7\n4 5 5\n5 7 2\n7 8 1\n1 6 8\n6 8 7\n0\n4 1 2 3 4\n0\n0\n0\n0\n0\n0\n", "output": " 8"}, {"type": "stdin_stdout", "input": "7 6\n1 2 1\n1 3 2\n2 4 3\n2 5 4\n3 5 6\n3 6 7\n0\n3 1 2 3\n... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nYou are given integers N and M.\nConsider a sequence a of length N consisting of positive integers such that a_1 + a_2 + ... + a_N = M. Find the maximum possible value of the greatest common divisor of a_1, a_2, ..., a_N.... | [{"type": "stdin_stdout", "input": "000001 1010001101", "output": "1010001101\n"}, {"type": "stdin_stdout", "input": "000001 1010011101", "output": "1010011101\n"}, {"type": "stdin_stdout", "input": "000001 1110110010", "output": "1110110010\n"}, {"type": "stdin_stdout", "input": "000001 1110111010", "output": "1110111... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nLet's define $S(x)$ to be the sum of digits of number $x$ written in decimal system. For example, $S(5) = 5$, $S(10) = 1$, $S(322) = 7$.\n\nWe will call an integer $x$ interesting if $S(x + 1) < S(x)$. In each test you wi... | [{"type": "stdin_stdout", "input": "5\n1\n10\n16\n178\n276008776\n", "output": "0\n1\n1\n17\n27600877\n"}, {"type": "stdin_stdout", "input": "5\n0\n16\n16\n178\n164382836\n", "output": "0\n1\n1\n17\n16438283\n"}, {"type": "stdin_stdout", "input": "5\n0\n27\n3\n128\n880055535\n", "output": "0\n2\n0\n12\n88005553\n"}, {"... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nGiven an array of numbers, return the difference between the largest and smallest values. \n\nFor example:\n\n`[23, 3, 19, 21, 16]` should return `20` (i.e., `23 - 3`).\n\n`[1, 434, 555, 34, 112]` should return `554` (i.e... | [{"input": "[21, 34, 54, 43, 26, 12]", "output": "[42]", "fn_name": "between_extremes"}, {"input": "[-1, -41, -77, -100]", "output": "[99]", "fn_name": "between_extremes"}, {"input": "[-1, -1]", "output": "[0]", "fn_name": "between_extremes"}, {"input": "[1, -1]", "output": "[2]", "fn_name": "between_extremes"}, {"inpu... | code_functional |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nThe alphabetized kata\n---------------------\n\nRe-order the characters of a string, so that they are concatenated into a new string in \"case-insensitively-alphabetical-order-of-appearance\" order. Whitespace and punctua... | [{"input": "\" a b c d e f g h i j k l m n o p q r s t u v w x y z A B C D E F G H I J K L M N O P Q R S T U V W X Y Z\"", "output": "[\"aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ\"]", "fn_name": "alphabetized"}, {"input": "\"CodeWars can't Load Today\"", "output": "[\"aaaaCcdddeLnooorstTWy\"]", "fn_name": "a... | code_functional |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nSomeone give a strange birthday present to Ivan. It is hedgehog — connected undirected graph in which one vertex has degree at least $3$ (we will call it center) and all other vertices has degree 1. Ivan thought that hedg... | [{"type": "stdin_stdout", "input": "33 2\n3 13\n17 3\n2 6\n5 33\n4 18\n1 2\n31 5\n4 19\n3 16\n1 3\n9 2\n10 3\n5 1\n5 28\n21 4\n7 2\n1 4\n5 24\n30 5\n14 3\n3 11\n27 5\n8 2\n22 4\n12 3\n20 4\n26 5\n4 23\n32 5\n25 5\n15 3\n29 5\n", "output": "Yes\n"}, {"type": "stdin_stdout", "input": "33 2\n3 13\n17 3\n2 6\n5 33\n4 18\n1... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nButCoder Inc. runs a programming competition site called ButCoder. In this site, a user is given an integer value called rating that represents his/her skill, which changes each time he/she participates in a contest. The ... | [{"type": "stdin_stdout", "input": "1110010000100001010 -1 -2", "output": "2220020000200002023\n"}, {"type": "stdin_stdout", "input": "1110010000100001010 -1 -3", "output": "1110010000100001013\n"}, {"type": "stdin_stdout", "input": "1100000010001000010 -1 -10", "output": "244444446666888893\n"}, {"type": "stdin_stdout... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nA tree is a connected graph without cycles. A rooted tree has a special vertex called the root. The parent of a vertex $v$ (different from root) is the previous to $v$ vertex on the shortest path from the root to the vert... | [{"type": "stdin_stdout", "input": "5\n7\n1 2\n1 3\n1 7\n1 5\n2 6\n4 7\n6\n1 2\n1 3\n2 4\n2 5\n3 6\n2\n1 2\n7\n6 3\n1 5\n1 3\n4 6\n4 7\n2 1\n5\n2 1\n2 3\n4 5\n3 4\n3 11\n", "output": "2\n2\n1\n2\n1\n"}, {"type": "stdin_stdout", "input": "5\n7\n1 2\n1 3\n1 4\n2 5\n2 6\n4 7\n6\n1 2\n1 3\n2 4\n2 5\n3 6\n2\n1 2\n7\n6 3\n1 ... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nYou have been assigned to develop a filter for bad messages in the in-game chat. A message is a string $S$ of length $n$, consisting of lowercase English letters and characters ')'. The message is bad if the number of cha... | [{"type": "stdin_stdout", "input": "5\n2\n))\n12\ngl))hf))))))\n9\ngege)))))\n14\n)aa))b))))))))\n1\n)\n", "output": "Yes\nNo\nYes\nYes\nYes\n"}, {"type": "stdin_stdout", "input": "2\n6\naaaaa)\n6\n))))))\n", "output": "No\nYes\n"}, {"type": "stdin_stdout", "input": "1\n10\nsa)ttttttt\n", "output": "No\n"}, {"type": "s... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nImplement a function, so it will produce a sentence out of the given parts.\n\nArray of parts could contain:\n- words;\n- commas in the middle;\n- multiple periods at the end.\n\nSentence making rules:\n- there must alway... | [{"input": "[\"The\", \"Earth\", \"rotates\", \"around\", \"The\", \"Sun\", \"in\", \"365\", \"days\", \",\", \"I\", \"know\", \"that\", \".\", \".\", \".\", \".\", \".\", \".\", \".\", \".\", \".\", \".\", \".\", \".\"]", "output": "[\"The Earth rotates around The Sun in 365 days, I know that.\"]", "fn_name": "make_se... | code_functional |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nYou are given n integers a_1, a_2, ..., a_{n}. Find the number of pairs of indexes i, j (i < j) that a_{i} + a_{j} is a power of 2 (i. e. some integer x exists so that a_{i} + a_{j} = 2^{x}).\n\n\n-----Input-----\n\nThe f... | [{"type": "stdin_stdout", "input": "100\n3 6 12 1 16 4 9 5 4 4 5 8 12 4 6 14 5 1 2 2 2 1 7 1 9 10 1 13 7 8 3 11 8 11 7 5 15 6 14 10 4 2 10 9 1 8 14 10 5 11 3 4 1 12 6 14 13 4 8 5 4 13 13 1 3 9 14 7 14 10 7 3 12 8 9 8 6 15 9 10 12 14 15 4 16 8 8 4 8 7 5 10 16 4 10 13 6 16 16 5\n", "output": "536\n"}, {"type": "stdin_std... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nSnuke has decided to play with a six-sided die. Each of its six sides shows an integer 1 through 6, and two numbers on opposite sides always add up to 7.\n\nSnuke will first put the die on the table with an arbitrary side... | [{"type": "stdin_stdout", "input": "86483718001", "output": "15724312364\n"}, {"type": "stdin_stdout", "input": "79402108049", "output": "14436746918\n"}, {"type": "stdin_stdout", "input": "59146214190", "output": "10753857126\n"}, {"type": "stdin_stdout", "input": "149696127901", "output": "27217477801"}, {"type": "st... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nA pair of positive integers $(a,b)$ is called special if $\\lfloor \\frac{a}{b} \\rfloor = a mod b$. Here, $\\lfloor \\frac{a}{b} \\rfloor$ is the result of the integer division between $a$ and $b$, while $a mod b$ is its... | [{"type": "stdin_stdout", "input": "9\n3 6\n1 101\n11 6\n50 3\n12 4\n69 420\n12345 6789\n123456 789\n29238676 9\n", "output": "1\n0\n7\n3\n5\n141\n53384\n160909\n36\n"}, {"type": "stdin_stdout", "input": "9\n3 4\n1 100\n4 6\n20 3\n19 4\n69 420\n12345 10703\n123456 789\n16177647 9\n", "output": "1\n0\n2\n3\n6\n141\n5729... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nHeidi the Cow is aghast: cracks in the northern Wall? Zombies gathering outside, forming groups, preparing their assault? This must not happen! Quickly, she fetches her HC^2 (Handbook of Crazy Constructions) and looks for... | [{"type": "stdin_stdout", "input": "350000 140000\n", "output": "453366\n"}, {"type": "stdin_stdout", "input": "350000 160000\n", "output": "155549\n"}, {"type": "stdin_stdout", "input": "350000 180000\n", "output": "708073\n"}, {"type": "stdin_stdout", "input": "350000 200000\n", "output": "504934\n"}, {"type": "stdin... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nThis kata is part of the collection [Mary's Puzzle Books](https://www.codewars.com/collections/marys-puzzle-books).\n\n# Zero Terminated Sum\n\nMary has another puzzle book, and it's up to you to help her out! This book i... | [{"input": "\"72102450111111090\"", "output": "[11]", "fn_name": "largest_sum"}, {"input": "\"4755843230\"", "output": "[41]", "fn_name": "largest_sum"}, {"input": "\"3388049750\"", "output": "[25]", "fn_name": "largest_sum"}, {"input": "\"3902864190\"", "output": "[30]", "fn_name": "largest_sum"}, {"input": "\"4098611... | code_functional |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nTwo players play a game. The game is played on a rectangular board with n × m squares. At the beginning of the game two different squares of the board have two chips. The first player's goal is to shift the chips to the s... | [{"type": "stdin_stdout", "input": "100 100 1 1 100 100\n", "output": "Second\n"}, {"type": "stdin_stdout", "input": "100 100 10 10 13 14\n", "output": "Second\n"}, {"type": "stdin_stdout", "input": "110 100 1 1 100 100\n", "output": "Second\n"}, {"type": "stdin_stdout", "input": "99 100 24 1 24 100\n", "output": "Seco... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nGeneralized leap year\n\nNormally, whether or not the year x is a leap year is defined as follows.\n\n1. If x is a multiple of 400, it is a leap year.\n2. Otherwise, if x is a multiple of 100, it is not a leap year.\n3. O... | [{"type": "stdin_stdout", "input": "3 295 2014\n695\n100\n4\n1 1000 1999\n1\n2 1111 4526\n1\n2\n6 2000 3409\n5\n11\n21\n9\n3\n13\n0 0 0", "output": "414\n1000\n3416\n1159\n"}, {"type": "stdin_stdout", "input": "3 295 2014\n695\n100\n4\n1 1000 1999\n1\n2 1111 4526\n1\n2\n6 2000 3409\n9\n11\n21\n9\n3\n13\n0 0 0", "output... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nA Hitachi string is a concatenation of one or more copies of the string `hi`.\n\nFor example, `hi` and `hihi` are Hitachi strings, while `ha` and `hii` are not.\n\nGiven a string S, determine whether S is a Hitachi string... | [{"type": "stdin_stdout", "input": "hhhi", "output": "No\n"}, {"type": "stdin_stdout", "input": "hhhj", "output": "No\n"}, {"type": "stdin_stdout", "input": "jhhh", "output": "No\n"}, {"type": "stdin_stdout", "input": "hjhh", "output": "No\n"}, {"type": "stdin_stdout", "input": "gjhh", "output": "No\n"}, {"type": "stdi... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nMister B once received a gift: it was a book about aliens, which he started read immediately. This book had c pages.\n\nAt first day Mister B read v_0 pages, but after that he started to speed up. Every day, starting from... | [{"type": "stdin_stdout", "input": "1000 500 500 1000 499\n", "output": "501\n"}, {"type": "stdin_stdout", "input": "1000 500 500 1000 499\n", "output": "501\n"}, {"type": "stdin_stdout", "input": "1000 999 1000 1000 998\n", "output": "2\n"}, {"type": "stdin_stdout", "input": "1000 999 1000 1000 998\n", "output": "2\n"... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nBinary with 0 and 1 is good, but binary with only 0 is even better! Originally, this is a concept designed by Chuck Norris to send so called unary messages.\n\nCan you write a program that can send and receive this messag... | [{"input": "\"Chuck Norris' keyboard has 2 keys: 0 and white space.\"", "output": "[\"0 0 00 0000 0 0000 00 0 0 0 00 000 0 000 00 0 0 0 00 0 0 000 00 000 0 0000 00 0 0 0 00 0 0 00 00 0 0 0 00 00000 0 0 00 00 0 000 00 0 0 00 00 0 0 0000000 00 00 0 0 00 0 0 000 00 00 0 0 00 0 0 00 00 0 0 0 00 00 0 0000 00 00 0 00 00 0 0 ... | code_functional |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nThere is a country with n citizens. The i-th of them initially has a_{i} money. The government strictly controls the wealth of its citizens. Whenever a citizen makes a purchase or earns some money, they must send a receip... | [{"type": "stdin_stdout", "input": "10\n7 9 4 4 7 6 3 7 9 8\n10\n1 3 2\n1 10 5\n1 5 3\n1 5 2\n1 2 9\n1 2 9\n1 2 10\n1 5 7\n1 6 10\n1 10 9\n", "output": "7 10 2 4 7 10 3 7 9 9\n"}, {"type": "stdin_stdout", "input": "10\n7 9 4 4 7 6 3 7 9 8\n10\n1 3 2\n1 10 5\n1 5 3\n1 5 2\n1 2 9\n1 2 7\n1 2 10\n1 5 7\n1 6 10\n1 10 9\n",... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nA car moves from point A to point B at speed v meters per second. The action takes place on the X-axis. At the distance d meters from A there are traffic lights. Starting from time 0, for the first g seconds the green lig... | [{"type": "stdin_stdout", "input": "1001 999 1000 1000 1000\n", "output": "1.00100000\n"}, {"type": "stdin_stdout", "input": "29 12 569 939 259\n", "output": "0.0509666080844\n"}, {"type": "stdin_stdout", "input": "714 474 124 205 491\n", "output": "5.75806451613\n"}, {"type": "stdin_stdout", "input": "772 467 142 356 ... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nOne day Alex decided to remember childhood when computers were not too powerful and lots of people played only default games. Alex enjoyed playing Minesweeper that time. He imagined that he saved world from bombs planted ... | [{"type": "stdin_stdout", "input": "21 10\n62637783*1\n23*51**531\n35*7*6.**.\n.*3***581*\n2.32*745**\n83*7*6*6*5\n*74.**6**3\n323*6**7*6\n3454*67.*1\n**63265*6*\n3725*4553*\n24****5**4\n23.34****4\n55257*1*4*\n4*3253*456\n**.3*45488\n*7318**4*5\n234.*4557*\n12..21*.*3\n286.235*4*\n834*11*.3*\n", "output": "NO\n"}, {"t... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nA k-multiple free set is a set of integers where there is no pair of integers where one is equal to another integer multiplied by k. That is, there are no two integers x and y (x < y) from the set, such that y = x·k.\n\nY... | [{"type": "stdin_stdout", "input": "100 2\n191 17 61 40 77 95 128 88 26 69 79 10 131 106 142 152 68 39 182 53 83 81 6 89 65 148 33 22 5 47 107 121 52 163 150 158 189 118 75 180 177 176 112 167 140 184 29 166 25 46 169 145 187 123 196 18 115 126 155 100 63 58 159 19 173 113 133 60 130 161 76 157 93 199 50 97 15 67 109 1... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nC: Namo .. Cut\n\nproblem\n\n-Defeat the mysterious giant jellyfish, codenamed \"Nari\"-\n\n\"Nari\" has a very strong vitality, so if you don't keep cutting quickly, it will be revived in a blink of an eye. We are making... | [{"type": "stdin_stdout", "input": "3\n2 2\n1 3\n2 1\n2\n2 3", "output": "1\n1\n"}, {"type": "stdin_stdout", "input": "3\n1 2\n1 3\n2 3\n2\n2 3", "output": "2\n2\n"}, {"type": "stdin_stdout", "input": "3\n1 1\n1 3\n2 3\n2\n2 3", "output": "1\n1\n"}, {"type": "stdin_stdout", "input": "3\n2 1\n1 3\n2 3\n2\n2 3", "output"... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\n<image>\n\nInput\n\nThe input contains a single integer a (1 ≤ a ≤ 18257).\n\nOutput\n\nPrint a single integer output (1 ≤ output ≤ 2·109).\n\nExamples\n\nInput\n\n2\n\n\nOutput\n\n13\n\nThe input will be stdin and you sh... | [{"type": "stdin_stdout", "input": "15000\n", "output": "1349910001\n"}, {"type": "stdin_stdout", "input": "16344\n", "output": "1602659953\n"}, {"type": "stdin_stdout", "input": "13170\n", "output": "1040614381\n"}, {"type": "stdin_stdout", "input": "15302\n", "output": "1404815413\n"}, {"type": "stdin_stdout", "input... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nYou are given an array $a$ of length $n$, and an integer $x$. You can perform the following operation as many times as you would like (possibly zero): replace two adjacent elements of the array by their sum. For example, ... | [{"type": "stdin_stdout", "input": "1\n20 1\n1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000\n", "output": "20000000000 20000000000\n"}, {"type": "s... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nBy 2312 there were n Large Hadron Colliders in the inhabited part of the universe. Each of them corresponded to a single natural number from 1 to n. However, scientists did not know what activating several colliders simul... | [{"type": "stdin_stdout", "input": "1 100\n+ 1\n- 1\n+ 1\n- 1\n+ 1\n- 1\n+ 1\n- 1\n+ 1\n- 1\n+ 1\n- 1\n+ 1\n- 1\n+ 1\n- 1\n+ 1\n- 1\n+ 1\n- 1\n+ 1\n- 1\n+ 1\n- 1\n+ 1\n- 1\n+ 1\n- 1\n+ 1\n- 1\n+ 1\n- 1\n+ 1\n- 1\n+ 1\n- 1\n+ 1\n- 1\n+ 1\n- 1\n+ 1\n- 1\n+ 1\n- 1\n+ 1\n- 1\n+ 1\n- 1\n+ 1\n- 1\n+ 1\n- 1\n+ 1\n- 1\n+ 1\n- ... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nThroughout Igor K.'s life he has had many situations worthy of attention. We remember the story with the virus, the story of his mathematical career and of course, his famous programming achievements. However, one does no... | [{"type": "stdin_stdout", "input": "446237720 920085248 296916273 439113596\n", "output": "1\n"}, {"type": "stdin_stdout", "input": "491259590 529594367 305425951 326414536\n", "output": "1\n"}, {"type": "stdin_stdout", "input": "960442940 572344654 77422042 406189391\n", "output": "1\n"}, {"type": "stdin_stdout", "inp... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nBob is preparing to pass IQ test. The most frequent task in this test is to find out which one of the given n numbers differs from the others. Bob observed that one number usually differs from the others in evenness. Help... | [{"type": "stdin_stdout", "input": "100\n44 40 6 40 56 90 98 8 36 64 76 86 98 76 36 92 6 30 98 70 24 98 96 60 24 82 88 68 86 96 34 42 58 10 40 26 56 10 88 58 70 32 24 28 14 82 52 12 62 36 70 60 52 34 74 30 78 76 10 16 42 94 66 90 70 38 52 12 58 22 98 96 14 68 24 70 4 30 84 98 8 50 14 52 66 34 100 10 28 100 56 48 38 12 ... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nYou had $n$ positive integers $a_1, a_2, \\dots, a_n$ arranged in a circle. For each pair of neighboring numbers ($a_1$ and $a_2$, $a_2$ and $a_3$, ..., $a_{n - 1}$ and $a_n$, and $a_n$ and $a_1$), you wrote down: are the... | [{"type": "stdin_stdout", "input": "1\nNEEEEEEEEEEEEEEEEEEEEEEEEEEEEENNNNEENNE\n", "output": "YES\n"}, {"type": "stdin_stdout", "input": "1\nNEEEEEEEEEEEEEEEEEEEEEEEEEEEEENNNNEENNE\n", "output": "YES\n"}, {"type": "stdin_stdout", "input": "1\nNEEEEEEEFEEEEEEEEEEEEEEEEEEEEENNNNEENNE\n", "output": "YES\n"}, {"type": "std... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nAn element in an array is dominant if it is greater than all elements to its right. You will be given an array and your task will be to return a list of all dominant elements. For example:\n```Haskell\nsolve([1,21,4,7,5])... | [{"input": "[67, 54, 27, 85, 66, 88, 31, 24, 49]", "output": "[[88, 49]]", "fn_name": "solve"}, {"input": "[104, 18, 37, 9, 36, 47, 28]", "output": "[[104, 47, 28]]", "fn_name": "solve"}, {"input": "[16, 17, 14, 3, 14, 5, 2]", "output": "[[17, 14, 5, 2]]", "fn_name": "solve"}, {"input": "[92, 52, 93, 31, 89, 87, 77, 10... | code_functional |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nYou still have partial information about the score during the historic football match. You are given a set of pairs $(a_i, b_i)$, indicating that at some point during the match the score was \"$a_i$: $b_i$\". It is known ... | [{"type": "stdin_stdout", "input": "11\n1 100000000\n200000000 100000000\n200000000 300000000\n400000000 300000000\n400000000 500000000\n600000000 639960479\n618182416 700000000\n800000000 700000000\n800000000 900000000\n1000000000 900000000\n1000000000 1000000000\n", "output": "100000011\n"}, {"type": "stdin_stdout", ... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nAs a part of this Kata, you need to create a function that when provided with a triplet, returns the index of the numerical element that lies between the other two elements.\n\nThe input to the function will be an array o... | [{"input": "[-0.41, -23, 4]", "output": "[0]", "fn_name": "gimme"}, {"input": "[-15, -10, 14]", "output": "[1]", "fn_name": "gimme"}, {"input": "[15, 10, 14]", "output": "[2]", "fn_name": "gimme"}, {"input": "[5, 10, 14]", "output": "[1]", "fn_name": "gimme"}, {"input": "[2, 3, 1]", "output": "[0]", "fn_name": "gimme"}... | code_functional |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nHow many multiples of d are there among the integers between L and R (inclusive)?\n\nConstraints\n\n* All values in input are integers.\n* 1 \\leq L \\leq R \\leq 100\n* 1 \\leq d \\leq 100\n\nInput\n\nInput is given from... | [{"type": "stdin_stdout", "input": "-1 110 1", "output": "112\n"}, {"type": "stdin_stdout", "input": "-1 111 1", "output": "113\n"}, {"type": "stdin_stdout", "input": "-1 101 1", "output": "103\n"}, {"type": "stdin_stdout", "input": "12 139 1", "output": "128\n"}, {"type": "stdin_stdout", "input": "12 152 1", "output":... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nYou are given an array $a$, consisting of $n$ positive integers.\n\nLet's call a concatenation of numbers $x$ and $y$ the number that is obtained by writing down numbers $x$ and $y$ one right after another without changin... | [{"type": "stdin_stdout", "input": "100 3\n14717 1461 5753 7023 6804 1826 8793 9148 9920 240 8768 15059 11439 2732 794 959 9744 2253 3273 4685 4730 6873 11982 2875 1303 2535 4901 147 8587 339 4792 154 3104 6020 10358 5537 2686 6208 9494 1826 8083 1269 1841 6210 538 3105 4092 5163 9696 9013 2153 3985 2787 4471 1170 4991... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nAndrii is good in Math, but not in Programming. He is asking you to solve following problem: Given an integer number N and two sets of integer A and B. Let set A contain all numbers from 1 to N and set B contain all numbe... | [{"type": "stdin_stdout", "input": "17 5\n5\n4\n9\n32\n1", "output": "0\n0\n0\n14\n0\n"}, {"type": "stdin_stdout", "input": "10 5\n19\n-1\n2\n0\n0", "output": "8\n0\n0\n0\n0\n"}, {"type": "stdin_stdout", "input": "12 5\n5\n4\n14\n18\n1", "output": "0\n0\n1\n5\n0\n"}, {"type": "stdin_stdout", "input": "21 5\n5\n4\n9\n32... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\n### Count the number of Duplicates\n\nWrite a function that will return the count of **distinct case-insensitive** alphabetic characters and numeric digits that occur more than \nonce in the input string. \nThe input stri... | [{"input": "\"Indivisibilities\"", "output": "[2]", "fn_name": "duplicate_count"}, {"input": "\"abcdeaa\"", "output": "[1]", "fn_name": "duplicate_count"}, {"input": "\"abcdeaB\"", "output": "[2]", "fn_name": "duplicate_count"}, {"input": "\"abcde\"", "output": "[0]", "fn_name": "duplicate_count"}, {"input": "\"\"", "o... | code_functional |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nA bracket sequence is a string that is one of the following:\n - An empty string;\n - The concatenation of (, A, and ) in this order, for some bracket sequence A ;\n - The concatenation of A and B in this order, for some ... | [{"type": "stdin_stdout", "input": "4\n((()))\n((((((\n))))))\n()()()\n", "output": "Yes\n"}, {"type": "stdin_stdout", "input": "4\n((()))\n((((((\n))))))\n)()()(", "output": "Yes\n"}, {"type": "stdin_stdout", "input": "4\n)))(((\n((((((\n))))))\n)()()(", "output": "Yes\n"}, {"type": "stdin_stdout", "input": "4\n((())(... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nD: Sontaku (Surmise)\n\nSome twins like even numbers.\n\nCount how many even numbers are in $ N $ integers $ A_1, A_2, A_3, \\ dots, A_N $.\n\ninput\n\nThe integer $ N $ is given on the first line.\n\nOn the second line, ... | [{"type": "stdin_stdout", "input": "5\n5 12 0 2 18", "output": "4\n"}, {"type": "stdin_stdout", "input": "5\n2 12 0 2 18", "output": "5\n"}, {"type": "stdin_stdout", "input": "5\n5 12 1 2 12", "output": "3\n"}, {"type": "stdin_stdout", "input": "5\n5 12 1 2 18", "output": "3\n"}, {"type": "stdin_stdout", "input": "5\n4... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nYou will get an array of numbers. \n\nEvery preceding number is smaller than the one following it.\n\nSome numbers will be missing, for instance:\n```\n[-3,-2,1,5] //missing numbers are: -1,0,2,3,4\n```\nYour task is to r... | [{"input": "[-4, 4]", "output": "[[-3, -2, -1, 0, 1, 2, 3]]", "fn_name": "find_missing_numbers"}, {"input": "[-3, -2, 1, 4]", "output": "[[-1, 0, 2, 3]]", "fn_name": "find_missing_numbers"}, {"input": "[-1, 0, 1, 2, 3, 4]", "output": "[[]]", "fn_name": "find_missing_numbers"}, {"input": "[0]", "output": "[[]]", "fn_nam... | code_functional |
[
{
"content": "Solve the following coding problem using the programming language python:\n\n# Definition\n\nA **number** is called **_Automorphic number_** if and only if *its square ends in the same digits as the number itself*.\n___\n\n# Task\n\n**_Given_** a **number** *determine if it Automorphic or not* .\n... | [{"input": "625", "output": "[\"Automorphic\"]", "fn_name": "automorphic"}, {"input": "25", "output": "[\"Automorphic\"]", "fn_name": "automorphic"}, {"input": "76", "output": "[\"Automorphic\"]", "fn_name": "automorphic"}, {"input": "1", "output": "[\"Automorphic\"]", "fn_name": "automorphic"}, {"input": "6", "output"... | code_functional |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nThe pizza store wants to know how long each order will take. They know:\n\n- Prepping a pizza takes 3 mins\n- Cook a pizza takes 10 mins\n- Every salad takes 3 mins to make\n- Every appetizer takes 5 mins to make\n- There... | [{"input": "13\n0\n0", "output": "[39.5]", "fn_name": "order"}, {"input": "3\n1\n2", "output": "[14.5]", "fn_name": "order"}, {"input": "2\n0\n0", "output": "[13]", "fn_name": "order"}, {"input": "0\n3\n2", "output": "[19]", "fn_name": "order"}, {"input": "6\n2\n4", "output": "[26]", "fn_name": "order"}, {"input": "6\n... | code_functional |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.