messages listlengths 1 1 | ground_truth stringlengths 88 726k | dataset stringclasses 2
values |
|---|---|---|
[
{
"content": "Solve the following coding problem using the programming language python:\n\nWe call a positive integer number fair if it is divisible by each of its nonzero digits. For example, $102$ is fair (because it is divisible by $1$ and $2$), but $282$ is not, because it isn't divisible by $8$. Given a po... | [{"type": "stdin_stdout", "input": "100\n95\n94\n31\n65\n35\n95\n70\n78\n81\n36\n69\n97\n39\n28\n89\n62\n36\n23\n35\n21\n36\n11\n65\n39\n13\n34\n79\n87\n91\n70\n43\n82\n24\n97\n6\n87\n49\n81\n60\n92\n63\n9\n16\n6\n31\n90\n6\n5\n70\n48\n27\n86\n65\n66\n45\n8\n67\n17\n24\n44\n34\n93\n26\n32\n82\n54\n72\n83\n94\n81\n79\n7... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nWriting light novels is the most important thing in Linova's life. Last night, Linova dreamed about a fantastic kingdom. She began to write a light novel for the kingdom as soon as she woke up, and of course, she is the q... | [{"type": "stdin_stdout", "input": "20 2\n9 7\n3 7\n15 9\n1 3\n11 12\n18 7\n17 18\n20 1\n4 11\n2 11\n12 18\n8 18\n13 2\n19 2\n10 11\n6 13\n5 8\n14 1\n16 13\n", "output": "16\n"}, {"type": "stdin_stdout", "input": "20 7\n9 7\n3 13\n15 9\n1 3\n11 9\n18 7\n17 18\n20 1\n4 11\n2 11\n12 18\n8 18\n13 2\n19 1\n10 14\n6 13\n5 8... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nYou are playing a game and your goal is to maximize your expected gain. At the beginning of the game, a pawn is put, uniformly at random, at a position p\\in\\\\{1,2,\\dots, N\\\\}. The N positions are arranged on a circl... | [{"type": "stdin_stdout", "input": "10\n710714906537 801526060256 134858704333 970632701383 344124734627 780768757320 1205627779029 145838269002 9231169966 485814502387\n31 83 57 11 001 30 10 91 15 28", "output": "1205627778393.899999976158\n"}, {"type": "stdin_stdout", "input": "10\n710714906537 223115971783 134858704... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nValera wanted to prepare a Codesecrof round. He's already got one problem and he wants to set a time limit (TL) on it.\n\nValera has written n correct solutions. For each correct solution, he knows its running time (in se... | [{"type": "stdin_stdout", "input": "68 85\n43 55 2 4 72 45 19 56 53 81 18 90 11 87 47 8 94 88 24 4 67 9 21 70 25 66 65 27 46 13 8 51 65 99 37 77 71 59 71 79 22 56 49 43 57 85 95 81 40 28 60 36 72 81 60 40 16 78 61 37 29 26 15 95 70 27 50 97\n6 6 48 72 54 31 1 50 29 64 93 9 29 93 66 63 25 90 52 1 66 13 70 44 24 87 32 90... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\n**Story** \nOn some island lives a chameleon population. Chameleons here can be of only one of three colors - red, green and blue. Whenever two chameleons of different colors meet, they can change their colors to a third... | [{"input": "[673905669, 673905681, 174867657]\n2", "output": "[673905681]", "fn_name": "chameleon"}, {"input": "[1, 2147483646, 1]\n1", "output": "[1]", "fn_name": "chameleon"}, {"input": "[34, 32, 35]\n0", "output": "[35]", "fn_name": "chameleon"}, {"input": "[34, 32, 35]\n1", "output": "[-1]", "fn_name": "chameleon"}... | code_functional |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nImp is watching a documentary about cave painting. [Image] \n\nSome numbers, carved in chaotic order, immediately attracted his attention. Imp rapidly proposed a guess that they are the remainders of division of a number ... | [{"type": "stdin_stdout", "input": "1000000000000000000 1000000000000000000\n", "output": "No\n"}, {"type": "stdin_stdout", "input": "1000000000000000000 1000000000000000000\n", "output": "No\n"}, {"type": "stdin_stdout", "input": "1000000000000000000 1000000000000100000\n", "output": "No\n"}, {"type": "stdin_stdout", ... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nYou are given a graph with $n$ nodes and $m$ directed edges. One lowercase letter is assigned to each node. We define a path's value as the number of the most frequently occurring letter. For example, if letters on a path... | [{"type": "stdin_stdout", "input": "10 50\nebibwbjihv\n1 10\n1 2\n5 4\n1 8\n9 7\n5 6\n1 8\n8 7\n2 6\n5 4\n1 9\n3 2\n3 3\n5 6\n5 9\n2 4\n2 7\n3 9\n1 2\n1 7\n1 10\n3 7\n1 8\n3 10\n8 6\n1 7\n10 6\n1 6\n10 8\n1 5\n2 10\n3 9\n1 8\n8 3\n3 7\n5 2\n1 10\n1 4\n5 3\n3 2\n1 2\n5 8\n10 4\n2 10\n8 2\n1 9\n1 8\n1 2\n3 4\n1 8\n", "ou... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nWilliam has two arrays $a$ and $b$, each consisting of $n$ items.\n\nFor some segments $l..r$ of these arrays William wants to know if it is possible to equalize the values of items in these segments using a balancing ope... | [{"type": "stdin_stdout", "input": "10 10\n894887111 146743785 109114345 815955099 968902979 475266442 919978438 174336213 986559256 952162378\n894887111 146743785 820647914 104421530 968902979 475266442 919978438 908881640 252013829 952162378\n7 10\n6 9\n5 9\n1 7\n2 9\n1 3\n3 10\n1 10\n3 7\n2 4\n", "output": "73454542... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nBaby Ehab is known for his love for a certain operation. He has an array $a$ of length $n$, and he decided to keep doing the following operation on it:\n\nhe picks $2$ adjacent elements; he then removes them and places a ... | [{"type": "stdin_stdout", "input": "15\n2\n660632533 660632533\n2\n774306959 774306959\n2\n971739496 784083784\n2\n775353256 672614891\n2\n403290217 403290217\n2\n651261320 651261320\n2\n894672621 894672621\n2\n46281693 620415865\n2\n92929999 409128591\n2\n26890011 630323358\n2\n443724284 443724284\n2\n308822599 308822... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nYou have an array $a_1, a_2, \\dots, a_n$. All $a_i$ are positive integers.\n\nIn one step you can choose three distinct indices $i$, $j$, and $k$ ($i \\neq j$; $i \\neq k$; $j \\neq k$) and assign the sum of $a_j$ and $a... | [{"type": "stdin_stdout", "input": "15\n3 3\n3 3 3\n3 3\n3 3 3\n3 3\n3 3 3\n3 3\n3 3 3\n3 3\n3 3 3\n3 3\n3 3 3\n3 3\n3 3 3\n3 3\n3 3 3\n3 3\n3 3 3\n3 3\n3 3 3\n3 3\n3 3 3\n3 3\n3 3 3\n3 3\n3 3 3\n3 3\n3 3 3\n3 3\n3 3 3\n", "output": "YES\nYES\nYES\nYES\nYES\nYES\nYES\nYES\nYES\nYES\nYES\nYES\nYES\nYES\nYES\n"}, {"type"... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nproblem\n\nDo you know Just Odd Inventions? The business of this company is to \"just odd inventions\". Here we call it JOI for short.\n\nJOI has two offices, each of which has square rooms of the same size arranged in a ... | [{"type": "stdin_stdout", "input": "5\n2 2 1 2\n6 5\n1 17\n3 2 2 1\n11 1 20\n10 18 3\n8\n5 4 1 3\n5 5 4 5 2\n8 2 1 9 7\n1 1 3 5 1\n7 2 7 1 3\n6 5 6 2\n2 3 5 8 2 7\n1 6 9 4 5 1\n2 5 1 4 2 2\n5 4 2 5 3 3\n12 1 5 1 5 6\n6\n3 3 2 2\n2 17 2\n9 1 9\n2 9 2\n2 2 1 1\n1 3\n5 7\n0", "output": "17\n4\n9\n"}, {"type": "stdin_stdou... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nThere is data of up to 100 characters per line, consisting of half-width alphabetic character strings. Some lines are symmetric (same whether read from the left edge or the right edge). Create a program that reads this da... | [{"type": "stdin_stdout", "input": "abcba\nsx\nabcddcba\nrstrd", "output": "2\n"}, {"type": "stdin_stdout", "input": "abcca\nsw\nabcddcba\nrstrd", "output": "1\n"}, {"type": "stdin_stdout", "input": "abcca\nxt\nadcbdcba\nrdsrt", "output": "0\n"}, {"type": "stdin_stdout", "input": "abcba\nsw\nabcddcba\nrstrd", "output":... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nAyrat is looking for the perfect code. He decided to start his search from an infinite field tiled by hexagons. For convenience the coordinate system is introduced, take a look at the picture to see how the coordinates of... | [{"type": "stdin_stdout", "input": "1000000000000000000\n", "output": " -418284973 -1154700538\n"}, {"type": "stdin_stdout", "input": "533568904697339792\n", "output": " ... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nLittle Vitaly loves different algorithms. Today he has invented a new algorithm just for you. Vitaly's algorithm works with string s, consisting of characters \"x\" and \"y\", and uses two following operations at runtime:... | [{"type": "stdin_stdout", "input": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\n", "output": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\n"}, {"type": "stdin_stdout", "input": "yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy\n", "output": "yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy\n"}, {"type": "stdin_stdout", "input": "yy... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nPolycarp watched TV-show where k jury members one by one rated a participant by adding him a certain number of points (may be negative, i. e. points were subtracted). Initially the participant had some score, and each the... | [{"type": "stdin_stdout", "input": "20 20\n-1012 625 39 -1747 -1626 898 -1261 180 -876 -1417 -1853 -1510 -1499 -561 -1824 442 -895 13 1857 1860\n-1269013 -1270956 -1264151 -1266004 -1268121 -1258341 -1269574 -1271851 -1258302 -1271838 -1260049 -1258966 -1271398 -1267514 -1269981 -1262038 -1261675 -1262734 -1260777 -126... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nMountaineers Mr. Takahashi and Mr. Aoki recently trekked across a certain famous mountain range. The mountain range consists of N mountains, extending from west to east in a straight line as Mt. 1, Mt. 2, ..., Mt. N. Mr. ... | [{"type": "stdin_stdout", "input": "10\n1 3776 3776 8848 8848 8848 8848 8848 8848 8848\n8848 8848 8848 8848 8848 8848 8848 8848 3776 5", "output": "884111967"}, {"type": "stdin_stdout", "input": "5\n16 0 4 -1 2\n19 24 -3 0 -11", "output": "0\n"}, {"type": "stdin_stdout", "input": "5\n16 0 1 -1 2\n19 24 -3 0 -11", "outp... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nFor given two sides of a triangle a and b and the angle C between them, calculate the following properties:\n\n* S: Area of the triangle\n* L: The length of the circumference of the triangle\n* h: The height of the triang... | [{"type": "stdin_stdout", "input": "1 2 -1", "output": "-0.0174524064373\n4.00030456331\n-0.0349048128746\n"}, {"type": "stdin_stdout", "input": "2 1 -2", "output": "-0.0348994967025\n4.00121760468\n-0.0348994967025\n"}, {"type": "stdin_stdout", "input": "1 1 -2", "output": "-0.0174497483513\n2.03490481287\n-0.03489949... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nAt a break Vanya came to the class and saw an array of $n$ $k$-bit integers $a_1, a_2, \\ldots, a_n$ on the board. An integer $x$ is called a $k$-bit integer if $0 \\leq x \\leq 2^k - 1$. \n\nOf course, Vanya was not able... | [{"type": "stdin_stdout", "input": "20 30\n30095551 418501267 319405832 181290086 651729244 244371014 1160853882 491522284 582219539 1510068105 512276151 438340777 293617992 759003208 759003208 1 1043646272 1073741823 1431280338 1073741823\n", "output": "210\n"}, {"type": "stdin_stdout", "input": "20 30\n30095551 41850... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nYou are going to be given a word. Your job will be to make sure that each character in that word has the exact same number of occurrences. You will return `true` if it is valid, or `false` if it is not.\n\nFor example:\n\... | [{"input": "\"AbcabcC\"", "output": "[false]", "fn_name": "validate_word"}, {"input": "\"abcabcd\"", "output": "[false]", "fn_name": "validate_word"}, {"input": "\"abc!abc!\"", "output": "[true]", "fn_name": "validate_word"}, {"input": "\"abc:abc\"", "output": "[false]", "fn_name": "validate_word"}, {"input": "\"abcabc... | code_functional |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nIn this problem we assume the Earth to be a completely round ball and its surface a perfect sphere. The length of the equator and any meridian is considered to be exactly 40 000 kilometers. Thus, travelling from North Pol... | [{"type": "stdin_stdout", "input": "10\n20000 South\n20000 North\n20000 South\n20000 North\n20000 South\n20000 North\n20000 South\n20000 North\n20000 South\n20000 North\n", "output": "YES\n"}, {"type": "stdin_stdout", "input": "10\n20000 South\n20000 North\n20000 South\n20000 North\n20000 South\n20000 North\n20000 Sout... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\n# Triple Trouble\n\nCreate a function that will return a string that combines all of the letters of the three inputed strings in groups. Taking the first letter of all of the inputs and grouping them next to each other. ... | [{"input": "\"aaaaaa\"\n\"bbbbbb\"\n\"cccccc\"", "output": "[\"abcabcabcabcabcabc\"]", "fn_name": "triple_trouble"}, {"input": "\"burn\"\n\"reds\"\n\"roll\"", "output": "[\"brrueordlnsl\"]", "fn_name": "triple_trouble"}, {"input": "\"aaa\"\n\"bbb\"\n\"ccc\"", "output": "[\"abcabcabc\"]", "fn_name": "triple_trouble"}, {... | code_functional |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nDoes \\sqrt{a} + \\sqrt{b} < \\sqrt{c} hold?\n\nConstraints\n\n* 1 \\leq a, b, c \\leq 10^9\n* All values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\n\na \\ b \\ c\n\n... | [{"type": "stdin_stdout", "input": "-10 -1 1", "output": "Yes\n"}, {"type": "stdin_stdout", "input": "-10 -1 0", "output": "Yes\n"}, {"type": "stdin_stdout", "input": "-16 -1 0", "output": "Yes\n"}, {"type": "stdin_stdout", "input": "110 -1 -3", "output": "No\n"}, {"type": "stdin_stdout", "input": "-1 -14 2", "output":... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nYou want to perform the combo on your opponent in one popular fighting game. The combo is the string $s$ consisting of $n$ lowercase Latin letters. To perform the combo, you have to press all buttons in the order they app... | [{"type": "stdin_stdout", "input": "3\n4 2\nabca\n1 3\n10 5\ncodeforces\n2 8 3 2 9\n26 10\nqwertyuioplkjhgfdsazxcvbnm\n20 10 1 2 3 5 10 5 9 4\n", "output": "4 2 2 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 \n\n0 0 9 4 5 3 0 0 0 0 0 0 0 0 9 0 0 3 1 0 0 0 0 0 0 0 \n\n2 1 1 2 9 2 2 2 5 2 2 2 1 1 5 4 11 8 2 7 5 1 10 1 5... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nYou have a Petri dish with bacteria and you are preparing to dive into the harsh micro-world. But, unfortunately, you don't have any microscope nearby, so you can't watch them.\n\nYou know that you have $n$ bacteria in th... | [{"type": "stdin_stdout", "input": "8 1000000\n1 1 5 1000000 1000000 2 2 2\n", "output": "2\n"}, {"type": "stdin_stdout", "input": "8 1000000\n1 1 5 1000000 1000000 2 2 2\n", "output": "2\n"}, {"type": "stdin_stdout", "input": "8 1000000\n2 1 5 1000000 1000000 2 2 2\n", "output": "2\n"}, {"type": "stdin_stdout", "input... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nYour friend has been out shopping for puppies (what a time to be alive!)... He arrives back with multiple dogs, and you simply do not know how to respond!\n\nBy repairing the function provided, you will find out exactly h... | [{"input": "100", "output": "[\"Woah that's a lot of dogs!\"]", "fn_name": "how_many_dalmatians"}, {"input": "80", "output": "[\"Woah that's a lot of dogs!\"]", "fn_name": "how_many_dalmatians"}, {"input": "26", "output": "[\"More than a handful!\"]", "fn_name": "how_many_dalmatians"}, {"input": "14", "output": "[\"Mor... | code_functional |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nYou are responsible for installing a gas pipeline along a road. Let's consider the road (for simplicity) as a segment $[0, n]$ on $OX$ axis. The road can have several crossroads, but for simplicity, we'll denote each cros... | [{"type": "stdin_stdout", "input": "4\n8 2 5\n00110010\n8 1 1\n00110010\n9 100000000 100000000\n010101010\n2 5 1\n00\n", "output": "94\n25\n2900000000\n13\n"}, {"type": "stdin_stdout", "input": "4\n8 2 5\n00110010\n8 1 1\n01110010\n9 100000000 100000000\n010101010\n2 5 1\n00\n", "output": "94\n26\n2900000000\n13\n"}, {... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nPolycarp has recently created a new level in this cool new game Berlio Maker 85 and uploaded it online. Now players from all over the world can try his level.\n\nAll levels in this game have two stats to them: the number ... | [{"type": "stdin_stdout", "input": "1\n99\n1 1\n1 1\n1 1\n1 1\n1 1\n1 1\n1 1\n1 1\n1 1\n1 1\n1 1\n1 1\n1 1\n1 1\n1 1\n1 1\n1 1\n1 1\n1 1\n1 1\n1 1\n1 1\n1 1\n1 1\n1 1\n1 1\n1 1\n1 1\n1 1\n1 1\n1 1\n1 1\n1 1\n1 1\n1 1\n1 1\n1 1\n1 1\n1 1\n1 1\n1 1\n1 1\n1 1\n1 1\n1 1\n1 1\n1 1\n1 1\n1 1\n1 1\n1 1\n1 1\n1 1\n1 1\n1 1\n1 ... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nDoubly linked list is one of the fundamental data structures. A doubly linked list is a sequence of elements, each containing information about the previous and the next elements of the list. In this problem all lists hav... | [{"type": "stdin_stdout", "input": "100\n0 0\n0 0\n0 0\n97 0\n0 0\n0 0\n0 0\n0 0\n0 0\n0 0\n0 0\n0 29\n0 0\n0 0\n0 0\n0 0\n0 0\n0 0\n0 0\n0 0\n0 0\n0 0\n0 0\n0 0\n0 0\n0 0\n0 0\n0 0\n12 0\n0 0\n0 0\n0 0\n0 0\n0 0\n0 0\n0 0\n0 0\n0 0\n0 0\n0 0\n0 0\n0 0\n0 0\n0 0\n0 0\n0 0\n0 0\n0 0\n0 0\n0 0\n0 0\n0 0\n0 0\n0 0\n0 0\n0... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nLet's call the following process a transformation of a sequence of length $n$.\n\nIf the sequence is empty, the process ends. Otherwise, append the greatest common divisor (GCD) of all the elements of the sequence to the ... | [{"type": "stdin_stdout", "input": "40471\n", "output": "1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nWe have a point $A$ with coordinate $x = n$ on $OX$-axis. We'd like to find an integer point $B$ (also on $OX$-axis), such that the absolute difference between the distance from $O$ to $B$ and the distance from $A$ to $B$... | [{"type": "stdin_stdout", "input": "6\n0 0\n5 8\n0 1000000\n1 0\n2 0\n0000000 1000000\n", "output": "0\n3\n1000000\n1\n0\n1000000\n"}, {"type": "stdin_stdout", "input": "6\n6 0\n0 8\n0 1000000\n0 0\n1 0\n0000000 1000000\n", "output": "0\n8\n1000000\n0\n1\n1000000\n"}, {"type": "stdin_stdout", "input": "6\n0 0\n5 8\n1 1... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nIn recreational mathematics, a magic square is an arrangement of distinct numbers (i.e., each number is used once), usually integers, in a square grid, where the numbers in each row, and in each column, and the numbers in... | [{"input": "[4, 9, 2, 3, 5, 7, 8, 6, 1]", "output": "[false]", "fn_name": "is_magical"}, {"input": "[1, 2, 3, 4, 5, 6, 7, 8, 9]", "output": "[false]", "fn_name": "is_magical"}, {"input": "[9, 4, 7, 3, 5, 2, 8, 6, 1]", "output": "[false]", "fn_name": "is_magical"}, {"input": "[4, 9, 2, 3, 5, 7, 8, 1, 6]", "output": "[tr... | code_functional |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nEveryone knows that 2010 FIFA World Cup is being held in South Africa now. By the decision of BFA (Berland's Football Association) next World Cup will be held in Berland. BFA took the decision to change some World Cup reg... | [{"type": "stdin_stdout", "input": "4\nTeMnHVvWKpwlpubwyhzqvc\nAWJwc\nbhbxErlydiwtoxy\nEVASMeLpfqwjkke\nAWJwc-TeMnHVvWKpwlpubwyhzqvc 43:73\nbhbxErlydiwtoxy-TeMnHVvWKpwlpubwyhzqvc 38:99\nbhbxErlydiwtoxy-AWJwc 33:84\nEVASMeLpfqwjkke-TeMnHVvWKpwlpubwyhzqvc 79:34\nEVASMeLpfqwjkke-AWJwc 243:7\nEVASMeLpfqwjkke-bhbxErlydiwtox... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nIn Group C of the 3rd year, we decided to use the \"class flag\" used at the sports festival on November 10, 2007 at future class reunions. So, in order to decide which students to keep the \"class flag\", I decided to pl... | [{"type": "stdin_stdout", "input": "50\n5576\n6063\n5578", "output": "3C11\n3C38\n3C18\n3C01\n"}, {"type": "stdin_stdout", "input": "50\n5576\n6063\n515", "output": "3C11\n3C38\n3C18\n3C08\n"}, {"type": "stdin_stdout", "input": "50\n1864\n13193\n39", "output": "3C11\n3C31\n3C11\n3C39\n"}, {"type": "stdin_stdout", "inpu... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nE869120's and square1001's 16-th birthday is coming soon.\n\nTakahashi from AtCoder Kingdom gave them a round cake cut into 16 equal fan-shaped pieces.\nE869120 and square1001 were just about to eat A and B of those piece... | [{"type": "stdin_stdout", "input": "-2 -1", "output": "Yay!\n"}, {"type": "stdin_stdout", "input": "-3 -1", "output": "Yay!\n"}, {"type": "stdin_stdout", "input": "-6 -1", "output": "Yay!\n"}, {"type": "stdin_stdout", "input": "-4 -1", "output": "Yay!\n"}, {"type": "stdin_stdout", "input": "5 4\n", "output": "Yay!\n"},... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nYou're fed up about changing the version of your software manually. Instead, you will create a little script that will make it for you.\n\n# Exercice\n\nCreate a function `nextVersion`, that will take a string in paramete... | [{"input": "\"1.2.3.4.5.6.7.8\"", "output": "[\"1.2.3.4.5.6.7.9\"]", "fn_name": "next_version"}, {"input": "\"1.2.3\"", "output": "[\"1.2.4\"]", "fn_name": "next_version"}, {"input": "\"0.9.9\"", "output": "[\"1.0.0\"]", "fn_name": "next_version"}, {"input": "\"9.9\"", "output": "[\"10.0\"]", "fn_name": "next_version"}... | code_functional |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nDo you remember how Kai constructed the word \"eternity\" using pieces of ice as components?\n\nLittle Sheldon plays with pieces of ice, each piece has exactly one digit between 0 and 9. He wants to construct his favourit... | [{"type": "stdin_stdout", "input": "2569\n09629965966225566262579565696595696954525955599926383255926955906666526913925296256629966292216925259225261263256229509529259756291959568892569599592218262625256926619266669279659295979299556965525222\n", "output": "44\n"}, {"type": "stdin_stdout", "input": "2559\n5255599526926... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nJavaScript provides a built-in parseInt method.\n\nIt can be used like this:\n\n- `parseInt(\"10\")` returns `10`\n- `parseInt(\"10 apples\")` also returns `10`\n\nWe would like it to return `\"NaN\"` (as a string) for th... | [{"input": "\"5 friends\"", "output": "[\"NaN\"]", "fn_name": "my_parse_int"}, {"input": "\"5friends\"", "output": "[\"NaN\"]", "fn_name": "my_parse_int"}, {"input": "\"I <3 u\"", "output": "[\"NaN\"]", "fn_name": "my_parse_int"}, {"input": "\"17.42\"", "output": "[\"NaN\"]", "fn_name": "my_parse_int"}, {"input": "\"12... | code_functional |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nThere are N people standing in a queue from west to east.\nGiven is a string S of length N representing the directions of the people.\nThe i-th person from the west is facing west if the i-th character of S is L, and east... | [{"type": "stdin_stdout", "input": "95617 23923\nRRRLRRRLLRRLRRLRLRRLLLRLLLRRRRRRRLLRRRRLRRRLLRLLRLLLRLLRLRLRRRRRLRRLRRRLRRRLRRLLRLLRLLRLRLRRLRRRLRLRLRLRLLLLRRLRLRRRRLRLLLLLLRLRRRLRLRRLRLLRLLRRLRRRRRRLRRRLRLRLRRRLLLRLRLRLLLLLRRRLRLLLLRLLRRLLLLRRLRLRLRLLRLLLLLLRRLRRRRLLLRLLLRLRRRRLRRRRLLRLRRRRRLRLRRLLRLLLRLRLRRLLLRRRRRR... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nWrite a function `count_vowels` to count the number of vowels in a given string.\n\n### Notes:\n\n- Return `nil` or `None` for non-string inputs.\n- Return `0` if the parameter is omitted.\n\n### Examples:\n\n```python\nc... | [{"input": "\"asdfdsaf asdfsasdfdsafgjlsdjf asdfdsf daf 13243242 dsafdsafds\"", "output": "[9]", "fn_name": "count_vowels"}, {"input": "\"asdfviosdfopsiewrwwer asdf asdfdsaf)(asdflkajdsf \"", "output": "[12]", "fn_name": "count_vowels"}, {"input": "\"asdfdsaf asdfsdaf 13243242 dsafdsafds\"", "output": "[6]",... | code_functional |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nGive the summation of all even numbers in a Fibonacci sequence up to, but not including, the maximum value.\n\nThe Fibonacci sequence is a series of numbers where the next value is the addition of the previous two values.... | [{"input": "2147483647", "output": "[1485607536]", "fn_name": "even_fib"}, {"input": "1000000000", "output": "[350704366]", "fn_name": "even_fib"}, {"input": "100000000", "output": "[82790070]", "fn_name": "even_fib"}, {"input": "1000000", "output": "[1089154]", "fn_name": "even_fib"}, {"input": "1000", "output": "[798... | code_functional |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nFrom beginning till end, this message has been waiting to be conveyed.\n\nFor a given unordered multiset of n lowercase English letters (\"multi\" means that a letter may appear more than once), we treat all letters as st... | [{"type": "stdin_stdout", "input": "100101\n", "output": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nLiLand is a country, consisting of n cities. The cities are numbered from 1 to n. The country is well known because it has a very strange transportation system. There are many one-way flights that make it possible to trav... | [{"type": "stdin_stdout", "input": "5 6\n1 2\n2 3\n3 5\n1 4\n4 5\n1 3\n", "output": "Yes\n1\n1\n2\n2\n2\n2\n"}, {"type": "stdin_stdout", "input": "4 4\n1 2\n2 3\n3 4\n1 3\n", "output": "Yes\n1\n1\n2\n2\n"}, {"type": "stdin_stdout", "input": "4 3\n1 2\n2 3\n3 4\n-1 -2\n", "output": "Yes\n2\n2\n2\n"}, {"type": "stdin_std... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nThe citizens of Byteland regularly play a game. They have blocks each denoting some integer from 0 to 9. These are arranged together in a random manner without seeing to form different numbers keeping in mind that the fir... | [{"type": "stdin_stdout", "input": "3\n2240\n162\n1224", "output": "losses\nlosses\nlosses\n"}, {"type": "stdin_stdout", "input": "3\n1450\n135\n1756", "output": "losses\nlosses\nlosses\n"}, {"type": "stdin_stdout", "input": "3\n3546\n155\n1157", "output": "losses\nlosses\nlosses\n"}, {"type": "stdin_stdout", "input": ... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nA boy Bob likes to draw. Not long ago he bought a rectangular graph (checked) sheet with n rows and m columns. Bob shaded some of the squares on the sheet. Having seen his masterpiece, he decided to share it with his elde... | [{"type": "stdin_stdout", "input": "50 1\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*\n*\n.\n.\n.\n.\n*\n*\n.\n*\n*\n.\n.\n.\n.\n*\n*\n.\n.\n.\n.\n.\n.\n", "output": "*\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.\n.\n.\n.\n*\n*\n.\n*\n*\n.\n... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nQwerty the Ranger took up a government job and arrived on planet Mars. He should stay in the secret lab and conduct some experiments on bacteria that have funny and abnormal properties. The job isn't difficult, but the sa... | [{"type": "stdin_stdout", "input": "1000000 1000000 1000000 1000000\n", "output": "1000000\n"}, {"type": "stdin_stdout", "input": "1000000 1000000 1000000 1010000\n", "output": "1000000\n"}, {"type": "stdin_stdout", "input": "100000 100000 1000000 1000000\n", "output": "999999\n"}, {"type": "stdin_stdout", "input": "12... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nAfter learning about polynomial hashing, Heidi decided to learn about shift-xor hashing. In particular, she came across this interesting problem.\n\nGiven a bitstring $y \\in \\{0,1\\}^n$ find out the number of different ... | [{"type": "stdin_stdout", "input": "111\n011101111010100111111000010101011110011000010101010001001011000111100101111000010110010011110100000111000100101\n", "output": "108\n"}, {"type": "stdin_stdout", "input": "111\n0011011110001001111110000101010111100110000101010100010010110001111001011111010001100000111101101001110... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nIn Chelyabinsk lives a much respected businessman Nikita with a strange nickname \"Boss\". Once Nikita decided to go with his friend Alex to the Summer Biathlon World Cup. Nikita, as a very important person, received a to... | [{"type": "stdin_stdout", "input": "20 30\n4 13 78 11\n13 19 56 41\n15 15 46 83\n4 9 74 72\n17 20 97 7\n15 20 29 64\n8 17 44 85\n4 18 26 46\n16 17 13 90\n16 16 39 89\n13 14 46 125\n14 18 67 18\n12 20 84 48\n10 20 49 32\n10 14 14 11\n6 18 80 84\n3 20 13 97\n12 20 62 42\n7 14 64 71\n5 19 38 17\n17 18 99 18\n11 15 83 22\n... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nRead problems statements in Mandarin Chinese and Russian. \n\nGrapes of Coderpur are very famous. Devu went to the market and saw that there were N people selling grapes. He didn’t like it because things were not very st... | [{"type": "stdin_stdout", "input": "2\n2 19\n5 10\n3 10\n10 3 17", "output": "23\n10\n"}, {"type": "stdin_stdout", "input": "2\n2 19\n5 10\n3 18\n10 3 17", "output": "23\n24\n"}, {"type": "stdin_stdout", "input": "2\n2 19\n5 10\n3 18\n10 3 11", "output": "23\n30\n"}, {"type": "stdin_stdout", "input": "2\n2 19\n8 10\n3 ... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nA strongness of an even number is the number of times we can successively divide by 2 until we reach an odd number starting with an even number n.\n\nFor example, if n = 12, then\n* 12 / 2 = 6\n* 6 / 2 = 3\n\nSo we divide... | [{"input": "1151592177\n2129680158", "output": "[1610612736]", "fn_name": "strongest_even"}, {"input": "2085422641\n2128923730", "output": "[2113929216]", "fn_name": "strongest_even"}, {"input": "1082012216\n1876572332", "output": "[1610612736]", "fn_name": "strongest_even"}, {"input": "1806570867\n2067832928", "output... | code_functional |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nGiven that \n```\nf0 = '0'\nf1 = '01'\nf2 = '010' = f1 + f0\nf3 = '01001' = f2 + f1\n```\n\nYou will be given a number and your task is to return the `nth` fibonacci string. For example:\n\n```\nsolve(2) = '010'\nsolve(3)... | [{"input": "5", "output": "[\"0100101001001\"]", "fn_name": "solve"}, {"input": "3", "output": "[\"01001\"]", "fn_name": "solve"}, {"input": "2", "output": "[\"010\"]", "fn_name": "solve"}, {"input": "1", "output": "[\"01\"]", "fn_name": "solve"}, {"input": "0", "output": "[\"0\"]", "fn_name": "solve"}] | code_functional |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nYou are given two integers $a$ and $b$. You can perform a sequence of operations: during the first operation you choose one of these numbers and increase it by $1$; during the second operation you choose one of these numb... | [{"type": "stdin_stdout", "input": "3\n1 3\n11 11\n30 20\n", "output": "3\n0\n4\n"}, {"type": "stdin_stdout", "input": "3\n0 3\n11 11\n30 20\n", "output": "2\n0\n4\n"}, {"type": "stdin_stdout", "input": "3\n1 3\n11 11\n30 20\n", "output": "3\n0\n4\n"}, {"type": "stdin_stdout", "input": "3\n1 3\n11 1\n30 20\n", "output"... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nShe is an apprentice wizard. She first learned the magic of manipulating time. And she decided to open a liquor store to earn a living. It has to do with the fact that all the inhabitants of the country where she lives lo... | [{"type": "stdin_stdout", "input": "12 3\n2 3 6\n12 4\n1 2 3 6\n0 0", "output": "6.0000000000\n0.0000000000"}, {"type": "stdin_stdout", "input": "21 3\n2 3 19\n13 4\n1 2 4 6\n0 0", "output": "10.5\n0.0\n"}, {"type": "stdin_stdout", "input": "21 3\n2 5 19\n13 4\n2 2 4 3\n0 0", "output": "10.5\n6.5\n"}, {"type": "stdin_s... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nIn a certain video game, the player controls a hero characterized by a single integer value: power. The hero will have to beat monsters that are also characterized by a single integer value: armor.\n\nOn the current level... | [{"type": "stdin_stdout", "input": "2\n1\n1 127\n2\n3 19 13 0\n2 12 11\n", "output": "128\n18\n"}, {"type": "stdin_stdout", "input": "2\n1\n1 146\n2\n3 19 16 0\n2 21 2\n", "output": "147\n20\n"}, {"type": "stdin_stdout", "input": "2\n1\n1 204\n2\n3 19 16 0\n2 21 2\n", "output": "205\n20\n"}, {"type": "stdin_stdout", "i... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nLet's assume that we have a pair of numbers (a, b). We can get a new pair (a + b, b) or (a, a + b) from the given pair in a single step.\n\nLet the initial pair of numbers be (1,1). Your task is to find number k, that is,... | [{"type": "stdin_stdout", "input": "1000000\n", "output": "30\n"}, {"type": "stdin_stdout", "input": "999998\n", "output": "30\n"}, {"type": "stdin_stdout", "input": "123455\n", "output": "26\n"}, {"type": "stdin_stdout", "input": "998756\n", "output": "30\n"}, {"type": "stdin_stdout", "input": "999879\n", "output": "3... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nThere are some animals in a garden. Each of them is a crane with two legs or a turtle with four legs.\nTakahashi says: \"there are X animals in total in the garden, and they have Y legs in total.\" Determine whether there... | [{"type": "stdin_stdout", "input": "25 100\n", "output": "Yes\n"}, {"type": "stdin_stdout", "input": "50 100\n", "output": "Yes\n"}, {"type": "stdin_stdout", "input": "25 98\n", "output": "Yes\n"}, {"type": "stdin_stdout", "input": "51 100\n", "output": "No\n"}, {"type": "stdin_stdout", "input": "32 96\n", "output": "Y... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nOn the way to Dandi March, Gandhijee carried a mirror with himself. When he reached Dandi, he decided to play a game with the tired people to give them some strength. At each turn of the game he pointed out a person and t... | [{"type": "stdin_stdout", "input": "100\n1740948824551711527614232216857618927954312334113883114332134597298167586122324167251171554288490471\n1427793198650286024865090061389344606618496378829119288736948166064439831600905684206820568913977241\n159840763615420973726016575412001460717777335998188189953377771706410021457... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nLittle Petya often visits his grandmother in the countryside. The grandmother has a large vertical garden, which can be represented as a set of `n` rectangles of varying height. Due to the newest irrigation system we can ... | [{"input": "[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 8, 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, 8... | code_functional |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nA flea is sitting at one of the n hassocks, arranged in a circle, at the moment. After minute number k the flea jumps through k - 1 hassoсks (clockwise). For example, after the first minute the flea jumps to the neighbori... | [{"type": "stdin_stdout", "input": "1000\n", "output": "NO\n"}, {"type": "stdin_stdout", "input": "512\n", "output": "YES\n"}, {"type": "stdin_stdout", "input": "256\n", "output": "YES\n"}, {"type": "stdin_stdout", "input": "512\n", "output": "YES\n"}, {"type": "stdin_stdout", "input": "1000\n", "output": "NO\n"}, {"ty... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nD: Is greed the best?\n\nstory\n\nIn Japan, where there are 1, 5, 10, 50, 100, 500 yen coins, it is known that the number of coins can be minimized by using as many coins as possible when paying a certain amount. ..\n\nIf... | [{"type": "stdin_stdout", "input": "42 1010", "output": "1050\n"}, {"type": "stdin_stdout", "input": "133 178", "output": "266\n"}, {"type": "stdin_stdout", "input": "16 102", "output": "112\n"}, {"type": "stdin_stdout", "input": "24 128", "output": "144\n"}, {"type": "stdin_stdout", "input": "18 102", "output": "108\n... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nJohnny has a younger sister Anne, who is very clever and smart. As she came home from the kindergarten, she told his brother about the task that her kindergartener asked her to solve. The task was just to construct a tria... | [{"type": "stdin_stdout", "input": "100 21 30 65\n", "output": "IMPOSSIBLE\n"}, {"type": "stdin_stdout", "input": "52 10 19 139\n", "output": "IMPOSSIBLE\n"}, {"type": "stdin_stdout", "input": "110 21 30 65\n", "output": "IMPOSSIBLE\n"}, {"type": "stdin_stdout", "input": "11 30 79 43\n", "output": "IMPOSSIBLE\n"}, {"ty... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nIn this kata you are given an array to sort but you're expected to start sorting from a specific position of the array (in ascending order) and optionally you're given the number of items to sort.\n\n#### Examples:\n\n```... | [{"input": "[9, 7, 4, 2, 5, 3, 1, 8, 6]\n2\n5", "output": "[[9, 7, 1, 2, 3, 4, 5, 8, 6]]", "fn_name": "sect_sort"}, {"input": "[1, 2, 5, 7, 4, 6, 3, 9, 8]\n8\n3", "output": "[[1, 2, 5, 7, 4, 6, 3, 9, 8]]", "fn_name": "sect_sort"}, {"input": "[1, 2, 5, 7, 4, 6, 3, 9, 8]\n2", "output": "[[1, 2, 3, 4, 5, 6, 7, 8, 9]]", "f... | code_functional |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nPaul is at the orchestra. The string section is arranged in an r × c rectangular grid and is filled with violinists with the exception of n violists. Paul really likes violas, so he would like to take a picture including ... | [{"type": "stdin_stdout", "input": "10 10 10 1\n8 10\n2 9\n1 10\n3 1\n8 5\n10 1\n4 10\n10 2\n5 3\n9 3\n", "output": "1787\n"}, {"type": "stdin_stdout", "input": "14 10 10 1\n8 10\n2 9\n1 10\n3 1\n8 5\n10 1\n4 10\n10 2\n5 3\n9 3\n", "output": "3411\n"}, {"type": "stdin_stdout", "input": "10 10 10 1\n1 10\n10 8\n7 4\n7 2... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nYou came to the exhibition and one exhibit has drawn your attention. It consists of $n$ stacks of blocks, where the $i$-th stack consists of $a_i$ blocks resting on the surface.\n\nThe height of the exhibit is equal to $m... | [{"type": "stdin_stdout", "input": "50 1000000000\n824428839 821375880 831521735 868908015 86990853 248293447 886713846 425716910 443947914 504402098 40124673 774093026 271211165 873482658 592754073 490097471 947930201 69692739 145291746 418475785 80274059 696889747 854947829 231642778 141525047 57563878 92067934 38750... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nAs Will is stuck in the Upside Down, he can still communicate with his mom, Joyce, through the Christmas lights (he can turn them on and off with his mind). He can't directly tell his mom where he is, because the monster ... | [{"type": "stdin_stdout", "input": ")?(??((???????()?(?????????)??(????????((?)?????)????)??????(?????)?)?????)??????(??()??????)????????)?)()??????????????())????????(???)??)????????????????????(?????)??)???)??(???????????????)???)??)?\n", "output": "8314\n"}, {"type": "stdin_stdout", "input": ")?(??((???????()?(?????... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nThe stardate is 1983, and Princess Heidi is getting better at detecting the Death Stars. This time, two Rebel spies have yet again given Heidi two maps with the possible locations of the Death Star. Since she got rid of a... | [{"type": "stdin_stdout", "input": "10 5\nsomer\nandom\nnoise\nmayth\neforc\nebewi\nthyou\nhctwo\nagain\nnoise\nsomermayth\nandomeforc\nnoiseebewi\nagainthyou\nnoisehctwo\n", "output": "4 6\n"}, {"type": "stdin_stdout", "input": "10 5\nsomer\nandom\nnoise\nmayth\neforc\nebewi\nthyou\nhctwo\nagain\nooise\nsomermayth\nan... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nWelcome to Rockport City!\n\nIt is time for your first ever race in the game against Ronnie. To make the race interesting, you have bet $a$ dollars and Ronnie has bet $b$ dollars. But the fans seem to be disappointed. The... | [{"type": "stdin_stdout", "input": "4\n1 11\n1 2\n4 0\n20 10\n", "output": "10 1\n1 0\n4 0\n10 0\n"}, {"type": "stdin_stdout", "input": "4\n1 11\n1 2\n4 0\n22 10\n", "output": "10 1\n1 0\n4 0\n12 2\n"}, {"type": "stdin_stdout", "input": "4\n1 11\n1 2\n2 0\n22 10\n", "output": "10 1\n1 0\n2 0\n12 2\n"}, {"type": "stdin_... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nWelcome to PC Koshien, players. This year marks the 10th anniversary of Computer Koshien, but the number of questions and the total score will vary from year to year. Scores are set for each question according to the diff... | [{"type": "stdin_stdout", "input": "1\n2\n-1\n-9\n-1\n2\n-1\n-32\n-1\n1", "output": "-39\n"}, {"type": "stdin_stdout", "input": "1\n2\n0\n-38\n-1\n1\n-1\n-17\n0\n1", "output": "-52\n"}, {"type": "stdin_stdout", "input": "1\n2\n0\n-38\n-1\n1\n-1\n-32\n0\n1", "output": "-67\n"}, {"type": "stdin_stdout", "input": "1\n2\n-... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\n# Invalid Login - Bug Fixing #11\n\nOh NO! Timmy has moved divisions... but now he's in the field of security. Timmy, being the top coder he is, has allowed some bad code through. You must help Timmy and filter out any in... | [{"input": "\"Timmy\"\n\"password\\\"||\\\"\\\"==\\\"\"", "output": "[\"Wrong username or password!\"]", "fn_name": "validate"}, {"input": "\"Admin\"\n\"gs5bw\\\"||1==1//\"", "output": "[\"Wrong username or password!\"]", "fn_name": "validate"}, {"input": "\"Timmy\"\n\"h4x0r\"", "output": "[\"Wrong username or password... | code_functional |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nGildong has bought a famous painting software cfpaint. The working screen of cfpaint is square-shaped consisting of $n$ rows and $n$ columns of square cells. The rows are numbered from $1$ to $n$, from top to bottom, and ... | [{"type": "stdin_stdout", "input": "9 9\nBWBBWWWXW\nBWAWWWWWW\nWBWBBBBBB\nWWBBBWWWB\nWWBWBXBWW\nWBWWBBWWB\nWWWBWBWBW\nBBWBBBWWW\nWBWBBWWWW\n", "output": "18\n"}, {"type": "stdin_stdout", "input": "9 9\nBWBBWWWXW\nBWAWWWWWW\nWBWBBBBBB\nWWBBBWWWB\nWWBWBXBWW\nWBWWBBWWB\nWWWBWBWBW\nWWWBBBWBB\nWBWBBWWWW\n", "output": "18\n"... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nYou are given a positive integer N.\nFind the minimum positive integer divisible by both 2 and N.\n\n-----Constraints-----\n - 1 \\leq N \\leq 10^9\n - All values in input are integers.\n\n-----Input-----\nInput is given ... | [{"type": "stdin_stdout", "input": "15607691432", "output": "15607691432\n"}, {"type": "stdin_stdout", "input": "1000000000\n", "output": "1000000000\n"}, {"type": "stdin_stdout", "input": "8325199727", "output": "16650399454\n"}, {"type": "stdin_stdout", "input": "999999999\n", "output": "1999999998\n"}, {"type": "std... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nYou are given a string $s$. You can build new string $p$ from $s$ using the following operation no more than two times: choose any subsequence $s_{i_1}, s_{i_2}, \\dots, s_{i_k}$ where $1 \\le i_1 < i_2 < \\dots < i_k \... | [{"type": "stdin_stdout", "input": "1\nbbbaaaaabbabaabbbbaabbbbabbaabbaababbbbbbababbababbbaaaaaaabaababbbaababbbbababbbabbbbbabaabbaaaabaa\nbbbababbaabbbbbaabaaabaababaaaabaabbbabbababaaabba\n", "output": "YES\n"}, {"type": "stdin_stdout", "input": "1\nbbbaaaaabbabaabbbbaabbbbabbaabbaababbbbbbababbababbbaaaaaaabaababb... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nVadim is really keen on travelling. Recently he heard about kayaking activity near his town and became very excited about it, so he joined a party of kayakers.\n\nNow the party is ready to start its journey, but firstly t... | [{"type": "stdin_stdout", "input": "50\n297 787 34 268 439 629 600 398 425 833 721 908 830 636 64 509 420 647 499 675 427 599 396 119 798 742 577 355 22 847 389 574 766 453 196 772 225 261 106 844 726 975 173 992 874 89 775 616 678 52 69 591 181 573 258 381 665 301 589 379 362 146 790 842 765 100 229 916 938 97 340 793... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nWe have a deck consisting of N cards. Each card has an integer written on it. The integer on the i-th card from the top is a_i.\n\nTwo people X and Y will play a game using this deck. Initially, X has a card with Z writte... | [{"type": "stdin_stdout", "input": "1 1 1\n1010000000", "output": "1009999999\n"}, {"type": "stdin_stdout", "input": "1 1 1\n1010100000", "output": "1010099999\n"}, {"type": "stdin_stdout", "input": "3 100 100\n10 1001 000", "output": "1001\n"}, {"type": "stdin_stdout", "input": "3 100 1001\n10 100 100", "output": "901... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nSkyscraper \"MinatoHarukas\"\n\nMr. Port plans to start a new business renting one or more floors of the new skyscraper with one giga floors, MinatoHarukas. He wants to rent as many vertically adjacent floors as possible,... | [{"type": "stdin_stdout", "input": "15\n27\n3\n5\n14453855\n142729211\n251672118\n560550970\n979553853\n999999999\n0", "output": "1 5\n2 6\n1 2\n2 2\n111119 130\n801761 178\n11923 13484\n4003866 140\n7523 37374\n163837 5994\n"}, {"type": "stdin_stdout", "input": "15\n16\n3\n3\n9699690\n237086004\n847288609\n900660121\n... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nThis is the simple version of Fastest Code series. If you need some challenges, please try the [Performance version](http://www.codewars.com/kata/5714594d2817ff681c000783)\n\n## Task: \n \nGive you a number array ```nu... | [{"input": "[-3, -2, -2, -1, 0, 1, 2, 3, 4]\n4", "output": "[[-2, -2]]", "fn_name": "find_a_b"}, {"input": "[-3, -2, -2, -1, 0, 1, 2, 3, 4]\n0", "output": "[[-3, 0]]", "fn_name": "find_a_b"}, {"input": "[-3, -2, -1, 0, 1, 2, 3, 4]\n4", "output": "[[1, 4]]", "fn_name": "find_a_b"}, {"input": "[1, 2, 3, 4, 5, 6]\n15", "o... | code_functional |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nBimokh is Mashmokh's boss. For the following n days he decided to pay to his workers in a new way. At the beginning of each day he will give each worker a certain amount of tokens. Then at the end of each day each worker ... | [{"type": "stdin_stdout", "input": "10 1 100000000\n999999999 1634812359 999999999 999999999 129546129 999999999 999999999 999999999 1815265208 999999999\n", "output": "99999999 34812359 99999999 99999999 29546129 99999999 99999999 99999999 15265208 99999999\n"}, {"type": "stdin_stdout", "input": "10 1 100000000\n99999... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nA map of some object is a rectangular field consisting of n rows and n columns. Each cell is initially occupied by the sea but you can cover some some cells of the map with sand so that exactly k islands appear on the map... | [{"type": "stdin_stdout", "input": "100 5000\n", "output": "YES\nLSLSLSLSLSLSLSLSLSLSLSLSLSLSLSLSLSLSLSLSLSLSLSLSLSLSLSLSLSLSLSLSLSLSLSLSLSLSLSLSLSLSLSLSLSLSLSLSLSLS\nSLSLSLSLSLSLSLSLSLSLSLSLSLSLSLSLSLSLSLSLSLSLSLSLSLSLSLSLSLSLSLSLSLSLSLSLSLSLSLSLSLSLSLSLSLSLSLSLSLSL\nLSLSLSLSLSLSLSLSLSLSLSLSLSLSLSLSLSLSLSLSLSLSLSLSLSL... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nStellar history 2005.11.5. You are about to engage an enemy spacecraft as the captain of the UAZ Advance spacecraft. Fortunately, the enemy spaceship is still unnoticed. In addition, the space coordinates of the enemy are... | [{"type": "stdin_stdout", "input": "-10 6 6\n20 2 5\n1 10 0\n-1 10 10\n0 0 10", "output": "MISS\n"}, {"type": "stdin_stdout", "input": "-10 6 6\n20 2 5\n0 10 0\n-1 10 10\n0 0 10", "output": "MISS\n"}, {"type": "stdin_stdout", "input": "-10 6 6\n20 2 5\n0 10 0\n-1 10 14\n0 0 10", "output": "MISS\n"}, {"type": "stdin_std... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nArcady is a copywriter. His today's task is to type up an already well-designed story using his favorite text editor.\n\nArcady types words, punctuation signs and spaces one after another. Each letter and each sign (inclu... | [{"type": "stdin_stdout", "input": "thun-thun-thunder, thunder, thunder\nthunder, thun-, thunder\nthun-thun-thunder, thunder\nthunder, feel the thunder\nlightning then the thunder\nthunder, feel the thunder\nlightning then the thunder\nthunder, thunder\n", "output": "183\n"}, {"type": "stdin_stdout", "input": "thun-thu... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nHaiku is a short form of Japanese poetry. A Haiku consists of three phrases with 5, 7 and 5 syllables, in this order.\nIroha is looking for X,Y,Z-Haiku (defined below) in integer sequences.\nConsider all integer sequences... | [{"type": "stdin_stdout", "input": "37 4 2 3\n", "output": "863912418\n"}, {"type": "stdin_stdout", "input": "40 5 7 5\n", "output": "562805100\n"}, {"type": "stdin_stdout", "input": "15 10 2 3", "output": "138603924\n"}, {"type": "stdin_stdout", "input": "37 4 3 3", "output": "180978943\n"}, {"type": "stdin_stdout", "... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nWe have held a popularity poll for N items on sale. Item i received A_i votes.\nFrom these N items, we will select M as popular items. However, we cannot select an item with less than \\dfrac{1}{4M} of the total number of... | [{"type": "stdin_stdout", "input": "100 100\n1000 999 998 997 996 995 994 993 992 991 990 989 988 987 986 985 984 983 982 981 980 979 978 977 976 975 974 973 972 971 970 969 968 967 966 965 964 963 962 961 960 959 958 957 956 955 954 953 952 951 950 949 948 947 946 945 944 943 942 941 940 939 938 937 936 935 934 933 93... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nThere are N integers a_1, a_2, ..., a_N not less than 1. The values of a_1, a_2, ..., a_N are not known, but it is known that a_1 \\times a_2 \\times ... \\times a_N = P.\n\nFind the maximum possible greatest common divis... | [{"type": "stdin_stdout", "input": "1 1431379180228", "output": "1431379180228\n"}, {"type": "stdin_stdout", "input": "1 1472895801034", "output": "1472895801034\n"}, {"type": "stdin_stdout", "input": "1 1365467213485", "output": "1365467213485\n"}, {"type": "stdin_stdout", "input": "1 2203800626104", "output": "220380... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nArthur and Alexander are number busters. Today they've got a competition. \n\nArthur took a group of four integers a, b, w, x (0 ≤ b < w, 0 < x < w) and Alexander took integer с. Arthur and Alexander use distinct approach... | [{"type": "stdin_stdout", "input": "200000000 794 1000 117 2000000000\n", "output": "2038505096\n"}, {"type": "stdin_stdout", "input": "200000000 794 1000 117 2000000000\n", "output": "2038505096\n"}, {"type": "stdin_stdout", "input": "20000000 280 1000 25 2000000000\n", "output": "2030769231\n"}, {"type": "stdin_stdou... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nDuff is in love with lovely numbers! A positive integer x is called lovely if and only if there is no such positive integer a > 1 such that a^2 is a divisor of x. [Image] \n\nMalek has a number store! In his store, he has... | [{"type": "stdin_stdout", "input": "817634153013\n", "output": "817634153013\n"}, {"type": "stdin_stdout", "input": "734337660466\n", "output": "734337660466\n"}, {"type": "stdin_stdout", "input": "808453785117\n", "output": "808453785117\n"}, {"type": "stdin_stdout", "input": "294809951965\n", "output": "294809951965\... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\n# Story\n\nWell, here I am stuck in another traffic jam.\n\n\n*Damn all those courteous people!*\n\nCars are trying to enter the main road from side-streets somewhere ahead of me and people keep letting them cut in.\n\nEa... | [{"input": "\"abcdefghijklmnopqrstuvwX\"\n[\"AAA\", \"BBB\", \"CCC\", \"DDD\", \"EEE\", \"FFF\", \"GGG\", \"HHH\", \"III\", \"JJJ\", \"KKK\", \"LLL\", \"MMM\", \"NNN\", \"OOO\", \"PPP\", \"QQQ\", \"RRR\", \"SSS\", \"TTT\", \"UUU\", \"VVV\", \"WWW\"]", "output": "[\"aAbABAcBCBdCDCeDEDfEFEgFGFhGHGiHIHjIJIkJKJlKLKmLMLnMNM... | code_functional |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nYou are given an array $a$ of length $n$, which initially is a permutation of numbers from $1$ to $n$. In one operation, you can choose an index $i$ ($1 \\leq i < n$) such that $a_i < a_{i + 1}$, and remove either $a_i$ o... | [{"type": "stdin_stdout", "input": "4\n3\n1 2 3\n4\n3 1 2 4\n3\n2 3 1\n6\n2 4 12 1 3 10\n", "output": "YES\nYES\nNO\nYES\n"}, {"type": "stdin_stdout", "input": "4\n3\n1 2 3\n4\n3 1 2 4\n3\n2 3 1\n6\n2 4 19 1 3 10\n", "output": "YES\nYES\nNO\nYES\n"}, {"type": "stdin_stdout", "input": "4\n3\n1 2 3\n4\n3 1 2 4\n3\n2 3 1\... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nA palindrome is a word, phrase, number, or other sequence of characters which reads the same backward as forward. Examples of numerical palindromes are: \n\n2332\n110011\n54322345\n\nFor a given number ```num```, write a ... | [{"input": "\"ACCDDCCA\"", "output": "[\"Not valid\"]", "fn_name": "palindrome"}, {"input": "\"1551\"", "output": "[\"Not valid\"]", "fn_name": "palindrome"}, {"input": "-4505", "output": "[\"Not valid\"]", "fn_name": "palindrome"}, {"input": "141221001", "output": "[5]", "fn_name": "palindrome"}, {"input": "13598", "o... | code_functional |
[
{
"content": "Solve the following coding problem using the programming language python:\n\n# Grains\n\nWrite a program that calculates the number of grains of wheat on a chessboard given that the number on each square is double the previous one.\n\nThere are 64 squares on a chessboard.\n\n#Example:\nsquare(1) =... | [{"input": "32", "output": "[2147483648]", "fn_name": "square"}, {"input": "16", "output": "[32768]", "fn_name": "square"}, {"input": "1", "output": "[1]", "fn_name": "square"}, {"input": "3", "output": "[4]", "fn_name": "square"}, {"input": "4", "output": "[8]", "fn_name": "square"}] | code_functional |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nLittle Petya very much likes arrays consisting of n integers, where each of them is in the range from 1 to 109, inclusive. Recently he has received one such array as a gift from his mother. Petya didn't like it at once. H... | [{"type": "stdin_stdout", "input": "25\n1 1 1 2 2 2 1 2 1 2 2 2 2 2 1 2 2 2 1 2 2 2 2 1 2\n", "output": "1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 "}, {"type": "stdin_stdout", "input": "4\n1011110011 158379 10597860 181988389\n", "output": "1 158379 10597860 181988389\n"}, {"type": "stdin_stdout", "input": "4\n... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nThere is the word heuristics. It's a relatively simple approach that usually works, although there is no guarantee that it will work. The world is full of heuristics because it is simple and powerful.\n\nSome examples of ... | [{"type": "stdin_stdout", "input": "4 1 3 4\nyskwcnt 16\nakzakr 7\ntsnukk 12\nfnmyi 13\nakzakr\n4 1 3 8\nakzakr 7\ntsnukk 4\nfnmyi 13\nyskwcnt 16\nakzakr\n4 2 2 1\nakzakr 4\ntsnukk 6\nyskwcnt 12\nfnmyi 12\nakzakr\nfnmyi\n5 2 3 28\nknmmdk 6\nskrkyk 14\ntmemm 14\nakmhmr 15\nmksyk 25\nknmmdk\nskrkyk\n5 2 3 11\ntmemm 12\ns... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nI am a pipe tie craftsman. As long as you get the joints and pipes that connect the pipes, you can connect any pipe. Every day, my master gives me pipes and joints, which I connect and give to my master. But if you have t... | [{"type": "stdin_stdout", "input": "3\n0 1 1\n3 3\n4\n4 1 2 3\n1 1 1\n5\n1 1 3 4 5\n3 12 2 2\n0", "output": "10\n40\n104\n"}, {"type": "stdin_stdout", "input": "3\n0 1 1\n3 3\n4\n3 1 5 3\n1 1 1\n5\n2 4 6 4 5\n0 3 2 1\n0", "output": "10\n48\n105\n"}, {"type": "stdin_stdout", "input": "3\n0 1 1\n3 3\n4\n3 1 5 3\n1 1 1\n5... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nThe Smart Beaver from ABBYY came up with another splendid problem for the ABBYY Cup participants! This time the Beaver invites the contest participants to check out a problem on sorting documents by their subjects. Let's ... | [{"type": "stdin_stdout", "input": "21000\nSWISS OT LAHNCU NEW SERIES OF MONEY MARKET PEPAR\nZURICH, April 9 - The Svirs Federal tndmnrevoG lliw launch\na ndw series fo three mhnto mondx market setatificrec totallhng\nauornd 150 mln iwSss fraocs, dht National Bank said.\nSubscriptions close lirpA 14 and paynent date hs... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nThe New Year is coming! That's why many people today are busy preparing New Year presents. Vasily the Programmer is no exception.\n\nVasily knows that the best present is (no, it's not a contest) money. He's put n empty w... | [{"type": "stdin_stdout", "input": "10\n2 1 8 0 0 1 0 4 4 3\n", "output": "PRLPRLRPRLRPRLPRLPRLPRLPRLPRLPRLPRLRRRPRLRRPRLPRLPRLPRLRPRLPRLPRLPRLRPLRPLRPLR"}, {"type": "stdin_stdout", "input": "10\n2 0 8 0 0 1 0 4 4 3\n", "output": "PRLPRLRRPRLPRLPRLPRLPRLPRLPRLPRLRRRPRLRRPRLPRLPRLPRLRPRLPRLPRLPRLRPLRPLRPLR"}, {"type": "... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nThe main server of Gomble company received a log of one top-secret process, the name of which can't be revealed. The log was written in the following format: «[date:time]: message», where for each «[date:time]» value exis... | [{"type": "stdin_stdout", "input": "14\n[12:07 p.m.]: mamaa\n[12:36 a.m.]: amaamppa\n[01:31 a.m.]: pmpp\n[05:47 a.m.]: paapappapaaampm\n[12:07 a.m.]: ppamammm\n[01:03 a.m.]: aapapmpampamamaaa\n[07:55 a.m.]: mpappmmapmpa\n[02:49 a.m.]: papmppppmpamppa\n[03:12 a.m.]: aaaaaaamam\n[04:40 a.m.]: paap\n[01:13 a.m.]: ap\n[03:... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nMagic The Gathering is a collectible card game that features wizards battling against each other with spells and creature summons. The game itself can be quite complicated to learn. In this series of katas, we'll be solvi... | [{"input": "[[1, 3], [3, 5], [4, 6], [5, 2]]\n[[2, 4], [6, 1], [4, 4], [3, 7], [3, 1]]", "output": "[{\"player1\": [[1, 3], [4, 6]], \"player2\": [[2, 4], [3, 7], [3, 1]]}]", "fn_name": "battle"}, {"input": "[[2, 3], [1, 4]]\n[[3, 3], [4, 1]]", "output": "[{\"player1\": [], \"player2\": [[3, 3]]}]", "fn_name": "battle"... | code_functional |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nA median in an array with the length of n is an element which occupies position number <image> after we sort the elements in the non-decreasing order (the array elements are numbered starting with 1). A median of an array... | [{"type": "stdin_stdout", "input": "100 813\n285 143 378 188 972 950 222 557 170 755 470 164 1433 553 146 820 842 62 496 1893 746 944 677 828 465 577 791 277 303 218 561 653 925 692 871 424 626 795 813 343 418 280 123 364 496 447 435 452 645 36 311 315 830 289 450 675 23 212 421 661 7 217 468 877 172 141 475 409 178 71... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nThe kingdom of Lazyland is the home to $n$ idlers. These idlers are incredibly lazy and create many problems to their ruler, the mighty King of Lazyland. \n\nToday $k$ important jobs for the kingdom ($k \\le n$) should be... | [{"type": "stdin_stdout", "input": "18 12\n6 3 6 6 6 6 6 6 6 12 1 3 6 6 10 6 6 6\n47 4 41 56 75 24 29 10 100 112 53 48 79 30 87 135 60 87\n", "output": "185\n"}, {"type": "stdin_stdout", "input": "18 12\n6 3 6 6 6 6 6 6 6 12 1 3 6 6 10 6 6 6\n47 4 41 56 75 24 29 10 100 112 53 48 79 30 87 135 10 87\n", "output": "148\n"... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nMany years ago, Roman numbers were defined by only `4` digits: `I, V, X, L`, which represented `1, 5, 10, 50`. These were the only digits used. The value of a sequence was simply the sum of digits in it. For instance:\n``... | [{"input": "10000000", "output": "[489999753]", "fn_name": "solve"}, {"input": "10", "output": "[244]", "fn_name": "solve"}, {"input": "2", "output": "[10]", "fn_name": "solve"}, {"input": "3", "output": "[20]", "fn_name": "solve"}, {"input": "4", "output": "[35]", "fn_name": "solve"}, {"input": "5", "output": "[56]", ... | code_functional |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nSnuke signed up for a new website which holds programming competitions.\nHe worried that he might forget his password, and he took notes of it.\nSince directly recording his password would cause him trouble if stolen,\nhe... | [{"type": "stdin_stdout", "input": "atcoderbeginnercontest\natcoderregularcontest\n", "output": "aattccooddeerrbreeggiunlnaerrccoonntteesstt\n"}, {"type": "stdin_stdout", "input": "atcoderbeeinnercontgst\natcoderregularcontest", "output": "aattccooddeerrbreeegiunlnaerrccoonnttegsstt\n"}, {"type": "stdin_stdout", "input... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nGiven is a tree with N vertices numbered 1 to N, and N-1 edges numbered 1 to N-1.\nEdge i connects Vertex a_i and b_i bidirectionally and has a length of 1.\nSnuke will paint each vertex white or black.\nThe niceness of a... | [{"type": "stdin_stdout", "input": "10104\n5741 6080\n3408 7811\n5930 5446\n2841 6030\n7143 6678\n5930 3686\n3091 5609\n9185 6802\n8673 6440\n593 5930\n4271 5808\n3292 3568\n2712 5673\n10008 5082\n421 4874\n5930 7228\n5005 6587\n2254 9793\n8397 7976\n8682 4699\n8396 5930\n7253 1069\n1980 6577\n8066 4032\n2303 3724\n370... | code_stdio |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.