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\nConsider the number `1176` and its square (`1176 * 1176) = 1382976`. Notice that:\n\n* the first two digits of `1176` form a prime.\n* the first two digits of the square `1382976` also form a prime.\n* the last two digits... | [{"input": "100000\n1000000", "output": "[2302]", "fn_name": "solve"}, {"input": "2\n1000000", "output": "[2549]", "fn_name": "solve"}, {"input": "2\n100000", "output": "[247]", "fn_name": "solve"}, {"input": "1176\n1200", "output": "[1]", "fn_name": "solve"}, {"input": "2\n1200", "output": "[1]", "fn_name": "solve"}] | code_functional |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nPhoenix has $n$ coins with weights $2^1, 2^2, \\dots, 2^n$. He knows that $n$ is even.\n\nHe wants to split the coins into two piles such that each pile has exactly $\\frac{n}{2}$ coins and the difference of weights betwe... | [{"type": "stdin_stdout", "input": "100\n30\n30\n30\n30\n30\n30\n30\n30\n30\n30\n30\n30\n30\n30\n30\n30\n30\n30\n30\n30\n30\n30\n30\n30\n30\n30\n30\n30\n30\n30\n30\n30\n30\n30\n30\n30\n30\n30\n30\n30\n30\n30\n30\n30\n30\n30\n30\n30\n30\n30\n30\n30\n30\n30\n30\n30\n30\n30\n30\n30\n30\n30\n30\n30\n30\n30\n30\n30\n30\n30\... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\n# 'Magic' recursion call depth number\n\nThis Kata was designed as a Fork to the one from donaldsebleung Roboscript series with a reference to:\n\nhttps://www.codewars.com/collections/roboscript\n\nIt is not more than an ... | [{"input": "\"p6023R6F95L64R98P3321L15qP8886P8063P2161p3321P6023P6023F86L64qp8886F12F3L33P3321P3321R57qp8063P3321L35P3321P8886P6023F51qp2161P8063P8063F32R6F46q\"", "output": "[[3, 5]]", "fn_name": "magic_call_depth_number"}, {"input": "\"p5048L50R23P2998R9qp2125P3445R41R48qp1776R41P392qP2904p2998R4P2125P1776qp3445F57P1... | code_functional |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nGiven is a string S. Replace every character in S with x and print the result.\n\n-----Constraints-----\n - S is a string consisting of lowercase English letters.\n - The length of S is between 1 and 100 (inclusive).\n\n-... | [{"type": "stdin_stdout", "input": "kvtvweokpottycaeeyfthzfvsgckwjmgqadfekjfitnsieylhumxjjezqvidkxjpywokrnzxxwraamuimhmrjwqeyvjvyjjzsxxf\n", "output": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\n"}, {"type": "stdin_stdout", "input": "qvssniprlkdntynymqcjoxpttvp... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nYou are given an integer N.\nFind the number of the positive divisors of N!, modulo 10^9+7.\n\n-----Constraints-----\n - 1≤N≤10^3\n\n-----Input-----\nThe input is given from Standard Input in the following format:\nN\n\n-... | [{"type": "stdin_stdout", "input": "1000\n", "output": "972926972\n"}, {"type": "stdin_stdout", "input": "1001", "output": "513172208\n"}, {"type": "stdin_stdout", "input": "108", "output": "875619122\n"}, {"type": "stdin_stdout", "input": "111", "output": "130571620\n"}, {"type": "stdin_stdout", "input": "101", "outpu... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nYou are given two positive integers $x$ and $y$. You can perform the following operation with $x$: write it in its binary form without leading zeros, add $0$ or $1$ to the right of it, reverse the binary form and turn it ... | [{"type": "stdin_stdout", "input": "1740680371580423905 1636173592742219971\n", "output": "NO\n"}, {"type": "stdin_stdout", "input": "999999999999999999 1636173592742219971\n", "output": "NO\n"}, {"type": "stdin_stdout", "input": "616543106594181990 1600944574522397396\n", "output": "NO\n"}, {"type": "stdin_stdout", "i... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nSnuke is buying a bicycle.\nThe bicycle of his choice does not come with a bell, so he has to buy one separately.\nHe has very high awareness of safety, and decides to buy two bells, one for each hand.\nThe store sells th... | [{"type": "stdin_stdout", "input": "10000 10000 10000\n", "output": "20000\n"}, {"type": "stdin_stdout", "input": "10000 10100 10000", "output": "20000\n"}, {"type": "stdin_stdout", "input": "10000 00100 10000", "output": "10100\n"}, {"type": "stdin_stdout", "input": "11000 10100 10000", "output": "20100\n"}, {"type": ... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nSquare Route\n\nSquare root\n\nEnglish text is not available in this practice contest.\n\nMillionaire Shinada, who has decided to build a new mansion, is wondering in which city to build the new mansion. To tell the truth... | [{"type": "stdin_stdout", "input": "3 3\n2\n1\n2\n-1\n3\n1\n1 2\n22\n11\n10\n0 0", "output": "7\n0\n"}, {"type": "stdin_stdout", "input": "3 3\n1\n1\n2\n1\n1\n1\n1 2\n10\n10\n23\n0 0", "output": "11\n1\n"}, {"type": "stdin_stdout", "input": "3 3\n1\n1\n1\n2\n3\n1\n1 2\n10\n10\n10\n0 0", "output": "6\n2\n"}, {"type": "s... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nA `bouncy number` is a positive integer whose digits neither increase nor decrease. For example, 1235 is an increasing number, 5321 is a decreasing number, and 2351 is a bouncy number. By definition, all numbers under 100... | [{"input": "50", "output": "[99999999999999999999999999999999999999912040301674]", "fn_name": "bouncy_count"}, {"input": "20", "output": "[99999999999959940181]", "fn_name": "bouncy_count"}, {"input": "10", "output": "[9999722967]", "fn_name": "bouncy_count"}, {"input": "6", "output": "[987048]", "fn_name": "bouncy_cou... | code_functional |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nRead problems statements in Mandarin Chinese . \n\nGiven an array of n non-negative integers: A_{1}, A_{2}, …, A_{N}. Your mission is finding a pair of integers A_{u}, A_{v} (1 ≤ u < v ≤ N) such that (A_{u} and A_{v}) is... | [{"type": "stdin_stdout", "input": "4\n1\n11\n23\n11", "output": "11\n"}, {"type": "stdin_stdout", "input": "4\n4\n11\n18\n16", "output": "16\n"}, {"type": "stdin_stdout", "input": "4\n1\n15\n17\n14", "output": "14\n"}, {"type": "stdin_stdout", "input": "4\n13\n10\n3\n13", "output": "13\n"}, {"type": "stdin_stdout", "i... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nFor a given sequence of distinct non-negative integers $(b_1, b_2, \\dots, b_k)$ we determine if it is good in the following way:\n\nConsider a graph on $k$ nodes, with numbers from $b_1$ to $b_k$ written on them.\n\nFor ... | [{"type": "stdin_stdout", "input": "109\n74 18 237 179 195 112 156 11 72 68 173 202 78 250 224 251 107 55 186 144 57 62 28 210 132 64 93 6 211 0 174 163 248 226 167 246 46 102 253 180 121 56 151 35 150 254 168 201 242 118 190 158 196 30 75 116 187 96 215 244 192 73 12 175 33 222 131 256 181 230 114 165 128 234 63 90 44... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nBomboslav likes to look out of the window in his room and watch lads outside playing famous shell game. The game is played by two persons: operator and player. Operator takes three similar opaque shells and places a ball ... | [{"type": "stdin_stdout", "input": "2000000000\n0\n", "output": "1\n"}, {"type": "stdin_stdout", "input": "1999999995\n0\n", "output": "2\n"}, {"type": "stdin_stdout", "input": "1999999995\n1\n", "output": "1\n"}, {"type": "stdin_stdout", "input": "1999999995\n2\n", "output": "0\n"}, {"type": "stdin_stdout", "input": "... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nYou have an array of integers (initially empty).\n\nYou have to perform $q$ queries. Each query is of one of two types:\n\n\"$1$ $x$\" — add the element $x$ to the end of the array;\n\n\"$2$ $x$ $y$\" — replace all occurr... | [{"type": "stdin_stdout", "input": "8\n2 1 4\n1 1\n1 4\n1 2\n2 2 4\n2 4 3\n1 2\n2 2 7\n", "output": "1 3 3 7 \n"}, {"type": "stdin_stdout", "input": "8\n2 1 4\n1 1\n1 4\n1 2\n2 2 4\n2 4 3\n1 2\n2 2 7\n", "output": "1 3 3 7 "}, {"type": "stdin_stdout", "input": "8\n2 2 4\n1 1\n1 4\n1 2\n2 2 4\n2 4 3\n1 2\n2 2 7\n", "out... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\n> I would, if I could,\n> If I couldn't how could I?\n> I couldn't, without I could, could I?\n> Could you, without you could, could ye?\n> Could ye? could ye?\n> Could you, without you could, could ye?\n\nIt is true... | [{"type": "stdin_stdout", "input": "15 2 3\n16 3 6\n110 9 112\n0 0 0", "output": "1\n11\n98\n"}, {"type": "stdin_stdout", "input": "15 2 4\n16 3 6\n110 9 112\n0 0 0", "output": "8\n11\n98\n"}, {"type": "stdin_stdout", "input": "15 2 4\n15 3 6\n110 9 112\n0 0 0", "output": "8\n10\n98\n"}, {"type": "stdin_stdout", "input... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nIn this kata, you will write a function that returns the positions and the values of the \"peaks\" (or local maxima) of a numeric array.\n\nFor example, the array `arr = [0, 1, 2, 5, 1, 0]` has a peak at position `3` with... | [{"input": "[1, 2, 5, 4, 3, 2, 3, 6, 4, 1, 2, 3, 3, 4, 5, 3, 2, 1, 2, 3, 5, 5, 4, 3]", "output": "[{\"pos\": [2, 7, 14, 20], \"peaks\": [5, 6, 5, 5]}]", "fn_name": "pick_peaks"}, {"input": "[3, 2, 3, 6, 4, 1, 2, 3, 2, 1, 2, 2, 2, 1]", "output": "[{\"pos\": [3, 7, 10], \"peaks\": [6, 3, 2]}]", "fn_name": "pick_peaks"}, ... | code_functional |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nIn an attempt to escape the Mischievous Mess Makers' antics, Farmer John has abandoned his farm and is traveling to the other side of Bovinia. During the journey, he and his k cows have decided to stay at the luxurious Gr... | [{"type": "stdin_stdout", "input": "491 172\n01111101111111100000111010110001010001110111000010101111101000100010010111011101110110111101101010111000111000011100011010010010111111000011011010100110001000011100111000001011100010001111101111101000111001100110010100101000001110010100100100100101001100010101001000010000111... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nE869120 is initially standing at the origin (0, 0) in a two-dimensional plane.\nHe has N engines, which can be used as follows:\n - When E869120 uses the i-th engine, his X- and Y-coordinate change by x_i and y_i, respect... | [{"type": "stdin_stdout", "input": "100\n-62558 -455059\n-78926 -574123\n-122264 -889372\n-29760 -216480\n-91884 -668382\n-122636 -892078\n-134168 -975964\n-17670 -128535\n-127782 -929511\n-74524 -542102\n-104470 -759935\n-133362 -970101\n-93124 -677402\n-16368 -119064\n-19530 -142065\n-82336 -598928\n-87358 -635459\n-... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nAt Aizu Riverside Hospital, inpatients walk twice a day for rehabilitation and health promotion. As the number of people trying to recover their physical strength by walking is increasing day by day in order to leave the ... | [{"type": "stdin_stdout", "input": "5\n263 1519 1817\n2 1240 1985\n11656 1896 4132\n10001 503 3107\n51 1421 2690\n3\n345 1628 2181\n7 3910 1590\n5982 2525 3616\n0", "output": "11656 6028\n5982 6141\n"}, {"type": "stdin_stdout", "input": "5\n263 1519 1817\n2 1240 1985\n11656 1896 4132\n10001 503 3107\n51 1421 2690\n3\n3... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nExpression Mining\n\nConsider an arithmetic expression built by combining single-digit positive integers with addition symbols `+`, multiplication symbols `*`, and parentheses `(` `)`, defined by the following grammar rul... | [{"type": "stdin_stdout", "input": "3\n(3+2)*3+1\n1\n1*1*1+1+1*1\n1307\n1*(2*3*4)+5+((5+7*8))*(9)\n0", "output": "2\n10\n0\n"}, {"type": "stdin_stdout", "input": "3\n(1+2)*4+3\n1\n1*1*1+1*1*1\n1108\n1*(2*3*4)+5+((6+7*8))*(9)\n0", "output": "3\n12\n0\n"}, {"type": "stdin_stdout", "input": "3\n(1+2)*3+3\n1\n1*1*1+1+1*1\n... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nThere are n shovels in Polycarp's shop. The i-th shovel costs i burles, that is, the first shovel costs 1 burle, the second shovel costs 2 burles, the third shovel costs 3 burles, and so on. Polycarps wants to sell shovel... | [{"type": "stdin_stdout", "input": "499999999\n", "output": "1249999995\n"}, {"type": "stdin_stdout", "input": "1000000000\n", "output": "500000000\n"}, {"type": "stdin_stdout", "input": "499999998\n", "output": "1249999991\n"}, {"type": "stdin_stdout", "input": "458679894\n", "output": "1043399471\n"}, {"type": "stdin... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nAs you may know, MemSQL has American offices in both San Francisco and Seattle. Being a manager in the company, you travel a lot between the two cities, always by plane.\n\nYou prefer flying from Seattle to San Francisco ... | [{"type": "stdin_stdout", "input": "100\nSFFSSFFFFFFSSFFFSSFSFFFFFSSFFFSFFFFFFSFSSSFSFSFFFFSFSSFFFFFFFFSFFFFFSFFFFFSSFFFSFFSFSFFFFSFFSFFFFFFF\n", "output": "YES\n"}, {"type": "stdin_stdout", "input": "100\nSFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF\n", "output":... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nN contestants participated in a competition. The total of N-1 matches were played in a knockout tournament. For some reasons, the tournament may not be \"fair\" for all the contestants. That is, the number of the matches ... | [{"type": "stdin_stdout", "input": "7\n1\n2\n2\n3\n1\n4", "output": "4\n"}, {"type": "stdin_stdout", "input": "7\n1\n4\n2\n3\n1\n3", "output": "5\n"}, {"type": "stdin_stdout", "input": "7\n1\n4\n2\n3\n1\n4", "output": "4\n"}, {"type": "stdin_stdout", "input": "7\n1\n4\n2\n3\n1\n7", "output": "4\n"}, {"type": "stdin_std... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nEugene likes working with arrays. And today he needs your help in solving one challenging task.\n\nAn array $c$ is a subarray of an array $b$ if $c$ can be obtained from $b$ by deletion of several (possibly, zero or all) ... | [{"type": "stdin_stdout", "input": "3\n41 -41 41\n", "output": "3\n"}, {"type": "stdin_stdout", "input": "3\n41 -60 41\n", "output": "6\n"}, {"type": "stdin_stdout", "input": "3\n57 -60 41\n", "output": "6\n"}, {"type": "stdin_stdout", "input": "3\n57 -33 41\n", "output": "6\n"}, {"type": "stdin_stdout", "input": "3\n5... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nWe have a rectangular parallelepiped of size A×B×C, built with blocks of size 1×1×1. Snuke will paint each of the A×B×C blocks either red or blue, so that:\n\n* There is at least one red block and at least one blue block.... | [{"type": "stdin_stdout", "input": "19 9 5", "output": "45\n"}, {"type": "stdin_stdout", "input": "11 5 5", "output": "25\n"}, {"type": "stdin_stdout", "input": "-1 2 10", "output": "0\n"}, {"type": "stdin_stdout", "input": "19 5 5", "output": "25\n"}, {"type": "stdin_stdout", "input": "5 5 5", "output": "25\n"}, {"typ... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nGreg has an array a = a1, a2, ..., an and m operations. Each operation looks as: li, ri, di, (1 ≤ li ≤ ri ≤ n). To apply operation i to the array means to increase all array elements with numbers li, li + 1, ..., ri by va... | [{"type": "stdin_stdout", "input": "4 3 6\n2 1 3 4\n1 2 2\n2 3 2\n3 4 4\n1 2\n1 3\n2 3\n1 2\n1 3\n2 3\n", "output": "10 21 31 20\n"}, {"type": "stdin_stdout", "input": "4 3 6\n2 1 3 4\n1 2 2\n2 4 2\n3 4 4\n1 2\n1 3\n2 3\n1 2\n1 3\n2 3\n", "output": "10 21 31 32\n"}, {"type": "stdin_stdout", "input": "4 3 6\n2 1 3 4\n1 ... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nSimon has an array a_1, a_2, ..., a_{n}, consisting of n positive integers. Today Simon asked you to find a pair of integers l, r (1 ≤ l ≤ r ≤ n), such that the following conditions hold: there is integer j (l ≤ j ≤ r), ... | [{"type": "stdin_stdout", "input": "5\n2 3 5 7 11\n", "output": "5 0\n1 2 3 4 5 \n"}, {"type": "stdin_stdout", "input": "5\n2 3 5 9 17\n", "output": "5 0\n1 2 3 4 5\n"}, {"type": "stdin_stdout", "input": "5\n2 3 5 7 11\n", "output": "5 0\n1 2 3 4 5 "}, {"type": "stdin_stdout", "input": "2\n999999 1000000\n", "output": ... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nIn number theory, an **[abundant](https://en.wikipedia.org/wiki/Abundant_number)** number or an **[excessive](https://en.wikipedia.org/wiki/Abundant_number)** number is one for which the sum of it's **[proper divisors](h... | [{"input": "1111", "output": "[[[1110], [516]]]", "fn_name": "abundant"}, {"input": "900", "output": "[[[900], [1021]]]", "fn_name": "abundant"}, {"input": "999", "output": "[[[996], [360]]]", "fn_name": "abundant"}, {"input": "300", "output": "[[[300], [268]]]", "fn_name": "abundant"}, {"input": "400", "output": "[[[4... | code_functional |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nProblem Statement\n\nLet's consider operations on monochrome images that consist of hexagonal pixels, each of which is colored in either black or white. Because of the shape of pixels, each of them has exactly six neighbo... | [{"type": "stdin_stdout", "input": "00000000111111110000000011111111000000001111111100000000111111110000000011111111000000001111111100000000111111110000000111111111\n10000000111111110000000011111111000000001111111100000000111111110000000011111111000000001111111100000000111111110000000011111111\n010101010101010101010101... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nF: Multiplication is fun --Multiplication Is Interesting -\n\nstory\n\nNamba, a high school boy, is thinking of giving her a few lines on her birthday. She is a girl who loves multiplication, so Namba wants to give her a ... | [{"type": "stdin_stdout", "input": "3 3.9884088227062082\n4.1091643442474926\n2.4255254960412556\n3.5822804934056625\n5.345178229082616\n3.4110023092801276\n4.814519106855367", "output": "1\n"}, {"type": "stdin_stdout", "input": "2 2.7392730443507527\n3.4955293017360702\n2.1596061630199546\n2.4656347357978543\n4.322234... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nThis kata generalizes [Twice Linear](https://www.codewars.com/kata/5672682212c8ecf83e000050). You may want to attempt that kata first.\n\n## Sequence\n\nConsider an integer sequence `U(m)` defined as:\n\n1. `m` is a given... | [{"input": "[17, 14, 9, 16, 11, 8, 13, 19, 7]\n185", "output": "[1090]", "fn_name": "n_linear"}, {"input": "[18, 12, 16, 15, 10, 17, 6, 8, 7]\n534", "output": "[2601]", "fn_name": "n_linear"}, {"input": "[3, 18, 10, 9, 19, 6, 7, 17, 4]\n195", "output": "[361]", "fn_name": "n_linear"}, {"input": "[16, 5, 18, 13, 11, 8, ... | code_functional |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nYou are given an array $a$ consisting of $n$ integer numbers.\n\nLet instability of the array be the following value: $\\max\\limits_{i = 1}^{n} a_i - \\min\\limits_{i = 1}^{n} a_i$.\n\nYou have to remove exactly one elem... | [{"type": "stdin_stdout", "input": "82\n53931 67166 20637 68570 4855 63080 53128 28375 54407 70564 46622 46903 32659 68966 20614 11381 51217 94774 90448 13368 51098 46518 15907 1090 44331 39269 17316 22813 66082 78034 58245 36364 45200 78881 4933 66406 58312 74413 94780 12718 61328 57754 75973 93986 26719 12938 21718 9... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\n## Overview\nResistors are electrical components marked with colorful stripes/bands to indicate both their resistance value in ohms and how tight a tolerance that value has. If you did my Resistor Color Codes kata, you wr... | [{"input": "\"330k ohms\"", "output": "[\"orange orange yellow gold\"]", "fn_name": "encode_resistor_colors"}, {"input": "\"47k ohms\"", "output": "[\"yellow violet orange gold\"]", "fn_name": "encode_resistor_colors"}, {"input": "\"330 ohms\"", "output": "[\"orange orange brown gold\"]", "fn_name": "encode_resistor_co... | code_functional |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nThere are a total of n x n squares, n rows vertically and n columns horizontally. Some squares are marked. Create a program that reads the marked state of each square and displays the length of the side of the largest squ... | [{"type": "stdin_stdout", "input": "10\n...*....**\n..........\n**....**..\n........*.\n..*.......\n..........\n.*........\n..........\n....*..***\n.*....*...\n10\n*****.****\n*..*.*....\n****.*....\n*....*....\n*....*****\n..........\n****.*****\n*..*...*..\n****...*..\n*..*...*..\n0", "output": "5\n3\n"}, {"type": "s... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nA bus moves along the coordinate line Ox from the point x = 0 to the point x = a. After starting from the point x = 0, it reaches the point x = a, immediately turns back and then moves to the point x = 0. After returning ... | [{"type": "stdin_stdout", "input": "1000000 1000000 500000 10000\n", "output": "10000\n"}, {"type": "stdin_stdout", "input": "1000000 1000000000 999999 10000\n", "output": "10\n"}, {"type": "stdin_stdout", "input": "1000000 1000000000 999999 10000\n", "output": "10\n"}, {"type": "stdin_stdout", "input": "1000000 100000... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\n# Task\nGiven two integers `a` and `b`, return the sum of the numerator and the denominator of the reduced fraction `a/b`.\n\n# Example\n\nFor `a = 2, b = 4`, the result should be `3`\n\nSince `2/4 = 1/2 => 1 + 2 = 3`.\n\... | [{"input": "100\n1000", "output": "[11]", "fn_name": "fraction"}, {"input": "114\n200", "output": "[157]", "fn_name": "fraction"}, {"input": "3\n118", "output": "[121]", "fn_name": "fraction"}, {"input": "90\n120", "output": "[7]", "fn_name": "fraction"}, {"input": "3\n15", "output": "[6]", "fn_name": "fraction"}, {"in... | code_functional |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nDr. Evil is interested in math and functions, so he gave Mahmoud and Ehab array a of length n and array b of length m. He introduced a function f(j) which is defined for integers j, which satisfy 0 ≤ j ≤ m - n. Suppose, c... | [{"type": "stdin_stdout", "input": "1 1 1\n1107891008\n15017817\n1 1 821220804\n", "output": "1092873191\n1914093995\n"}, {"type": "stdin_stdout", "input": "1 1 1\n937982044\n179683049\n1 1 821220804\n", "output": "758298995\n1579519799\n"}, {"type": "stdin_stdout", "input": "1 1 1\n937982044\n179683049\n1 1 821220804\... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nPrint all combinations which can be made by $k$ different elements from $0, 1, ..., n-1$. Note that we represent $0, 1, ... n-1$ as 00...0001, 00...0010, 00...0100, ..., 10...0000 in binary respectively and the integer re... | [{"type": "stdin_stdout", "input": "10 5", "output": "31: 0 1 2 3 4\n47: 0 1 2 3 5\n55: 0 1 2 4 5\n59: 0 1 3 4 5\n61: 0 2 3 4 5\n62: 1 2 3 4 5\n79: 0 1 2 3 6\n87: 0 1 2 4 6\n91: 0 1 3 4 6\n93: 0 2 3 4 6\n94: 1 2 3 4 6\n103: 0 1 2 5 6\n107: 0 1 3 5 6\n109: 0 2 3 5 6\n110: 1 2 3 5 6\n115: 0 1 4 5 6\n117: 0 2 4 5 6\n118: ... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nBasic regex tasks. Write a function that takes in a numeric code of any length. The function should check if the code begins with 1, 2, or 3 and return `true` if so. Return `false` otherwise. \n\nYou can assume the input ... | [{"input": "9453", "output": "[false]", "fn_name": "validate_code"}, {"input": "123", "output": "[true]", "fn_name": "validate_code"}, {"input": "248", "output": "[true]", "fn_name": "validate_code"}, {"input": "321", "output": "[true]", "fn_name": "validate_code"}, {"input": "8", "output": "[false]", "fn_name": "valid... | code_functional |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nWilson primes satisfy the following condition.\nLet ```P``` represent a prime number. \n\nThen ```((P-1)! + 1) / (P * P)``` should give a whole number.\n\nYour task is to create a function that returns ```true``` if the g... | [{"input": "101", "output": "[false]", "fn_name": "am_i_wilson"}, {"input": "569", "output": "[false]", "fn_name": "am_i_wilson"}, {"input": "11", "output": "[false]", "fn_name": "am_i_wilson"}, {"input": "563", "output": "[true]", "fn_name": "am_i_wilson"}, {"input": "0", "output": "[false]", "fn_name": "am_i_wilson"}... | code_functional |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nThere is a function f(x), which is initially a constant function f(x) = 0.\nWe will ask you to process Q queries in order. There are two kinds of queries, update queries and evaluation queries, as follows:\n - An update q... | [{"type": "stdin_stdout", "input": "4\n1 -1000000000 1000000000\n1 -1000000000 1000000000\n1 -1000000000 1000000000\n2\n", "output": "-1000000000 3000000000\n"}, {"type": "stdin_stdout", "input": "4\n1 -1000000000 1000000000\n1 -1000000000 0000000000\n1 -1000000000 1000000000\n2", "output": "-1000000000 2000000000\n"},... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nOur old friend Alexey has finally entered the University of City N — the Berland capital. Alexey expected his father to get him a place to live in but his father said it was high time for Alexey to practice some financial... | [{"type": "stdin_stdout", "input": "71\n1 99\n11 69\n86 92\n7 49\n31 70\n42 53\n48 81\n86 96\n36 91\n19 38\n39 91\n41 64\n87 93\n83 97\n40 41\n3 32\n15 18\n58 65\n22 32\n1 71\n58 86\n64 77\n15 69\n4 34\n42 89\n9 66\n15 18\n58 65\n59 96\n39 89\n19 38\n6 63\n26 73\n29 47\n55 88\n5 78\n41 74\n48 81\n20 71\n59 96\n42 49\n4... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nGiven are a sequence of N positive integers A_1, A_2, \\ldots, A_N and another positive integer S.\n\nFor a non-empty subset T of the set \\{1, 2, \\ldots , N \\}, let us define f(T) as follows:\n\n - f(T) is the number o... | [{"type": "stdin_stdout", "input": "2896 1518\n498 2010 1723 2089 76 1224 1972 612 465 880 283 143 1538 372 841 1998 292 2096 423 728 2199 807 2325 1185 1664 2349 531 40 1039 2006 2179 1842 2954 2847 2540 1045 2697 2112 1625 2062 631 2136 544 2420 1199 2592 2820 802 1157 383 1164 617 1513 2876 2625 947 1720 1640 1772 2... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nA [sequence or a series](http://world.mathigon.org/Sequences), in mathematics, is a string of objects, like numbers, that follow a particular pattern. The individual elements in a sequence are called terms. A simple examp... | [{"input": "10", "output": "[[0, 1, 3, 6, 10, 15, 21, 28, 36, 45, 55]]", "fn_name": "sum_of_n"}, {"input": "-4", "output": "[[0, -1, -3, -6, -10]]", "fn_name": "sum_of_n"}, {"input": "3", "output": "[[0, 1, 3, 6]]", "fn_name": "sum_of_n"}, {"input": "1", "output": "[[0, 1]]", "fn_name": "sum_of_n"}, {"input": "0", "out... | code_functional |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nN cells are arranged in a row. Some of them may contain tokens. You are given a string s that consists of `0`s and `1`s. If the i-th character of s is `1`, the i-th cell (from left) contains a token. Otherwise, it doesn't... | [{"type": "stdin_stdout", "input": "50\n10101000010011011110001001111110001101010111100110", "output": "11\n"}, {"type": "stdin_stdout", "input": "50\n10101000010011011010001001111110001101010111100100", "output": "10\n"}, {"type": "stdin_stdout", "input": "50\n10101110010101010110001001011111001001110111000000", "outp... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nThere are $n$ cities and $m$ bidirectional roads in Berland. The $i$-th road connects the cities $x_i$ and $y_i$, and has the speed limit $s_i$. The road network allows everyone to get from any city to any other city.\n\n... | [{"type": "stdin_stdout", "input": "4\n4 5 7\n4 1 3\n1 2 5\n2 1 6\n1 3 1\n3 4 4\n4 6 5\n1 2 1\n1 3 1\n1 4 2\n2 4 2\n4 3 1\n3 2 1\n3 2 10\n1 2 8\n1 3 10\n5 5 2\n1 2 17\n3 1 15\n2 3 18\n1 4 14\n2 5 12\n", "output": "1\n3\n0\n50\n"}, {"type": "stdin_stdout", "input": "4\n4 5 7\n4 1 3\n1 2 5\n2 1 6\n1 3 1\n3 4 4\n4 6 5\n1 ... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nOnce n people simultaneously signed in to the reception at the recently opened, but already thoroughly bureaucratic organization (abbreviated TBO). As the organization is thoroughly bureaucratic, it can accept and cater f... | [{"type": "stdin_stdout", "input": "12\n11 4\n9 2\n10000 100\n1000000000 2345\n123456 1234567\n123456 65536\n5 55\n5 3\n2323 10\n999111000 232323\n999888777 284079058\n999888777 777\n", "output": " 4\n ... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nWrite a code that receives an array of numbers or strings, goes one by one through it while taking one value out, leaving one value in, taking, leaving, and back again to the beginning until all values are out. \nIt's li... | [{"input": "[\"this\", \"code\", \"is\", \"right\", \"the\"]", "output": "[[\"this\", \"is\", \"the\", \"right\", \"code\"]]", "fn_name": "yes_no"}, {"input": "[1, 2, 3, 4, 5, 6, 7, 8, 9, 10]", "output": "[[1, 3, 5, 7, 9, 2, 6, 10, 8, 4]]", "fn_name": "yes_no"}, {"input": "[\"a\", \"b\"]", "output": "[[\"a\", \"b\"]]",... | code_functional |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nRead problems statements in Mandarin Chinese and Russian. \n\nChef likes trees a lot. Today he has an infinte full binary tree (each node has exactly two childs) with special properties.\nChef's tree has the following sp... | [{"type": "stdin_stdout", "input": "5\nQb 1 10\nQr 4 2\nQi\nQb 4 11\nQr 4 12", "output": "2\n1\n2\n3\n"}, {"type": "stdin_stdout", "input": "5\nQb 4 10\nQr 3 11\nQi\nQb 4 3\nQr 4 12", "output": "2\n3\n2\n3\n"}, {"type": "stdin_stdout", "input": "5\nQb 4 10\nQr 4 4\nQi\nQb 4 4\nQr 4 12", "output": "2\n0\n0\n3\n"}, {"typ... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nWe have two permutations P and Q of size N (that is, P and Q are both rearrangements of (1,~2,~...,~N)).\nThere are N! possible permutations of size N. Among them, let P and Q be the a-th and b-th lexicographically smalle... | [{"type": "stdin_stdout", "input": "8\n7 3 5 4 2 1 6 8\n3 8 2 5 4 6 7 1\n", "output": "17517\n"}, {"type": "stdin_stdout", "input": "8\n5 7 4 2 8 3 6 1\n1 7 8 4 6 2 5 3\n", "output": "19898\n"}, {"type": "stdin_stdout", "input": "8\n1 2 3 4 5 6 7 8\n8 7 6 5 4 3 2 1\n", "output": "40319\n"}, {"type": "stdin_stdout", "in... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\n# Task\n You are a magician. You're going to perform a trick.\n\n You have `b` black marbles and `w` white marbles in your magic hat, and an infinite supply of black and white marbles that you can pull out of nowhere. \n ... | [{"input": "10000\n10000", "output": "[\"White\"]", "fn_name": "not_so_random"}, {"input": "11111\n22222", "output": "[\"Black\"]", "fn_name": "not_so_random"}, {"input": "1\n1", "output": "[\"Black\"]", "fn_name": "not_so_random"}, {"input": "2\n1", "output": "[\"White\"]", "fn_name": "not_so_random"}, {"input": "1\n2... | code_functional |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nToday Tavas got his test result as an integer score and he wants to share it with his girlfriend, Nafas.\n\nHis phone operating system is Tavdroid, and its keyboard doesn't have any digits! He wants to share his score wit... | [{"type": "stdin_stdout", "input": "73\n", "output": "seventy-three\n"}, {"type": "stdin_stdout", "input": "77\n", "output": "seventy-seven\n"}, {"type": "stdin_stdout", "input": "78\n", "output": "seventy-eight\n"}, {"type": "stdin_stdout", "input": "77\n", "output": "seventy-seven\n"}, {"type": "stdin_stdout", "input... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nGiven a certain integer ```n```, we need a function ```big_primefac_div()```, that give an array with the highest prime factor and the highest divisor (not equal to n).\n\nLet's see some cases:\n```python\nbig_primefac_di... | [{"input": "-1800.1", "output": "[\"The number has a decimal part. No Results\"]", "fn_name": "big_primefac_div"}, {"input": "1969", "output": "[[179, 179]]", "fn_name": "big_primefac_div"}, {"input": "-1800", "output": "[[5, 900]]", "fn_name": "big_primefac_div"}, {"input": "100", "output": "[[5, 50]]", "fn_name": "bi... | code_functional |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nAsterix, Obelix and their temporary buddies Suffix and Prefix has finally found the Harmony temple. However, its doors were firmly locked and even Obelix had no luck opening them.\n\nA little later they found a string s, ... | [{"type": "stdin_stdout", "input": "btbdpnzdenxueteteytvkwnegodyhmdwhmrmbftrifytzudumzlacwytsuzefqfpjesdblxhpcsidgksisjdmhyxmmugrjmtfcgxmcgpmvbxbyszdugvmoyjeeqsywcvuqskcjotyhvdijyslgfvyujxthngnonasgnbzzygyikhfelirdfsvuicbiazfdeqecbtbdpnzdenxueteteytvkwnegodyhmdwhmrmbftrifytzudumzlacwytsuzefqfpjesdblxhpcsidgksisjdmhyxmm... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nAn English booklet has been created for publicizing Aizu to the world. When you read it carefully, you found a misnomer (an error in writing) on the last name of Masayuki Hoshina, the lord of the Aizu domain. The booklet ... | [{"type": "stdin_stdout", "input": "3\nHoshimo\nHashino\nMasayuki Hoshino was the grandson of Ieyasu Tokugawa.", "output": "Hoshimo\nHashino\nMasayuki Hoshina was the grandson of Ieyasu Tokugawa.\n"}, {"type": "stdin_stdout", "input": "3\nHoshimo\nHashino\nMasayuki Hoshino was the grandspn of Ieyasu Tokugawa.", "output... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nWhen Mr. X is away from home, he has decided to use his smartwatch to search the best route to go back home, to participate in ABC.\nYou, the smartwatch, has found N routes to his home.\nIf Mr. X uses the i-th of these ro... | [{"type": "stdin_stdout", "input": "100 79\n359 483\n836 935\n246 178\n901 621\n246 967\n428 447\n65 252\n294 631\n903 95\n965 92\n901 614\n528 580\n420 398\n727 132\n266 536\n991 973\n419 606\n710 676\n418 666\n268 141\n500 874\n685 455\n868 169\n222 348\n748 482\n535 214\n487 952\n52 336\n380 985\n581 209\n516 292\n2... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nA newspaper is published in Walrusland. Its heading is s1, it consists of lowercase Latin letters. Fangy the little walrus wants to buy several such newspapers, cut out their headings, glue them one to another in order to... | [{"type": "stdin_stdout", "input": "ehfjaabjfedhddejjfcfijagefhjeahjcddhchahjbagi\nfbfdjbjhibjgjgaaajgdbcfdbhjcajcbbieijhcjgajhgaa\n", "output": "10\n"}, {"type": "stdin_stdout", "input": "ehfjaabjfedhddejjfcfihagefhjeahjcddjchahjbagi\nfbfdjbjhibjgjgaaajgdbcfdbhjcajcbbieijhcjgajhgaa\n", "output": "10\n"}, {"type": "std... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nRecently Bob invented a new game with a tree (we should remind you, that a tree is a connected graph without cycles): he deletes any (possibly, zero) amount of edges of the tree, and counts the product of sizes of the con... | [{"type": "stdin_stdout", "input": "50\n45 39\n18 12\n13 6\n48 45\n46 36\n46 8\n40 36\n29 28\n2 18\n43 26\n25 14\n43 31\n13 30\n12 35\n38 42\n20 5\n7 35\n10 50\n27 13\n1 41\n24 21\n25 5\n7 31\n15 45\n32 25\n43 23\n4 50\n46 11\n40 14\n37 21\n50 2\n41 42\n43 30\n14 22\n36 48\n8 24\n49 20\n19 26\n32 10\n35 29\n1 6\n34 33\... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nYou are given an integer sequence A of length N and an integer K.\nYou will perform the following operation on this sequence Q times:\n - Choose a contiguous subsequence of length K, then remove the smallest element among... | [{"type": "stdin_stdout", "input": "2000 1161 195\n120890687 120890687 120890687 120890687 120890687 120890687 120890687 120890687 120890687 120890687 120890687 120890687 120890687 120890687 120890687 120890687 120890687 120890687 120890687 120890687 120890687 120890687 120890687 120890687 120890687 120890687 120890687... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nDima, Inna and Seryozha have gathered in a room. That's right, someone's got to go. To cheer Seryozha up and inspire him to have a walk, Inna decided to cook something. \n\nDima and Seryozha have n fruits in the fridge. E... | [{"type": "stdin_stdout", "input": "88 10\n6 64 43 1 1 1 8 15 39 1 95 2 1 80 36 40 25 2 52 24 29 26 16 45 96 99 1 91 16 97 67 1 39 91 1 41 72 67 93 84 1 12 67 53 26 1 14 39 94 92 28 75 10 16 81 97 77 22 1 1 41 90 51 49 90 74 5 61 1 45 88 1 40 7 4 59 16 33 6 4 92 1 38 20 4 53 10 80\n70 45 1 73 52 1 20 78 68 98 1 95 2 61... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nBerland SU holds yet another training contest for its students today. n students came, each of them brought his laptop. However, it turned out that everyone has forgot their chargers!\n\nLet students be numbered from 1 to... | [{"type": "stdin_stdout", "input": "7 200000\n66 57 15 65 32 46 30\n66 31 64 9 63 57 65\n", "output": "-1"}, {"type": "stdin_stdout", "input": "7 200000\n66 57 15 65 32 46 30\n7 31 64 9 63 57 65\n", "output": "-1\n"}, {"type": "stdin_stdout", "input": "6 200000\n66 57 15 65 32 46 30\n7 31 64 9 63 57 65\n", "output": "-... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nLet's call an array of non-negative integers $a_1, a_2, \\ldots, a_n$ a $k$-extension for some non-negative integer $k$ if for all possible pairs of indices $1 \\leq i, j \\leq n$ the inequality $k \\cdot |i - j| \\leq mi... | [{"type": "stdin_stdout", "input": "3\n1000000000 1000000000 1000000000\n", "output": "500000000\n"}, {"type": "stdin_stdout", "input": "3\n1000000000 1000000000 1000100000\n", "output": "500000000\n"}, {"type": "stdin_stdout", "input": "3\n1000000000 1000000000 1000100010\n", "output": "500000000\n"}, {"type": "stdin_... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nWe have a board with a 2 \\times N grid. Snuke covered the board with N dominoes without overlaps. Here, a domino can cover a 1 \\times 2 or 2 \\times 1 square.\n\nThen, Snuke decided to paint these dominoes using three c... | [{"type": "stdin_stdout", "input": "52\nRvvttdWIyyPPQFFZZssffEEkkaSSDKqcibbeYrhAljCCGGJppHHn\nRLLwwdWIxxNNQUUXXVVMMooCBaggDKqcimmeYrhAljOOTTJuuzzn", "output": "958681902\n"}, {"type": "stdin_stdout", "input": "52\nnHHppJGGCCjlAhrYebbicqKDSSakkEEffssZZFFQPPyyIWdttvvR\nnzzuuJTTOOjlAhrYemmicqKDggaBBooMMVVXXUUQNNxxIWdwwLLR... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nWilbur the pig is tinkering with arrays again. He has the array a_1, a_2, ..., a_{n} initially consisting of n zeros. At one step, he can choose any index i and either add 1 to all elements a_{i}, a_{i} + 1, ... , a_{n} o... | [{"type": "stdin_stdout", "input": "22\n1000000000 -1000000000 1000000000 -1000000000 1000000000 -1000000000 1000000000 -1000000000 1000000000 -1000000000 1000000000 -1000000000 1000000000 -1000000000 1000000000 -1000000000 1000000000 -1000000000 1000000000 -1000000000 1000000000 -1000000000\n", "output": "43000000000\... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nYou are given a simple code of a function and you would like to know what it will return. \n\nF(N, K, Answer, Operator, A[N]) returns int;\nbegin\nfor i=1..K do\nfor j=1..N do\nAnswer=(Answer operator A_{j})\nreturn Answe... | [{"type": "stdin_stdout", "input": "3\n3 1 -1\n1 0 6\nXOR\n3 1 0\n1 2 3\nAND\n3 2 1\n-1 2 1\nOR", "output": "-8\n0\n-1\n"}, {"type": "stdin_stdout", "input": "3\n3 1 -1\n1 3 3\nXOR\n2 1 0\n1 1 3\nAND\n3 0 -2\n0 3 4\nOR", "output": "-2\n0\n-2\n"}, {"type": "stdin_stdout", "input": "3\n3 1 -1\n1 2 6\nXOR\n3 1 0\n1 2 3\nA... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nDr. Bruce Banner hates his enemies (like others don't). As we all know, he can barely talk when he turns into the incredible Hulk. That's why he asked you to help him to express his feelings.\n\nHulk likes the Inception s... | [{"type": "stdin_stdout", "input": "100\n", "output": "I hate that I love that I hate that I love that I hate that I love that I hate that I love that I hate that I love that I hate that I love that I hate that I love that I hate that I love that I hate that I love that I hate that I love that I hate that I love that I... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nThe Fire Lord attacked the Frost Kingdom. He has already got to the Ice Fortress, where the Snow Queen dwells. He arranged his army on a segment n in length not far from the city walls. And only the frost magician Solomon... | [{"type": "stdin_stdout", "input": "23\n99 110 99 100 100 100 100 99 100 99 99 100 000 100 99 111 100 100 100 99 99 99 99\n", "output": "ARARARARARARARARARARARARALLLLLLLLLLLLAARARARARARARARARARARARARALLLLLLLLLLLLAARARARARARARARARARARARARALLLLLLLLLLLLAARARARARARARARARARARARARALLLLLLLLLLLLAARARARARARARARARARARARARALLLLLL... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nThe World Programming Olympics Medal is a metal disk, consisting of two parts: the first part is a ring with outer radius of r1 cm, inner radius of r2 cm, (0 < r2 < r1) made of metal with density p1 g/cm3. The second part... | [{"type": "stdin_stdout", "input": "10 24 2621 2533 3148 3544 4273 4921 2950 3780 4483\n10 1687 4906 4246 2814 1874 3020 3039 3971 102 492\n10 3458 2699 2463 4395 3607 550 1608 958 3970 3077\n4 891\n", "output": "4919.7621246685\n"}, {"type": "stdin_stdout", "input": "10 24 2621 2533 3148 3544 4273 4921 2950 3780 4461\... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nThe Ohgas are a prestigious family based on Hachioji. The head of the family, Mr. Nemochi Ohga, a famous wealthy man, wishes to increase his fortune by depositing his money to an operation company. You are asked to help M... | [{"type": "stdin_stdout", "input": "4\n1000000\n8\n2\n0 0.7358189007888192 3000\n1 0.17615020446016216 3825\n6620000\n7\n2\n0 0.6920348397011968 48227\n0 0.0740966796875 40942\n56271855\n4\n4\n0 0.19624457693261887 30754\n1 0.00634765625 26165\n0 1.6296802800223897 27575\n0 0.8924194187554844 10932\n6380784\n0\n4\n1 0.... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nComrade Dujikov is busy choosing artists for Timofey's birthday and is recieving calls from Taymyr from Ilia-alpinist.\n\nIlia-alpinist calls every n minutes, i.e. in minutes n, 2n, 3n and so on. Artists come to the comra... | [{"type": "stdin_stdout", "input": "10000 10000 10000\n", "output": "1\n"}, {"type": "stdin_stdout", "input": "10000 10000 10000\n", "output": "1\n"}, {"type": "stdin_stdout", "input": "1 10000 10000\n", "output": "1\n"}, {"type": "stdin_stdout", "input": "10000 1 10000\n", "output": "1\n"}, {"type": "stdin_stdout", "i... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nYou are given a string S.\n\nTakahashi can insert the character `A` at any position in this string any number of times.\n\nCan he change S into `AKIHABARA`?\n\nConstraints\n\n* 1 \\leq |S| \\leq 50\n* S consists of upperc... | [{"type": "stdin_stdout", "input": "ARAABHAIKAA", "output": "NO\n"}, {"type": "stdin_stdout", "input": "AR@ABHAIKAA", "output": "NO\n"}, {"type": "stdin_stdout", "input": "AR@ABHAIJAA", "output": "NO\n"}, {"type": "stdin_stdout", "input": "AAJIAHBA@RA", "output": "NO\n"}, {"type": "stdin_stdout", "input": "AAIJAHBA@RA"... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nCoffee Vending Machine Problems [Part 1]\n\nYou have a vending machine, but it can not give the change back. You decide to implement this functionality. First of all, you need to know the minimum number of coins for this ... | [{"input": "239\n[1, 2, 3, 10]", "output": "[26]", "fn_name": "optimal_number_of_coins"}, {"input": "333\n[1, 1, 5, 25]", "output": "[17]", "fn_name": "optimal_number_of_coins"}, {"input": "543\n[1, 3, 5, 25]", "output": "[25]", "fn_name": "optimal_number_of_coins"}, {"input": "777\n[1, 2, 3, 10]", "output": "[80]", "f... | code_functional |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nBash wants to become a Pokemon master one day. Although he liked a lot of Pokemon, he has always been fascinated by Bulbasaur the most. Soon, things started getting serious and his fascination turned into an obsession. Si... | [{"type": "stdin_stdout", "input": "BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBbbbbbbbbbbbbbbbbbbbbuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuullllllllllllllllllllssssssssssssssssssssaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nPari has a friend who loves palindrome numbers. A palindrome number is a number that reads the same forward or backward. For example 12321, 100001 and 1 are palindrome numbers, while 112 and 1021 are not.\n\nPari is tryin... | [{"type": "stdin_stdout", "input": "11635543554796045289140983157483950524203250955411464324183518580611424141988904394156045071683009945\n", "output": "11635543554796045289140983157483950524203250955411464324183518580611424141988904394156045071683009945549900386170540651493409889141424116085815381423464114559052302425... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nProblem Statement\n\nYou want to compete in ICPC (Internet Contest of Point Collection). In this contest, we move around in $N$ websites, numbered $1$ through $N$, within a time limit and collect points as many as possibl... | [{"type": "stdin_stdout", "input": "5 4 10\n4 3 1\n6 4 3\n3 2 4\n2 2 1\n0 5 3\n1 2\n2 1\n3 4\n4 5\n3 3 1000\n1000 2 100\n1 7 100\n10 9 100\n1 2\n1 1\n3 2\n1 0 5\n25 25 2\n1 -1 25\n25 25 2\n5 5 100\n1 1 20\n1 1 20\n10 1 1\n10 1 1\n10 1 0\n1 2\n2 1\n3 4\n4 5\n5 3\n3 3 100\n70 17 10\n50 16 20\n90 10 10\n1 2\n2 2\n2 3\n0 0... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nPetya has recently started working as a programmer in the IT city company that develops computer games.\n\nBesides game mechanics implementation to create a game it is necessary to create tool programs that can be used by... | [{"type": "stdin_stdout", "input": "870 396 187 223 444 202 222 732\n", "output": "999.7945324433952405951409048 550.7817151597707949206572664\n699.8933625471825917263579697 538.6454762496719970710223890\n784.9466812735912958354234092 467.3227381248359985355111945\n314.6021379638620081853339627 -93.56941780067005040577... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\n## Task\n\n**_Given_** *an array of integers* , **_Find_** **_the maximum product_** *obtained from multiplying 2 adjacent numbers in the array*.\n____\n\n# Notes\n\n* **_Array/list_** size is *at least 2*.\n\n* **_Array/... | [{"input": "[-23, 4, -5, 99, -27, 329, -2, 7, -921]", "output": "[-14]", "fn_name": "adjacent_element_product"}, {"input": "[9, 5, 10, 2, 24, -1, -48]", "output": "[50]", "fn_name": "adjacent_element_product"}, {"input": "[5, 6, -4, 2, 3, 2, -23]", "output": "[30]", "fn_name": "adjacent_element_product"}, {"input": "[3... | code_functional |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nIn some country there are exactly n cities and m bidirectional roads connecting the cities. Cities are numbered with integers from 1 to n. If cities a and b are connected by a road, then in an hour you can go along this r... | [{"type": "stdin_stdout", "input": "10 11\n1 3\n2 3\n3 4\n4 5\n4 6\n3 7\n3 10\n4 9\n4 10\n7 9\n8 10\n1 1 3\n6 2 3\n", "output": "8\n"}, {"type": "stdin_stdout", "input": "10 11\n1 3\n2 3\n3 4\n4 5\n4 6\n3 7\n3 10\n4 9\n4 10\n7 9\n8 10\n1 1 3\n6 2 5\n", "output": "8\n"}, {"type": "stdin_stdout", "input": "10 11\n1 3\n2 ... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nYou are given an infinite checkered field. You should get from a square (x1; y1) to a square (x2; y2). Using the shortest path is not necessary. You can move on the field squares in four directions. That is, when you are ... | [{"type": "stdin_stdout", "input": "999999999 1000000000 1000000000 -999999999 -1000000000 999999999\n", "output": "1\n"}, {"type": "stdin_stdout", "input": "101304499 148554333 -590787464 -890180401 -117457421 997140710\n", "output": "12\n"}, {"type": "stdin_stdout", "input": "1000000000 1000000000 871940474 991768763... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nAfter a successful year of milk production, Farmer John is rewarding his cows with their favorite treat: tasty grass!\n\nOn the field, there is a row of n units of grass, each with a sweetness s_i. Farmer John has m cows,... | [{"type": "stdin_stdout", "input": "20 8\n7 4 9 6 4 10 5 12 6 13 20 16 11 1 12 10 11 2 3 18\n6 1\n20 4\n10 6\n2 9\n10 17\n13 19\n1 5\n3 1\n", "output": "2 3"}, {"type": "stdin_stdout", "input": "20 8\n7 4 9 6 4 10 5 12 6 13 20 2 11 1 12 10 11 2 3 18\n6 1\n20 4\n10 6\n2 9\n10 17\n13 19\n1 5\n3 1\n", "output": "2 3"}, {"... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nThere are N people, conveniently numbered 1 through N.\nThey were standing in a row yesterday, but now they are unsure of the order in which they were standing.\nHowever, each person remembered the following fact: the abs... | [{"type": "stdin_stdout", "input": "8\n7 5 1 1 7 3 5 3\n", "output": "16\n"}, {"type": "stdin_stdout", "input": "7\n-10 4 1 -2 3 -2 1", "output": "0\n"}, {"type": "stdin_stdout", "input": "7\n-10 4 1 -2 3 -2 0", "output": "0\n"}, {"type": "stdin_stdout", "input": "7\n-20 4 1 -2 3 -2 0", "output": "0\n"}, {"type": "stdi... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nChef loves research! Now he is looking for subarray of maximal length with non-zero product.\nChef has an array A with N elements: A1, A2, ..., AN. \n\nSubarray Aij of array A is elements from index i to index j: Ai, Ai+1... | [{"type": "stdin_stdout", "input": "6\n1 0 2 3 0 4\n", "output": "2\n"}, {"type": "stdin_stdout", "input": "6\n-1 0 2 3 0 6", "output": "2\n"}, {"type": "stdin_stdout", "input": "6\n-1 0 4 3 0 6", "output": "2\n"}, {"type": "stdin_stdout", "input": "6\n-1 0 4 4 0 6", "output": "2\n"}, {"type": "stdin_stdout", "input": ... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nFormula One championship consists of series of races called Grand Prix. After every race drivers receive points according to their final position. Only the top 10 drivers receive points in the following order 25, 18, 15, ... | [{"type": "stdin_stdout", "input": "1\n50\nJamesHunt\nNakajima\nHakkinen\nScheckter\nJones\nHill\nHawthorn\nVettel\nHulkenberg\nSutil\nGlock\nWebber\nAlbertoAscari\nMensel\nBuemi\nKubica\ndiGrassi\nJimClark\nKovalainen\nTrulli\nBarichelo\nSurtees\nJackieStewert\nLauda\nRaikkonen\nVilleneuve\nFangio\nButton\nDeLaRosa\nP... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nShubham has a binary string $s$. A binary string is a string containing only characters \"0\" and \"1\".\n\nHe can perform the following operation on the string any amount of times: Select an index of the string, and fl... | [{"type": "stdin_stdout", "input": "18\n010\n100100011010\n001\n010101\n101\n1100111101101110\n101100\n0001100101001100\n111110101100\n01100\n0110111100\n110101\n10000011001010010001\n0011\n00001010110100000101\n11011101110\n011000011101000010\n1001111110001000\n", "output": "1\n4\n0\n2\n1\n4\n1\n6\n2\n1\n2\n2\n6\n0\n6... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nYou are given a string $s$ consisting of the characters '0', '1', and '?'. You need to replace all the characters with '?' in the string $s$ by '0' or '1' so that the string becomes a palindrome and has exactly $a$ charac... | [{"type": "stdin_stdout", "input": "9\n4 4\n0????1?0\n3 3\n??????\n1 0\n?\n2 2\n1001\n2 2\n01?0\n0 1\n0\n0 3\n?11\n2 2\n?00?\n4 3\n??010?0\n", "output": "00111100\n-1\n0\n1001\n0110\n-1\n111\n1001\n0101010\n"}, {"type": "stdin_stdout", "input": "9\n4 4\n0?????10\n3 3\n??????\n1 0\n?\n2 2\n0110\n2 2\n01?0\n0 1\n0\n0 3\n... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nCucumber boy is fan of Kyubeat, a famous music game.\n\nKyubeat has 16 panels for playing arranged in 4 × 4 table. When a panel lights up, he has to press that panel.\n\nEach panel has a timing to press (the preffered tim... | [{"type": "stdin_stdout", "input": "4\n15168\n..7.\n.7..\n7...\n", "output": "YES\n"}, {"type": "stdin_stdout", "input": "1\n.135\n1247\n3468\n5789\n", "output": "YES\n"}, {"type": "stdin_stdout", "input": "5\n..1.\n1111\n..1.\n..1.\n", "output": "YES\n"}, {"type": "stdin_stdout", "input": "1\n....\n....\n....\n....\n"... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nRead problems statements in Mandarin Chinese and Russian as well. \n\n\tMike is given an undirected graph G of N vertices and M edges. A non-negative integer X_{i} is assigned to the i'th vertex of G, for 1 ≤ i ≤ N.\n\n\t... | [{"type": "stdin_stdout", "input": "11 0 1\n3 4 1\n3 1 9\n0 15 0\n3 4 1", "output": "0 0 0 0 0 0 0 0 0 0 0\n"}, {"type": "stdin_stdout", "input": "10 0 0\n2 4 9\n6 1 1\n0 0 0\n-1 10 1", "output": "0 0 0 0 0 0 0 0 0 -1\n"}, {"type": "stdin_stdout", "input": "10 0 1\n4 4 9\n3 1 8\n0 8 0\n4 10 1", "output": "0 0 0 0 0 0 0... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nThere are $n$ persons located on a plane. The $i$-th person is located at the point $(x_i, y_i)$ and initially looks at the point $(u_i, v_i)$.\n\nAt the same moment of time, all persons will start to rotate clockwise syn... | [{"type": "stdin_stdout", "input": "2\n2\n1000000000 1000000000 -1000000000 -1685444969\n-1000000000 -1073004450 1000010100 1000100000\n2\n1100000000 1000000000 -1000000000 -1742607922\n-1854126016 -1929941902 1000000000 1000000000\n", "output": "0\n0\n"}, {"type": "stdin_stdout", "input": "2\n2\n1000000000 1000000000 ... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nSelection of Participants of an Experiment\n\nDr. Tsukuba has devised a new method of programming training. In order to evaluate the effectiveness of this method, he plans to carry out a control experiment. Having two stu... | [{"type": "stdin_stdout", "input": "5\n10 0 1 10 14\n5\n1 5 25 9 11\n7\n10 20 83 43 143 31 62\n0", "output": "0\n2\n10\n"}, {"type": "stdin_stdout", "input": "5\n10 10 10 10 10\n5\n1 5 8 9 11\n7\n11 34 83 47 44 29 70\n0", "output": "0\n1\n3\n"}, {"type": "stdin_stdout", "input": "5\n10 10 10 1 10\n5\n1 5 8 13 11\n7\n11... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nTakahashi is a teacher responsible for a class of N students.\nThe students are given distinct student numbers from 1 to N.\nToday, all the students entered the classroom at different times.\nAccording to Takahashi's reco... | [{"type": "stdin_stdout", "input": "91\n13 42 58 64 76 15 46 37 62 71 25 14 3 61 2 75 44 45 65 74 79 48 41 72 1 10 73 8 63 83 47 36 40 33 87 7 23 38 54 28 60 29 35 57 80 5 11 43 66 50 30 21 12 20 19 51 27 82 69 70 4 68 89 78 17 18 67 26 91 56 9 53 49 32 6 39 84 22 88 59 55 86 24 34 81 85 52 77 31 90 16\n", "output": "2... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nYou are given an integer $n$.\n\nYou can perform any of the following operations with this number an arbitrary (possibly, zero) number of times: Replace $n$ with $\\frac{n}{2}$ if $n$ is divisible by $2$; Replace $n$ w... | [{"type": "stdin_stdout", "input": "7\n1\n14\n73\n30\n14\n39\n1000000000000000000\n", "output": "0\n-1\n-1\n6\n-1\n-1\n72\n"}, {"type": "stdin_stdout", "input": "7\n1\n7\n73\n52\n14\n39\n1000000000000000000\n", "output": "0\n-1\n-1\n-1\n-1\n-1\n72\n"}, {"type": "stdin_stdout", "input": "7\n1\n14\n73\n30\n14\n27\n100000... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nAfter a long day, Alice and Bob decided to play a little game. The game board consists of $n$ cells in a straight line, numbered from $1$ to $n$, where each cell contains a number $a_i$ between $1$ and $n$. Furthermore, n... | [{"type": "stdin_stdout", "input": "40\n5 40 6 27 39 37 17 34 3 30 28 13 12 8 11 10 31 4 1 16 38 22 29 35 33 23 7 9 24 14 18 26 19 21 15 36 2 20 32 25\n", "output": "ABABBBABABAAAAAABAAABBBBBBAAAABABBABABBB\n"}, {"type": "stdin_stdout", "input": "40\n5 40 6 27 39 37 17 34 3 30 28 13 12 8 11 10 31 4 1 16 38 22 29 35 33 ... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nFactorize a given integer n.\n\nConstraints\n\n* 2 ≤ n ≤ 109\n\nInput\n\n\nn\n\n\nAn integer n is given in a line.\n\nOutput\n\nPrint the given integer n and :. Then, print prime factors in ascending order. If n is divisi... | [{"type": "stdin_stdout", "input": "128", "output": "128: 2 2 2 2 2 2 2\n"}, {"type": "stdin_stdout", "input": "216", "output": "216: 2 2 2 3 3 3\n"}, {"type": "stdin_stdout", "input": "64", "output": "64: 2 2 2 2 2 2\n"}, {"type": "stdin_stdout", "input": "112", "output": "112: 2 2 2 2 7\n"}, {"type": "stdin_stdout", ... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nThere are n people taking part in auction today. The rules of auction are classical. There were n bids made, though it's not guaranteed they were from different people. It might happen that some people made no bids at all... | [{"type": "stdin_stdout", "input": "5\n3 4\n1 14\n4 20\n3 22\n5 28\n31\n1 1\n1 2\n2 1 2\n1 3\n2 1 3\n2 2 3\n3 1 2 3\n1 4\n2 1 4\n2 2 4\n3 1 2 4\n2 3 4\n3 1 3 4\n3 2 3 4\n4 1 2 3 4\n1 5\n2 1 5\n2 2 5\n3 1 2 5\n2 3 5\n3 1 3 5\n3 2 3 5\n4 1 2 3 5\n2 4 5\n3 1 4 5\n3 2 4 5\n4 1 2 4 5\n3 3 4 5\n4 1 3 4 5\n4 2 3 4 5\n5 1 2 3 ... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nYou are given an array $a$ consisting of $n$ non-negative integers. You have to choose a non-negative integer $x$ and form a new array $b$ of size $n$ according to the following rule: for all $i$ from $1$ to $n$, $b_i = a... | [{"type": "stdin_stdout", "input": "100\n74 88 64 8 9 27 63 64 79 97 92 38 26 1 4 4 2 64 53 62 24 82 76 40 48 58 40 59 3 56 35 37 0 30 93 71 14 97 49 37 96 59 56 55 70 88 77 99 51 55 71 25 10 31 26 50 61 18 35 55 49 33 86 25 65 74 89 99 5 27 2 9 67 29 76 68 66 22 68 59 63 16 62 25 35 57 63 35 41 68 86 22 91 67 61 3 92 ... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nA schoolboy named Vasya loves reading books on programming and mathematics. He has recently read an encyclopedia article that described the method of median smoothing (or median filter) and its many applications in scienc... | [{"type": "stdin_stdout", "input": "168\n0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 1 0 1 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 0 1 0 1 0 1... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nIn Arcady's garden there grows a peculiar apple-tree that fruits one time per year. Its peculiarity can be explained in following way: there are n inflorescences, numbered from 1 to n. Inflorescence number 1 is situated n... | [{"type": "stdin_stdout", "input": "100\n1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 ... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nIn Takahashi Kingdom, which once existed, there are N cities, and some pairs of cities are connected bidirectionally by roads.\nThe following are known about the road network:\n - People traveled between cities only throu... | [{"type": "stdin_stdout", "input": "3\n0 1000000000 1000000000\n1000000000 0 1000000000\n1000000000 1000000000 0\n", "output": "3000000000\n"}, {"type": "stdin_stdout", "input": "3\n0 1000000000 1000000000\n1000000000 0 1000000000\n1000000000 1000000000 0", "output": "3000000000"}, {"type": "stdin_stdout", "input": "5\... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nNow that Chef has finished baking and frosting his cupcakes, it's time to package them. Chef has N cupcakes, and needs to decide how many cupcakes to place in each package. Each package must contain the same number of cup... | [{"type": "stdin_stdout", "input": "2\n2\n137", "output": "2\n69\n"}, {"type": "stdin_stdout", "input": "2\n14\n35", "output": "8\n18\n"}, {"type": "stdin_stdout", "input": "2\n16\n35", "output": "9\n18\n"}, {"type": "stdin_stdout", "input": "2\n12\n35", "output": "7\n18\n"}, {"type": "stdin_stdout", "input": "2\n7\n26... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nDisclaimer: there are lots of untranslateable puns in the Russian version of the statement, so there is one more reason for you to learn Russian :)\n\nRick and Morty like to go to the ridge High Cry for crying loudly — th... | [{"type": "stdin_stdout", "input": "228\n1 3 1 7 1 3 1 15 1 3 1 7 1 3 1 31 1 3 1 7 1 3 1 15 1 3 1 7 1 3 1 63 1 3 1 7 1 3 1 15 1 3 1 7 1 3 1 31 1 3 1 7 1 3 1 15 1 3 1 7 1 3 1 127 1 3 1 7 1 3 1 15 1 3 1 7 1 3 1 31 1 3 1 7 1 3 1 15 1 3 1 7 1 3 1 63 1 3 1 7 1 3 1 15 0 3 1 13 1 3 1 31 1 3 1 7 1 3 1 15 1 3 1 7 1 3 1 255 1 3 ... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nA frog is about to return to the burrow. The burrow is D centimeters ahead of the frog, and the frog goes straight toward the burrow. There are only two actions that a frog can do:\n\n* Large jump (go forward L centimeter... | [{"type": "stdin_stdout", "input": "115 172", "output": "115\n"}, {"type": "stdin_stdout", "input": "135 191", "output": "135\n"}, {"type": "stdin_stdout", "input": "170 176", "output": "170\n"}, {"type": "stdin_stdout", "input": "208 133", "output": "76\n"}, {"type": "stdin_stdout", "input": "194 102", "output": "93\n... | code_stdio |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.