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\nNatsuki and her friends were taken to the space by an alien and made friends with a lot of aliens. During the space travel, she discovered that aliens’ hands were often very different from humans’. Generally speaking, in ... | [{"type": "stdin_stdout", "input": "23 4\n2 3\n3 1\n6 4\n5 2", "output": "1966080\n"}, {"type": "stdin_stdout", "input": "23 4\n2 3\n3 1\n6 6\n5 2", "output": "2621440\n"}, {"type": "stdin_stdout", "input": "24 4\n2 3\n3 2\n4 4\n5 2", "output": "6291456\n"}, {"type": "stdin_stdout", "input": "19 4\n2 2\n3 4\n4 3\n9 5",... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nYou are given an array of $n$ integers $a_1$, $a_2$, ..., $a_n$, and a set $b$ of $k$ distinct integers from $1$ to $n$.\n\nIn one operation, you may choose two integers $i$ and $x$ ($1 \\le i \\le n$, $x$ can be any inte... | [{"type": "stdin_stdout", "input": "100 2\n96 58 6 51 50 14 42 14 8 23 50 87 18 38 66 12 60 34 67 79 73 79 100 94 89 73 4 13 30 3 34 26 41 65 18 71 29 3 40 65 77 83 51 20 38 45 43 64 7 12 97 42 88 32 62 61 92 17 83 14 3 23 5 58 3 64 17 35 23 86 65 22 44 81 30 95 62 63 17 85 3 3 17 56 26 94 59 84 3 88 70 53 52 74 12 47 ... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nPavel cooks barbecue. There are n skewers, they lay on a brazier in a row, each on one of n positions. Pavel wants each skewer to be cooked some time in every of n positions in two directions: in the one it was directed o... | [{"type": "stdin_stdout", "input": "100\n87 69 49 86 96 12 10 79 29 66 48 77 73 62 70 52 22 28 97 35 91 5 33 82 65 85 68 80 64 8 38 23 94 34 75 53 57 6 100 2 56 50 55 58 74 9 18 44 40 3 43 45 99 51 21 92 89 36 88 54 42 14 78 71 25 76 13 11 27 72 7 32 93 46 83 30 26 37 39 31 95 59 47 24 67 16 4 15 1 98 19 81 84 61 90 41... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nIn order to celebrate Twice's 5th anniversary, Tzuyu and Sana decided to play a game.\n\nTzuyu gave Sana two integers $a$ and $b$ and a really important quest.\n\nIn order to complete the quest, Sana has to output the sma... | [{"type": "stdin_stdout", "input": "6\n6 12\n8 4\n90 1219\n55 14\n6484 2912\n2 1\n", "output": "10\n12\n1177\n57\n4660\n3\n"}, {"type": "stdin_stdout", "input": "6\n6 12\n13 4\n90 1219\n55 14\n6484 2912\n2 1\n", "output": "10\n9\n1177\n57\n4660\n3\n"}, {"type": "stdin_stdout", "input": "6\n6 12\n8 6\n90 1219\n55 14\n64... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\n##Task:\n\nYou have to write a function **pattern** which creates the following pattern upto n number of rows. *If the Argument is 0 or a Negative Integer then it should return \"\" i.e. empty string.*\n \n##Examples:\n... | [{"input": "5", "output": "[\"12345\\n2345\\n345\\n45\\n5\"]", "fn_name": "pattern"}, {"input": "2", "output": "[\"12\\n2\"]", "fn_name": "pattern"}, {"input": "-25", "output": "[\"\"]", "fn_name": "pattern"}, {"input": "1", "output": "[\"1\"]", "fn_name": "pattern"}, {"input": "0", "output": "[\"\"]", "fn_name": "patt... | code_functional |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nYou have $n$ barrels lined up in a row, numbered from left to right from one. Initially, the $i$-th barrel contains $a_i$ liters of water.\n\nYou can pour water from one barrel to another. In one act of pouring, you can c... | [{"type": "stdin_stdout", "input": "2\n4 1\n19 5 2 5\n3 2\n0 0 1\n", "output": "24\n1\n"}, {"type": "stdin_stdout", "input": "2\n4 1\n5 16 5 5\n3 2\n0 0 1\n", "output": "21\n1\n"}, {"type": "stdin_stdout", "input": "2\n4 3\n10 1 1 2\n3 2\n0 1 1\n", "output": "14\n2\n"}, {"type": "stdin_stdout", "input": "2\n4 1\n5 16 5... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nCreate a function with two arguments that will return an array of the first (n) multiples of (x). \n\nAssume both the given number and the number of times to count will be positive numbers greater than 0. \n\nReturn the r... | [{"input": "100\n5", "output": "[[100, 200, 300, 400, 500]]", "fn_name": "count_by"}, {"input": "50\n5", "output": "[[50, 100, 150, 200, 250]]", "fn_name": "count_by"}, {"input": "3\n5", "output": "[[3, 6, 9, 12, 15]]", "fn_name": "count_by"}, {"input": "2\n5", "output": "[[2, 4, 6, 8, 10]]", "fn_name": "count_by"}, {"... | code_functional |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nGiven the number pledged for a year, current value and name of the month, return string that gives information about the challenge status:\n\n- ahead of schedule\n- behind schedule\n- on track\n- challenge is completed\n\... | [{"input": "100\n53\n\"July\"", "output": "[\"You are 1 ahead of schedule!\"]", "fn_name": "check_challenge"}, {"input": "12\n12\n\"September\"", "output": "[\"Challenge is completed.\"]", "fn_name": "check_challenge"}, {"input": "12\n5\n\"March\"", "output": "[\"You are 3 ahead of schedule!\"]", "fn_name": "check_chal... | code_functional |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nGuy-Manuel and Thomas are going to build a polygon spaceship.\n\nYou're given a strictly convex (i. e. no three points are collinear) polygon P which is defined by coordinates of its vertices. Define P(x,y) as a polygon o... | [{"type": "stdin_stdout", "input": "8\n-440365664 -1386303283\n107345267 -994221803\n248590739 -968608613\n473576011 -880752952\n138674534 994450706\n-164464580 986382989\n-522092561 852888831\n-874210729 485546704\n", "output": "NO\n"}, {"type": "stdin_stdout", "input": "8\n-440365664 -897818514\n107345267 -994221803\... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nThe only difference between easy and hard versions is constraints.\n\nIvan plays a computer game that contains some microtransactions to make characters look cooler. Since Ivan wants his character to be really cool, he wa... | [{"type": "stdin_stdout", "input": "78 36\n0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0\n1 52\n2 6\n9 43\n10 52\n4 63\n9 35\n10 67\n9 17\n3 43\n4 38\n1 27\n9 44\n6 74\n7 3\n8 18\n1 52\n1 68\n5 51\n5 2\n7 50\n1... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nOne day Vitaly was going home late at night and wondering: how many people aren't sleeping at that moment? To estimate, Vitaly decided to look which windows are lit in the house he was passing by at that moment.\n\nVitaly... | [{"type": "stdin_stdout", "input": "100 1\n1 1\n1 1\n1 1\n1 1\n1 1\n1 1\n1 0\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\n0 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 0\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\nPetya loves lucky numbers very much. Everybody knows that lucky numbers are positive integers whose decimal record contains only the lucky digits 4 and 7. For example, numbers 47, 744, 4 are lucky and 5, 17, 467 are not.\... | [{"type": "stdin_stdout", "input": "86451 754 85 84\n", "output": "4444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nThere are $n + 1$ cities, numbered from $0$ to $n$. $n$ roads connect these cities, the $i$-th road connects cities $i - 1$ and $i$ ($i \\in [1, n]$).\n\nEach road has a direction. The directions are given by a string of ... | [{"type": "stdin_stdout", "input": "2\n6\nLRRRLL\n3\nLRL\n", "output": "\n1 3 2 3 1 3 2\n1 4 1 4\n"}, {"type": "stdin_stdout", "input": "2\n6\nLRRRLL\n3\nLRL\n", "output": "1 3 2 3 1 3 2\n1 4 1 4\n"}, {"type": "stdin_stdout", "input": "2\n6\nLLRRRL\n3\nLRL\n", "output": "1 2 3 2 3 1 3\n1 4 1 4\n"}, {"type": "stdin_stdo... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nA permutation is a sequence of $n$ integers from $1$ to $n$, in which all numbers occur exactly once. For example, $[1]$, $[3, 5, 2, 1, 4]$, $[1, 3, 2]$ are permutations, and $[2, 3, 2]$, $[4, 3, 1]$, $[0]$ are not.\n\nPo... | [{"type": "stdin_stdout", "input": "4\n7\n3 3 4 4 7 7 7\n4\n1 2 3 4\n7\n3 4 5 5 5 7 7\n1\n1\n", "output": "\n3 1 4 2 7 5 6 \n3 2 4 1 7 6 5 \n1 2 3 4 \n1 2 3 4 \n3 4 5 1 2 7 6 \n3 4 5 2 1 7 6 \n1 \n1 \n"}, {"type": "stdin_stdout", "input": "4\n7\n3 3 4 4 7 7 7\n4\n1 2 3 4\n7\n3 4 5 5 5 7 7\n1\n1\n", "output": "3 1 4 2 7... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nIt's been a tough week at work and you are stuggling to get out of bed in the morning.\n\nWhile waiting at the bus stop you realise that if you could time your arrival to the nearest minute you could get valuable extra mi... | [{"input": "\"23:57\"", "output": "[358]", "fn_name": "bus_timer"}, {"input": "\"00:00\"", "output": "[355]", "fn_name": "bus_timer"}, {"input": "\"10:00\"", "output": "[10]", "fn_name": "bus_timer"}, {"input": "\"10:45\"", "output": "[10]", "fn_name": "bus_timer"}, {"input": "\"05:10\"", "output": "[45]", "fn_name": "... | code_functional |
[
{
"content": "Solve the following coding problem using the programming language python:\n\n## Your Job\n\n Find the sum of all multiples of `n` below `m` \n \n \n## Keep in Mind\n\n * `n` and `m` are natural numbers (positive integers)\n * `m` is **excluded** from the multiples\n \n \n## Examples\n\nWrit... | [{"input": "123\n4567", "output": "[86469]", "fn_name": "sum_mul"}, {"input": "4\n-7", "output": "[\"INVALID\"]", "fn_name": "sum_mul"}, {"input": "-7\n4", "output": "[\"INVALID\"]", "fn_name": "sum_mul"}, {"input": "0\n2", "output": "[\"INVALID\"]", "fn_name": "sum_mul"}, {"input": "2\n0", "output": "[\"INVALID\"]", "... | code_functional |
[
{
"content": "Solve the following coding problem using the programming language python:\n\n\"The Chamber of Secrets has been opened again\" — this news has spread all around Hogwarts and some of the students have been petrified due to seeing the basilisk. Dumbledore got fired and now Harry is trying to enter th... | [{"type": "stdin_stdout", "input": "20 20\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\nWe have a sequence of k numbers: d_0,d_1,...,d_{k - 1}.\nProcess the following q queries in order:\n - The i-th query contains three integers n_i, x_i, and m_i.\nLet a_0,a_1,...,a_{n_i - 1} be the following sequence of n_... | [{"type": "stdin_stdout", "input": "7 3\n27 18 28 18 28 46 1000000000\n1000000000 1 7\n1000000000 2 10\n1000000000 3 12\n", "output": "224489796\n214285714\n559523809\n"}, {"type": "stdin_stdout", "input": "7 3\n27 18 15 18 28 73 1000000000\n1000000010 1 13\n1000000000 2 10\n1000010000 2 12", "output": "615384622\n3000... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nMisha and Grisha are funny boys, so they like to use new underground. The underground has n stations connected with n - 1 routes so that each route connects two stations, and it is possible to reach every station from any... | [{"type": "stdin_stdout", "input": "5 20\n5 5 1 4\n1 4 3\n2 4 1\n1 5 5\n5 1 4\n5 1 5\n1 5 5\n5 4 4\n2 3 3\n4 4 1\n1 4 1\n4 5 4\n1 4 5\n4 1 5\n2 4 2\n4 3 3\n2 5 5\n1 5 4\n3 3 4\n5 5 1\n3 4 1\n", "output": "3\n3\n3\n2\n3\n3\n2\n3\n2\n2\n2\n2\n2\n3\n3\n2\n2\n3\n3\n3\n"}, {"type": "stdin_stdout", "input": "5 20\n4 1 1 4\n2... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nIn 20XX, the Aizu Chuo Road, which has a total distance of 58km and 6 sections from Atsushiokanomachi, Kitakata City to Minamiaizucho, is scheduled to be completed and opened.\n\nFor half a year after opening, the toll wi... | [{"type": "stdin_stdout", "input": "2\n17 24\n4\n17 45\n2\n17 25\n7\n-1 35\n0", "output": "250\n1500\n"}, {"type": "stdin_stdout", "input": "2\n13 25\n6\n17 14\n4\n17 25\n7\n1 10\n0", "output": "1150\n1300\n"}, {"type": "stdin_stdout", "input": "2\n17 25\n4\n17 45\n4\n17 19\n7\n19 35\n0", "output": "250\n1300\n"}, {"ty... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nNate U. Smith runs a railroad company in a metropolitan area. In addition to his railroad company, there are rival railroad companies in this metropolitan area. The two companies are in a competitive relationship with eac... | [{"type": "stdin_stdout", "input": "2\n-10 1 10 1\n4\n-6 2 -2 -2 1 1\n-6 -2 -2 2 1 0\n12 2 1 -2 0 0\n11 -2 2 2 1 1\n8 12 -7 -3\n8\n4 -5 4 -2 1 2\n4 -2 4 9 1 0\n6 9 6 14 1 1\n-5 6 7 6 0 0\n1 0 1 10 0 0\n-5 0 -5 10 0 1\n-7 -1 7 0 0 1\n-1 -1 -1 -3 0 1", "output": "2\n3\n"}, {"type": "stdin_stdout", "input": "2\n-10 2 10 1... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nThere is Kannon-do in the mountain behind Ichiro's house. There are 30 steps from the foot to this Kannon-do, and Ichiro goes to Kannon-do almost every day. Ichiro can go up the stairs up to 3 steps with one foot. While p... | [{"type": "stdin_stdout", "input": "1\n1\n30\n27\n0", "output": "1\n1\n14740\n2369\n"}, {"type": "stdin_stdout", "input": "1\n17\n28\n27\n0", "output": "1\n6\n4357\n2369\n"}, {"type": "stdin_stdout", "input": "1\n1\n30\n25\n0", "output": "1\n1\n14740\n701\n"}, {"type": "stdin_stdout", "input": "1\n17\n28\n24\n0", "outp... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nProblem\n\nThere is a grid of $ R \\ times C $ squares with $ (0, 0) $ in the upper left and $ (R-1, C-1) $ in the lower right. When you are in a square ($ e $, $ f $), from there $ (e + 1, f) $, $ (e-1, f) $, $ (e, f + 1... | [{"type": "stdin_stdout", "input": "421 435 361 230 182 16", "output": "196 792283366\n"}, {"type": "stdin_stdout", "input": "421 547 377 188 235 13", "output": "156 501147202\n"}, {"type": "stdin_stdout", "input": "421 435 196 169 388 12", "output": "46 766230083\n"}, {"type": "stdin_stdout", "input": "421 435 196 169... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nAs the guys fried the radio station facilities, the school principal gave them tasks as a punishment. Dustin's task was to add comments to nginx configuration for school's website. The school has n servers. Each server ha... | [{"type": "stdin_stdout", "input": "10 10\nittmcs 112.147.123.173\njkt 228.40.73.178\nfwckqtz 88.28.31.198\nkal 224.226.34.213\nnacuyokm 49.57.13.44\nfouynv 243.18.250.17\ns 45.248.83.247\ne 75.69.23.169\nauwoqlch 100.44.219.187\nlkldjq 46.123.169.140\ngjcylatwzi 46.123.169.140;\ndxfi 88.28.31.198;\ngv 46.123.169.140;\... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nSome number of people (this number is even) have stood in a circle. The people stand in the circle evenly. They are numbered clockwise starting from a person with the number $1$. Each person is looking through the circle'... | [{"type": "stdin_stdout", "input": "7\n6 4 4\n2 3 0\n0 4 10\n5 3 4\n1 3 2\n4 5 12\n4 3 2\n", "output": "-1\n-1\n-1\n-1\n4\n-1\n-1\n"}, {"type": "stdin_stdout", "input": "7\n6 2 4\n2 3 0\n2 4 10\n5 3 4\n1 3 2\n2 5 8\n4 3 2\n", "output": "8\n-1\n-1\n-1\n4\n-1\n-1\n"}, {"type": "stdin_stdout", "input": "7\n6 2 4\n2 3 1\n2... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nR3D3 spent some time on an internship in MDCS. After earning enough money, he decided to go on a holiday somewhere far, far away. He enjoyed suntanning, drinking alcohol-free cocktails and going to concerts of popular loc... | [{"type": "stdin_stdout", "input": "100000000 100000000 100000000\n", "output": "266578227200000000\n"}, {"type": "stdin_stdout", "input": "100000000 100000000 100000000\n", "output": "266578227200000000\n"}, {"type": "stdin_stdout", "input": "100000000 100000010 100000000\n", "output": "266578239852872360\n"}, {"type"... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nYou are given two strings $s$ and $t$, both consisting of exactly $k$ lowercase Latin letters, $s$ is lexicographically less than $t$.\n\nLet's consider list of all strings consisting of exactly $k$ lowercase Latin letter... | [{"type": "stdin_stdout", "input": "12\nlylfekzszgqx\noewrpuflwlir\n", "output": "nbqykcppkvzu\n"}, {"type": "stdin_stdout", "input": "12\nlylfekzszgqx\noewrpuflwril\n", "output": "nbqykcppkyzr\n"}, {"type": "stdin_stdout", "input": "12\nlylfekzszgqx\noewrpuflwlir\n", "output": "nbqykcppkvzu"}, {"type": "stdin_stdout",... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nProblem\n\nFind the angle between the two given angles θ1 and θ2. Here, the angle between them is defined as \"θ1 & plus; t'when t'is the one with the smallest absolute value among the t satisfying θ1 & plus; t = θ2 − t\"... | [{"type": "stdin_stdout", "input": "20\n594", "output": "127.0000000000\n"}, {"type": "stdin_stdout", "input": "20\n704", "output": "182.0000000000\n"}, {"type": "stdin_stdout", "input": "20\n682", "output": "171.0000000000\n"}, {"type": "stdin_stdout", "input": "20\n253", "output": "316.5000000000\n"}, {"type": "stdin... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nTakahashi has a water bottle with the shape of a rectangular prism whose base is a square of side a~\\mathrm{cm} and whose height is b~\\mathrm{cm}. (The thickness of the bottle can be ignored.)\nWe will pour x~\\mathrm{c... | [{"type": "stdin_stdout", "input": "100 100 1000000\n", "output": "0.0000000000\n"}, {"type": "stdin_stdout", "input": "82 84 416241\n", "output": "28.3216596827\n"}, {"type": "stdin_stdout", "input": "22 75 24126\n", "output": "66.3790171829\n"}, {"type": "stdin_stdout", "input": "45 72 83481\n", "output": "53.8288157... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nLet's call an integer array $a_1, a_2, \\dots, a_n$ good if $a_i \\neq i$ for each $i$.\n\nLet $F(a)$ be the number of pairs $(i, j)$ ($1 \\le i < j \\le n$) such that $a_i + a_j = i + j$.\n\nLet's say that an array $a_1,... | [{"type": "stdin_stdout", "input": "10\n20000 -431912570 597469643\n20000 -13928452 414987414\n20000 -472808872 367983694\n20000 -84913058 517394906\n20000 -514402152 597357115\n20000 -720971736 526102810\n20000 -416160739 748291750\n20000 -665939649 743938438\n20000 -80741314 634025883\n20000 -824743396 138091345\n", ... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nYou are given a text consisting of n lines. Each line contains some space-separated words, consisting of lowercase English letters.\n\nWe define a syllable as a string that contains exactly one vowel and any arbitrary num... | [{"type": "stdin_stdout", "input": "4\n13 11 15 15\nto be or not to be that is the question\nwhether tis nobler in the mind to suffer\nthe slings and arrows of outrageous fortune\nor to take arms against a sea of troubles\n", "output": "YES\n"}, {"type": "stdin_stdout", "input": "4\n13 11 15 15\nto be or not to be that... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\n# altERnaTIng cAsE <=> ALTerNAtiNG CaSe\n\nDefine `String.prototype.toAlternatingCase` (or a similar function/method *such as* `to_alternating_case`/`toAlternatingCase`/`ToAlternatingCase` in your selected language; **see... | [{"input": "\"String.prototype.toAlternatingCase\"", "output": "[\"sTRING.PROTOTYPE.TOaLTERNATINGcASE\"]", "fn_name": "to_alternating_case"}, {"input": "\"hello world\"", "output": "[\"HELLO WORLD\"]", "fn_name": "to_alternating_case"}, {"input": "\"HELLO WORLD\"", "output": "[\"hello world\"]", "fn_name": "to_alternat... | code_functional |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nThe goal of this Kata is to reduce the passed integer to a single digit (if not already) by converting the number to binary, taking the sum of the binary digits, and if that sum is not a single digit then repeat the proce... | [{"input": "9889345778311094737448", "output": "[2]", "fn_name": "single_digit"}, {"input": "10000000000", "output": "[3]", "fn_name": "single_digit"}, {"input": "1234444123", "output": "[1]", "fn_name": "single_digit"}, {"input": "565656565", "output": "[3]", "fn_name": "single_digit"}, {"input": "234234235", "output"... | code_functional |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nPasha has recently bought a new phone jPager and started adding his friends' phone numbers there. Each phone number consists of exactly n digits.\n\nAlso Pasha has a number k and two sequences of length n / k (n is divisi... | [{"type": "stdin_stdout", "input": "100 1\n5 3 1 5 6 2 4 8 3 3 1 1 2 8 2 3 8 2 5 2 6 2 3 5 2 1 2 1 2 8 4 3 3 5 1 4 2 2 2 5 8 2 2 6 2 9 3 4 1 8 1 5 5 6 6 2 2 7 3 3 4 2 4 1 2 6 6 4 9 4 3 2 3 8 2 3 1 4 1 4 1 3 5 3 5 5 2 3 4 1 1 8 1 5 6 9 4 2 5 1\n6 0 4 5 3 1 0 7 5 3 5 4 5 4 0 2 1 6 2 2 4 3 1 9 5 9 2 2 6 8 6 5 9 6 4 9 9 7 ... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nIn this problem, a date is written as Y-M-D. For example, 2019-11-30 means November 30, 2019.\n\nIntegers M_1, D_1, M_2, and D_2 will be given as input.\nIt is known that the date 2019-M_2-D_2 follows 2019-M_1-D_1.\nDeter... | [{"type": "stdin_stdout", "input": "11 17\n11 122", "output": "0\n"}, {"type": "stdin_stdout", "input": "11 11\n11 101", "output": "0\n"}, {"type": "stdin_stdout", "input": "11 17\n11 17", "output": "0\n"}, {"type": "stdin_stdout", "input": "11 16\n11 28", "output": "0\n"}, {"type": "stdin_stdout", "input": "11 24\n11 ... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nThere are $n$ students standing in a circle in some order. The index of the $i$-th student is $p_i$. It is guaranteed that all indices of students are distinct integers from $1$ to $n$ (i. e. they form a permutation).\n\n... | [{"type": "stdin_stdout", "input": "5\n4\n1 2 3 4\n3\n1 3 2\n5\n1 2 3 5 4\n1\n1\n5\n3 2 1 5 4\n", "output": "YES\nYES\nNO\nYES\nYES\n"}, {"type": "stdin_stdout", "input": "5\n4\n1 2 3 4\n3\n1 3 2\n5\n1 2 3 5 4\n1\n1\n5\n3 2 1 5 4\n", "output": "YES\nYES\nNO\nYES\nYES\n"}, {"type": "stdin_stdout", "input": "1\n12\n12 2 ... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nMemory is performing a walk on the two-dimensional plane, starting at the origin. He is given a string s with his directions for motion: An 'L' indicates he should move one unit left. An 'R' indicates he should move one ... | [{"type": "stdin_stdout", "input": "RDDLLDLUUUDDRDRURLUUURLLDDLRLUURRLLRRLDRLLUDRLRULLDLRRLRLRLRUDUUDLULURLLDUURULURLLRRRURRRDRUUDLDRLRDRLRRDDLDLDLLUDRUDRLLLLDRDUULRUURRDLULLULDUDULRURRDDDLLUDRLUDDLDDDRRDDDULLLLDLDRLRRLRRDDRLULURRUDRDUUUULDURUDRDLDDUDUDRRURDULRRUDRLRRDLUURURDLDRLRDUDDDLDDDURURLUULRDUUULRURUDUDRRUDULLLU... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nI have a lot of friends. Every friend is very small.\nI often go out with my friends. Put some friends in your backpack and go out together.\nEvery morning I decide which friends to go out with that day. Put friends one b... | [{"type": "stdin_stdout", "input": "6 50\n10\n30\n13\n18\n12\n16", "output": "15\n"}, {"type": "stdin_stdout", "input": "6 37\n6\n16\n13\n18\n12\n16", "output": "10\n"}, {"type": "stdin_stdout", "input": "6 50\n6\n16\n13\n18\n12\n16", "output": "12\n"}, {"type": "stdin_stdout", "input": "6 37\n5\n16\n13\n18\n26\n33", "... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nThe end of the school year is near and Ms. Manana, the teacher, will soon have to say goodbye to a yet another class. She decided to prepare a goodbye present for her n students and give each of them a jigsaw puzzle (whic... | [{"type": "stdin_stdout", "input": "50 50\n374 573 323 744 190 806 485 247 628 336 491 606 702 321 991 678 337 579 86 240 993 208 668 686 855 205 363 177 719 249 896 919 782 434 59 647 787 996 286 216 636 212 546 903 958 559 544 126 608 993\n", "output": "937\n"}, {"type": "stdin_stdout", "input": "50 50\n374 573 323 7... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nIn the year 2xxx, an expedition team landing on a planet found strange objects made by an ancient species living on that planet. They are transparent boxes containing opaque solid spheres (Figure 1). There are also many l... | [{"type": "stdin_stdout", "input": "3\n95 20 180 18\n125 20 185 18\n40 26 195 10\n1\n6 5 5 4\n2\n5 5 5 4\n5 10 5 2\n2\n5 5 11 6\n0 7 5 3\n16\n2338 3465 29034 1351\n1571 14389 25019 842\n1706 8015 21355 1155\n1899 4359 33815 888\n2160 10364 20511 2353\n333 8835 6587 63\n2598 3176 23679 618\n1613 14217 8003 1505\n3140 47... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nYou're given an array $a_1, \\ldots, a_n$ of $n$ non-negative integers.\n\nLet's call it sharpened if and only if there exists an integer $1 \\le k \\le n$ such that $a_1 < a_2 < \\ldots < a_k$ and $a_k > a_{k+1} > \\ldot... | [{"type": "stdin_stdout", "input": "10\n1\n248618\n3\n23 21 11\n6\n110 11 15 10 1 14\n4\n0 2 1 0\n2\n0 0\n2\n0 1\n2\n1 0\n2\n1 0\n3\n0 1 0\n3\n1 0 1\n", "output": "YES\nYES\nYES\nYES\nNO\nYES\nYES\nYES\nYES\nNO\n"}, {"type": "stdin_stdout", "input": "10\n1\n248618\n3\n23 21 11\n6\n110 11 15 0 1 14\n4\n0 2 1 0\n2\n0 0\n... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nAre you going to Scarborough Fair?\n\nParsley, sage, rosemary and thyme.\n\nRemember me to one who lives there.\n\nHe once was the true love of mine.\n\nWillem is taking the girl to the highest building in island No.28, h... | [{"type": "stdin_stdout", "input": "67 39\nacbcbccccbabaabcabcaaaaaaccbcbbcbaaaacbbcccbcbabbcacccbbabbabbabaac\n4 36 a b\n25 38 a a\n3 44 b c\n35 57 b a\n4 8 a c\n20 67 c a\n30 66 b b\n27 40 a a\n2 56 a b\n10 47 c a\n22 65 c b\n29 42 a b\n1 46 c b\n57 64 b c\n20 29 b a\n14 51 c a\n12 55 b b\n20 20 a c\n2 57 c a\n22 60 ... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nYou will be given an integer a and a string s consisting of lowercase English letters as input.\nWrite a program that prints s if a is not less than 3200 and prints red if a is less than 3200.\n\n-----Constraints-----\n -... | [{"type": "stdin_stdout", "input": "4999\nzzzzzzzzzz\n", "output": "zzzzzzzzzz\n"}, {"type": "stdin_stdout", "input": "4998\nrainbow\n", "output": "rainbow\n"}, {"type": "stdin_stdout", "input": "3201\npurple\n", "output": "purple\n"}, {"type": "stdin_stdout", "input": "3200\npink\n", "output": "pink\n"}, {"type": "std... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nThe secret organization AiZu AnalyticS has launched a top-secret investigation. There are N people targeted, with identification numbers from 1 to N. As an AZAS Information Strategy Investigator, you have decided to deter... | [{"type": "stdin_stdout", "input": "100\n3 -1 100 3\n-1\n2 4 3", "output": "1\n"}, {"type": "stdin_stdout", "input": "100\n3 0 001 4\n-2\n2 10 3", "output": "2\n"}, {"type": "stdin_stdout", "input": "100\n3 0 001 4\n-3\n2 10 3", "output": "2\n"}, {"type": "stdin_stdout", "input": "100\n3 -1 100 3\n-1\n2 6 3", "output":... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\n**An [isogram](https://en.wikipedia.org/wiki/Isogram)** (also known as a \"nonpattern word\") is a logological term for a word or phrase without a repeating letter. It is also used by some to mean a word or phrase in whic... | [{"input": "\"Hjelmqvist-Gryb-Zock-Pfund-Wax\"", "output": "[true]", "fn_name": "is_isogram"}, {"input": "\"Emily Jung Schwartzkopf\"", "output": "[true]", "fn_name": "is_isogram"}, {"input": "\"thumbscrew-japingly\"", "output": "[true]", "fn_name": "is_isogram"}, {"input": "\"subdermatoglyphic\"", "output": "[true]", ... | code_functional |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nThis is a harder version of the problem. In this version, n ≤ 300 000.\n\nVasya is an experienced developer of programming competitions' problems. As all great minds at some time, Vasya faced a creative crisis. To improve... | [{"type": "stdin_stdout", "input": "500\n)))())(())((()))()((())())((()))()()(()(()))((()))(()()())()(())()()()(()()(()))((()))(((()))()())()((()))()()(()()(()())())(((()))()())(()())(()()(())())()((()))()()((())())(())()()()()()()(())()()(()())(((())))(()())((()))()((()))()(((()())))()(()(())())()(()())(()())(())((())... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nLittle Johnny has recently learned about set theory. Now he is studying binary relations. You've probably heard the term \"equivalence relation\". These relations are very important in many areas of mathematics. For examp... | [{"type": "stdin_stdout", "input": "2000\n", "output": "323848720\n"}, {"type": "stdin_stdout", "input": "4000\n", "output": "341934157\n"}, {"type": "stdin_stdout", "input": "2345\n", "output": "832335061\n"}, {"type": "stdin_stdout", "input": "2500\n", "output": "544067513\n"}, {"type": "stdin_stdout", "input": "2780... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nYou are beta testing the new secret Terraria update. This update will add quests to the game!\n\nSimply, the world map can be represented as an array of length $n$, where the $i$-th column of the world has height $a_i$.\n... | [{"type": "stdin_stdout", "input": "38 1\n2 999999999 2 999999999 2 999999999 2 999999999 2 999999999 2 999999999 2 999999999 2 999999999 2 999999999 2 999999999 2 999999999 2 999999999 2 999999999 2 999999999 2 999999999 2 999999999 2 999999999 2 999999999 2 999999999\n7 2\n", "output": "1999999994\n"}, {"type": "stdi... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nThere is a square field of size $n \\times n$ in which two cells are marked. These cells can be in the same row or column.\n\nYou are to mark two more cells so that they are the corners of a rectangle with sides parallel ... | [{"type": "stdin_stdout", "input": "6\n4\n..*.\n....\n*...\n....\n2\n*.\n.*\n2\n.*\n.*\n3\n*.*\n...\n...\n5\n.....\n..*..\n.....\n.*...\n.....\n4\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"}, {"type": "stdin... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nAnchored Balloon\n\nA balloon placed on the ground is connected to one or more anchors on the ground with ropes. Each rope is long enough to connect the balloon and the anchor. No two ropes cross each other. Figure E-1 sh... | [{"type": "stdin_stdout", "input": "3\n10 10 20\n10 -10 25\n-10 10 120\n1\n10 10 16\n2\n10 10 20\n10 -10 20\n2\n100 0 101\n-90 0 91\n2\n0 0 53\n40 40 102\n3\n10 10 20\n10 -10 20\n-10 -10 20\n3\n1 5 13\n5 -3 13\n-3 -2 13\n3\n98 97 168\n-82 -80 193\n-170 -160 211\n4\n90 -100 160\n-80 -80 150\n90 137 150\n80 80 245\n4\n85... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nThe numbers of all offices in the new building of the Tax Office of IT City will have lucky numbers.\n\nLucky number is a number that consists of digits 7 and 8 only. Find the maximum number of offices in the new building... | [{"type": "stdin_stdout", "input": "55\n", "output": "72057594037927934\n"}, {"type": "stdin_stdout", "input": "54\n", "output": "36028797018963966\n"}, {"type": "stdin_stdout", "input": "54\n", "output": "36028797018963966"}, {"type": "stdin_stdout", "input": "55\n", "output": "72057594037927934"}, {"type": "stdin_std... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nYou are given an array $a$ consisting of $n$ integers. You have to find the length of the smallest (shortest) prefix of elements you need to erase from $a$ to make it a good array. Recall that the prefix of the array $a=[... | [{"type": "stdin_stdout", "input": "5\n4\n1 2 3 4\n7\n4 8 3 16 4 10 2\n3\n0 1 1\n7\n1 3 1 4 5 3 2\n5\n5 3 3 2 5\n", "output": "0\n4\n0\n2\n3\n"}, {"type": "stdin_stdout", "input": "5\n4\n1 2 3 4\n7\n13 3 4 8 4 5 2\n3\n1 1 1\n7\n1 3 1 7 5 0 2\n5\n5 4 3 2 3\n", "output": "0\n4\n0\n5\n3\n"}, {"type": "stdin_stdout", "inpu... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nThis is the hard version of the problem. The difference between the versions is that the easy version has no swap operations. You can make hacks only if all versions of the problem are solved.\n\nPikachu is a cute and fri... | [{"type": "stdin_stdout", "input": "5\n2 0\n1 2\n2 1\n1 2\n1 2\n2 1\n2 1\n1 2\n3 9\n1 2 3\n1 2\n1 3\n2 3\n1 2\n1 3\n2 3\n1 2\n1 3\n2 3\n3 0\n3 2 1\n", "output": "2\n2\n2\n2\n2\n3\n4\n4\n3\n3\n3\n3\n4\n4\n3\n3\n"}, {"type": "stdin_stdout", "input": "5\n2 0\n1 2\n2 1\n1 2\n1 2\n2 1\n2 1\n1 2\n3 9\n1 2 3\n1 2\n1 3\n2 3\n1... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nG --Derangement / Derangement\n\nStory\n\nPerson D is doing research on permutations. At one point, D found a permutation class called \"Derangement\". \"It's cool to have a perfect permutation !!! And it starts with D !!... | [{"type": "stdin_stdout", "input": "5\n4 0 0 10 12", "output": "0\n"}, {"type": "stdin_stdout", "input": "5\n4 1 0 10 12", "output": "0\n"}, {"type": "stdin_stdout", "input": "5\n4 1 0 10 19", "output": "0\n"}, {"type": "stdin_stdout", "input": "5\n4 1 0 10 38", "output": "0\n"}, {"type": "stdin_stdout", "input": "5\n4... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nSnuke received a triangle as a birthday present. The coordinates of the three vertices were (x_1, y_1), (x_2, y_2), and (x_3, y_3).\n\nHe wants to draw two circles with the same radius inside the triangle such that the tw... | [{"type": "stdin_stdout", "input": "-1 -1\n1 1\n2 0", "output": "0.402627528107\n"}, {"type": "stdin_stdout", "input": "3 -1\n2 5\n1 16", "output": "0.143556168892\n"}, {"type": "stdin_stdout", "input": "-3 1\n1 1\n2 -1", "output": "0.548232156368\n"}, {"type": "stdin_stdout", "input": "6 -2\n2 5\n1 18", "output": "0.9... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nDefine a cyclic sequence of size $n$ as an array $s$ of length $n$, in which $s_n$ is adjacent to $s_1$.\n\nMuxii has a ring represented by a cyclic sequence $a$ of size $n$.\n\nHowever, the ring itself hates equal adjace... | [{"type": "stdin_stdout", "input": "1\n100\n60 76 89 77 41 81 42 49 39 37 48 56 26 38 85 50 40 13 20 24 79 21 22 9 92 11 45 58 55 62 69 82 97 67 18 32 88 84 19 96 7 36 83 95 52 98 44 53 12 75 90 87 28 3 1 6 15 65 68 94 30 99 78 63 46 86 47 73 72 66 74 80 35 70 51 33 16 93 34 10 23 71 17 5 2 64 43 100 29 8 27 31 14 25 5... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nFind the number, modulo 998244353, of sequences of length N consisting of 0, 1 and 2 such that none of their contiguous subsequences totals to X.\n\nConstraints\n\n* 1 \\leq N \\leq 3000\n* 1 \\leq X \\leq 2N\n* N and X a... | [{"type": "stdin_stdout", "input": "102 205", "output": "214138673\n"}, {"type": "stdin_stdout", "input": "169 205", "output": "909969555\n"}, {"type": "stdin_stdout", "input": "613 159", "output": "832714847\n"}, {"type": "stdin_stdout", "input": "325 205", "output": "688557253\n"}, {"type": "stdin_stdout", "input": "... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nOnce little Vasya read an article in a magazine on how to make beautiful handmade garland from colored paper. Vasya immediately went to the store and bought n colored sheets of paper, the area of each sheet is 1 square me... | [{"type": "stdin_stdout", "input": "hvewdvwdwudrwarwmddwnazmwauzatrmwptwwevavpmwrtruwnpwantewrnwmepdwvtmnveanunrvrtwpvhhnuhnmpptdttzmmndtvudmzhhannmmnahdpzamuvhzaavnhtnumwrwvttdetvuewaaennddwuvzvaptdzrzhtetwwzmzedrwuvrwznprhdvnavrruvvhzuwpdtmpwmzrwvermrhdamv\nuvzhwtpuputnahwwarduzddhpnwwvettprwavdmnztdnrddmarmvuevtdezn... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nIn the pet store on sale there are:\n\n$a$ packs of dog food;\n\n$b$ packs of cat food;\n\n$c$ packs of universal food (such food is suitable for both dogs and cats).\n\nPolycarp has $x$ dogs and $y$ cats. Is it possible ... | [{"type": "stdin_stdout", "input": "7\n1 1 4 2 3\n0 0 0 0 0\n5 5 0 4 6\n1 1 1 1 1\n50000000 50000000 100000000 100000000 100000000\n0 0 0 100000000 100000000\n1 3 2 2 5\n", "output": "YES\nYES\nNO\nYES\nYES\nNO\nNO\n"}, {"type": "stdin_stdout", "input": "3\n0 0 0 0 0\n2 1 0 2 2\n60 600 609 700 500\n", "output": "YES\nN... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nThe city administration of IT City decided to fix up a symbol of scientific and technical progress in the city's main square, namely an indicator board that shows the effect of Moore's law in real time.\n\nMoore's law is ... | [{"type": "stdin_stdout", "input": "10000 671249297\n", "output": "16096020.300745647400617599487304687500"}, {"type": "stdin_stdout", "input": "10001 671249297\n", "output": "16097629.902775721624493598937988281250"}, {"type": "stdin_stdout", "input": "11001 671249297\n", "output": "17707231.93285028636455535888671875... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nYou received as a gift a very clever robot walking on a rectangular board. Unfortunately, you understood that it is broken and behaves rather strangely (randomly). The board consists of N rows and M columns of cells. The ... | [{"type": "stdin_stdout", "input": "1000 1000\n162 276\n", "output": "3351.9999999997744\n"}, {"type": "stdin_stdout", "input": "1000 1000\n153 276\n", "output": "3387.9999999997344\n"}, {"type": "stdin_stdout", "input": "1000 1000\n162 234\n", "output": "3351.999999903682\n"}, {"type": "stdin_stdout", "input": "663 90... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nBackground\n----------\nIn another dimension, there exist two immortal brothers: Solomon and Goromon. As sworn loyal subjects to the time elemental, Chronixus, both Solomon and Goromon were granted the power to create tem... | [{"input": "[[2, 2, 100], [3, 1, 25], [4, 0, 8], [-6, 3, 25], [-1, 2, 80], [8, 0, 12], [-10, 3, 220], [0, 1, 150]]", "output": "[[530, 15664]]", "fn_name": "solomons_quest"}, {"input": "[[3, 2, 80], [1, 1, 25], [6, 0, 8], [-5, 3, 50], [1, 2, 100], [4, 0, 9], [-8, 3, 260], [0, 1, 90]]", "output": "[[-1880, 10368]]", "fn... | code_functional |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nEhab is interested in the bitwise-xor operation and the special graphs. Mahmoud gave him a problem that combines both. He has a complete graph consisting of n vertices numbered from 0 to n - 1. For all 0 ≤ u < v < n, vert... | [{"type": "stdin_stdout", "input": "1000000000000\n", "output": "20140978692096\n"}, {"type": "stdin_stdout", "input": "1000100000000\n", "output": "20142429742080\n"}, {"type": "stdin_stdout", "input": "1000100000010\n", "output": "20142429742357\n"}, {"type": "stdin_stdout", "input": "1001100000010\n", "output": "201... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nDo you like summer? Residents of Berland do. They especially love eating ice cream in the hot summer. So this summer day a large queue of n Berland residents lined up in front of the ice cream stall. We know that each of ... | [{"type": "stdin_stdout", "input": "10\n536259132 536259132 536259132 536259132 536259132 536259132 536259132 536259132 536259132 536259132\n", "output": "536259132 536259132 536259132 536259132 536259132 536259132 536259132 536259132 536259132 536259132 "}, {"type": "stdin_stdout", "input": "10\n876584065 876584063 87... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nYou are given an integer array $a_1, a_2, \\dots, a_n$ and integer $k$.\n\nIn one step you can\n\neither choose some index $i$ and decrease $a_i$ by one (make $a_i = a_i - 1$);\n\nor choose two indices $i$ and $j$ and set... | [{"type": "stdin_stdout", "input": "1\n98 282\n103 948 349 26 241 933 394 546 476 785 441 397 658 308 801 940 760 29 717 343 99 530 389 797 955 322 662 763 654 781 1814 185 622 960 363 84 375 998 331 572 236 837 604 874 376 362 649 482 860 718 54 298 574 1726 16 943 71 292 615 829 460 301 358 245 585 438 24 561 252 416... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\n# Write Number in Expanded Form - Part 2\n\nThis is version 2 of my ['Write Number in Exanded Form' Kata](https://www.codewars.com/kata/write-number-in-expanded-form).\n\nYou will be given a number and you will need to re... | [{"input": "693.230459", "output": "[\"600 + 90 + 3 + 2/10 + 3/100 + 4/10000 + 5/100000 + 9/1000000\"]", "fn_name": "expanded_form"}, {"input": "7.3004", "output": "[\"7 + 3/10 + 4/10000\"]", "fn_name": "expanded_form"}, {"input": "7.304", "output": "[\"7 + 3/10 + 4/1000\"]", "fn_name": "expanded_form"}, {"input": "1.2... | code_functional |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nAn X-layered kagami mochi (X ≥ 1) is a pile of X round mochi (rice cake) stacked vertically where each mochi (except the bottom one) has a smaller diameter than that of the mochi directly below it. For example, if you sta... | [{"type": "stdin_stdout", "input": "7\n50\n30\n50\n100\n50\n80\n30\n", "output": "4\n"}, {"type": "stdin_stdout", "input": "7\n50\n30\n50\n100\n50\n80\n35", "output": "5\n"}, {"type": "stdin_stdout", "input": "7\n50\n40\n91\n110\n50\n34\n59", "output": "6\n"}, {"type": "stdin_stdout", "input": "7\n50\n30\n50\n100\n50\n... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nPavel loves grid mazes. A grid maze is an n × m rectangle maze where each cell is either empty, or is a wall. You can go from one cell to another only if both cells are empty and have a common side.\n\nPavel drew a grid m... | [{"type": "stdin_stdout", "input": "19 20 196\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\nIt's holiday. Mashmokh and his boss, Bimokh, are playing a game invented by Mashmokh. \n\nIn this game Mashmokh writes sequence of n distinct integers on the board. Then Bimokh makes several (possibly zero) moves. On the ... | [{"type": "stdin_stdout", "input": "16199 5506872\n", "output": "5498774 10997548 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 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 8... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nFor integers b (b \\geq 2) and n (n \\geq 1), let the function f(b,n) be defined as follows:\n\n* f(b,n) = n, when n < b\n* f(b,n) = f(b,\\,{\\rm floor}(n / b)) + (n \\ {\\rm mod} \\ b), when n \\geq b\n\n\n\nHere, {\\rm ... | [{"type": "stdin_stdout", "input": "31415926535\n13", "output": "15707963262\n"}, {"type": "stdin_stdout", "input": "31415926535\n2", "output": "31415926534\n"}, {"type": "stdin_stdout", "input": "31415926535\n4", "output": "31415926532\n"}, {"type": "stdin_stdout", "input": "31415926535\n3", "output": "15707963267\n"}... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nLet's define the permutation of length n as an array p = [p1, p2, ..., pn] consisting of n distinct integers from range from 1 to n. We say that this permutation maps value 1 into the value p1, value 2 into the value p2 a... | [{"type": "stdin_stdout", "input": "50 20365011074\n", "output": "2 1 4 3 6 5 8 7 10 9 12 11 14 13 16 15 18 17 20 19 22 21 24 23 26 25 28 27 30 29 32 31 34 33 36 35 38 37 40 39 42 41 44 43 46 45 48 47 50 49 "}, {"type": "stdin_stdout", "input": "50 5608642004\n", "output": "1 2 4 3 5 6 8 7 9 10 11 13 12 15 14 17 16 18 ... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nPair of gloves\n=============\n\nWinter is coming, you must prepare your ski holidays. The objective of this kata is to determine the number of pair of gloves you can constitute from the gloves you have in your drawer.\n\... | [{"input": "[\"red\", \"green\", \"blue\", \"blue\", \"red\", \"green\", \"red\", \"red\", \"red\"]", "output": "[4]", "fn_name": "number_of_pairs"}, {"input": "[\"gray\", \"black\", \"purple\", \"purple\", \"gray\", \"black\"]", "output": "[3]", "fn_name": "number_of_pairs"}, {"input": "[\"red\", \"green\", \"blue\"]"... | code_functional |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nApparently \"Put A Pillow On Your Fridge Day is celebrated on the 29th of May each year, in Europe and the U.S. The day is all about prosperity, good fortune, and having bit of fun along the way.\"\n\nAll seems very weird... | [{"input": "[\"yF[CeAAiNihWEmKxJc/NRMVn\", \"rMeIa\\\\KAfbjuLiTnAQxNw[XB\"]", "output": "[true]", "fn_name": "pillow"}, {"input": "[\"\\\\DjQ\\\\[zv]SpG]Z/[Qm\\\\eLL\", \"amwZArsaGRmibriXBgTRZp\"]", "output": "[false]", "fn_name": "pillow"}, {"input": "[\"EvH/KNikBiyxfeyK/miCMj\", \"I/HwjnHlFLlahMOKNadps\"]", "output":... | code_functional |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nThe aim of the kata is to try to show how difficult it can be to calculate decimals of an irrational number with a certain precision. We have chosen to get a few decimals of the number \"pi\" using\nthe following infinite... | [{"input": "1e-06", "output": "[[1000001, 3.1415936536]]", "fn_name": "iter_pi"}, {"input": "0.0001", "output": "[[10000, 3.1414926536]]", "fn_name": "iter_pi"}, {"input": "1e-05", "output": "[[100001, 3.1416026535]]", "fn_name": "iter_pi"}, {"input": "0.001", "output": "[[1000, 3.1405926538]]", "fn_name": "iter_pi"}, ... | code_functional |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nGiven a set of integers (it can contain equal elements).\n\nYou have to split it into two subsets $A$ and $B$ (both of them can contain equal elements or be empty). You have to maximize the value of $mex(A)+mex(B)$.\n\nHe... | [{"type": "stdin_stdout", "input": "1\n100\n0 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 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 9... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nDescription\n\nIn 200X, the mysterious circle K, which operates at K University, announced K Poker, a new game they created on the 4th floor of K East during the university's cultural festival.\nAt first glance, this game... | [{"type": "stdin_stdout", "input": "3\n0 1 0 1 0 0 0 -1 0 1 0 -1 0\n1 0 0 0 0 0 1 0 0 0 0 0 2\n0 1 1 0 1 1 1 0 1 0 0 5 5\n3 1 1 1 0 1 0 0 1 0 3 -1 1\n1 1 2 7 5 10 20 50 100\n7H 6H 2H 5H 3H\n9S 9C 9H 8H 8D\nKS KH QH JD TS\n10\n1 1 1 1 1 1 1 1 1 0 1 1 1\n0 1 1 1 1 1 1 1 1 1 1 1 1\n1 1 1 1 2 1 1 1 1 1 1 1 0\n1 1 1 1 1 1 1... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nSummer is coming! It's time for Iahub and Iahubina to work out, as they both want to look hot at the beach. The gym where they go is a matrix a with n lines and m columns. Let number a[i][j] represents the calories burned... | [{"type": "stdin_stdout", "input": "4 5\n22972 40786 3691 85313 46694\n33077 16067 3134 97367 68508\n4250 35501 17327 14435 32518\n64673 65438 56977 123599 27280\n", "output": "753143\n"}, {"type": "stdin_stdout", "input": "4 5\n22972 40786 3691 85313 46694\n33077 16067 3134 97367 129038\n4250 35501 17327 14435 32518\n... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\n100 years have passed since the last victory of the man versus computer in Go. Technologies made a huge step forward and robots conquered the Earth! It's time for the final fight between human and robot that will decide t... | [{"type": "stdin_stdout", "input": "68 -9959\n-3666\n-3501\n9169\n5724\n1478\n-643\n-3039\n-5537\n-4295\n-1856\n-6720\n6827\n-39\n-9509\n-7005\n1942\n-5173\n-4564\n2390\n4604\n-6098\n-9847\n-9708\n2382\n7421\n8716\n9718\n9895\n-4553\n-8275\n4771\n1538\n-8131\n9912\n-4334\n-3702\n7035\n-106\n-1298\n-6190\n1321\n332\n767... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nExample\n\nInput\n\n3\nNNN\nNNN\nNNN\n\n\nOutput\n\nTaro\n\nThe input will be stdin and you should print your solution to stdout\n\n\nNow solve the problem and return the code.\n\nWrite Python code to solve this problem. ... | [{"type": "stdin_stdout", "input": "3\nNNN\nNNO\nNNN", "output": "Taro\n"}, {"type": "stdin_stdout", "input": "3\nNMN\nNNO\nNNN", "output": "Taro\n"}, {"type": "stdin_stdout", "input": "3\nNMN\nNNP\nNNN", "output": "Taro\n"}, {"type": "stdin_stdout", "input": "3\nMMN\nNNO\nNNN", "output": "Taro\n"}, {"type": "stdin_std... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nRng is baking cookies.\n\nInitially, he can bake one cookie per second.\n\nHe can also eat the cookies baked by himself. When there are x cookies not yet eaten, he can choose to eat all those cookies. After he finishes ea... | [{"type": "stdin_stdout", "input": "1000000000000 1000000100000", "output": "1000000000000\n"}, {"type": "stdin_stdout", "input": "1000010000000 1000100100001", "output": "1000010000000\n"}, {"type": "stdin_stdout", "input": "1000110000000 1000100100001", "output": "1000102100111\n"}, {"type": "stdin_stdout", "input": ... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nYou are given a positive integer $n$.\n\nLet $S(x)$ be sum of digits in base 10 representation of $x$, for example, $S(123) = 1 + 2 + 3 = 6$, $S(0) = 0$.\n\nYour task is to find two integers $a, b$, such that $0 \\leq a, ... | [{"type": "stdin_stdout", "input": "1000000000000\n", "output": "109\n"}, {"type": "stdin_stdout", "input": "1000000000000\n", "output": "109\n"}, {"type": "stdin_stdout", "input": "999999999992\n", "output": "200\n"}, {"type": "stdin_stdout", "input": "290687942106\n", "output": "153\n"}, {"type": "stdin_stdout", "inp... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nYou are given an array of positive integers a_1, a_2, ..., a_{n} × T of length n × T. We know that for any i > n it is true that a_{i} = a_{i} - n. Find the length of the longest non-decreasing sequence of the given array... | [{"type": "stdin_stdout", "input": "100 10000000\n300 300 300 300 300 300 300 300 300 300 300 300 300 300 300 300 300 300 300 300 300 300 300 300 300 300 300 300 300 300 300 300 300 300 300 300 300 300 300 300 300 300 300 300 300 300 300 300 300 300 300 300 300 300 300 300 300 300 300 300 300 300 300 300 300 300 300 30... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nDivisors of 42 are : 1, 2, 3, 6, 7, 14, 21, 42.\nThese divisors squared are: 1, 4, 9, 36, 49, 196, 441, 1764.\nThe sum of the squared divisors is 2500 which is 50 * 50, a square!\n\nGiven two integers m, n (1 <= m <= n) w... | [{"input": "5000\n10000", "output": "[[[6237, 45024100], [9799, 96079204], [9855, 113635600]]]", "fn_name": "list_squared"}, {"input": "600\n1500", "output": "[[[728, 722500], [1434, 2856100]]]", "fn_name": "list_squared"}, {"input": "1\n250", "output": "[[[1, 1], [42, 2500], [246, 84100]]]", "fn_name": "list_squared"}... | code_functional |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nYou are the judge at a competitive eating competition and you need to choose a winner!\n\nThere are three foods at the competition and each type of food is worth a different amount of points.\nPoints are as follows:\n\n- ... | [{"input": "[{\"name\": \"Billy The Beast\", \"chickenwings\": 17, \"hamburgers\": 7, \"hotdogs\": 8}, {\"name\": \"Habanero Hillary\", \"chickenwings\": 5, \"hamburgers\": 17, \"hotdogs\": 11}, {\"name\": \"Joey Jaws\", \"chickenwings\": 8, \"hamburgers\": 8, \"hotdogs\": 15}, {\"name\": \"Big Bob\", \"chickenwings\":... | code_functional |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nYou are given a program you want to execute as a set of tasks organized in a dependency graph. The dependency graph is a directed acyclic graph: each task can depend on results of one or several other tasks, and there are... | [{"type": "stdin_stdout", "input": "10 39\n0 1 0 1 0 1 1 0 1 1\n0 1\n0 2\n0 3\n0 4\n0 5\n0 6\n1 2\n1 3\n1 4\n1 5\n1 6\n1 7\n1 8\n1 9\n2 3\n2 4\n2 5\n2 6\n2 7\n2 8\n2 9\n3 4\n3 6\n3 7\n3 8\n3 9\n4 5\n4 6\n4 7\n4 9\n5 6\n5 7\n5 8\n5 9\n6 8\n6 9\n7 8\n7 9\n8 9\n", "output": "4\n"}, {"type": "stdin_stdout", "input": "10 39... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nGiven a positive integer n, find k integers (not necessary distinct) such that all these integers are strictly greater than 1, and their product is equal to n.\n\nInput\n\nThe first line contains two integers n and k (2 ≤... | [{"type": "stdin_stdout", "input": "100000 10\n", "output": "2 2 2 2 2 5 5 5 5 5\n"}, {"type": "stdin_stdout", "input": "2048 11\n", "output": "2 2 2 2 2 2 2 2 2 2 2\n"}, {"type": "stdin_stdout", "input": "1024 10\n", "output": "2 2 2 2 2 2 2 2 2 2\n"}, {"type": "stdin_stdout", "input": "100000 8\n", "output": "2 2 2 2... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nEmail address in Berland is a string of the form A@B, where A and B are arbitrary strings consisting of small Latin letters. \n\nBob is a system administrator in «Bersoft» company. He keeps a list of email addresses of th... | [{"type": "stdin_stdout", "input": "c@ir@xf@ap@fk@sp@wm@ec@qw@vg@by@iu@tr@wu@pv@lj@dd@tc@qj@ok@hm@bs@ul@ez@cg@ht@xf@ag@tr@hz@ap@tx@ly@dg@hu@nd@uv@il@ii@cn@nc@nb@cy@kp@dk@xa@da@ta@yr@yv@qg@db@je@wz@rn@yh@xi@mj@kc@uj@yu@cf@ps@ao@fo@le@d\n", "output": "c@i,r@x,f@a,p@f,k@s,p@w,m@e,c@q,w@v,g@b,y@i,u@t,r@w,u@p,v@l,j@d,d@t,c@... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nRead problems statements in Russian here \nThe Head Chef is studying the motivation and satisfaction level of his chefs . The motivation and satisfaction of a Chef can be represented as an integer . The Head Chef wants to... | [{"type": "stdin_stdout", "input": "1\n6 1\n0 12 11\n7 5 10\n7", "output": "19\n"}, {"type": "stdin_stdout", "input": "1\n6 1\n0 10 11\n7 5 10\n7", "output": "18\n"}, {"type": "stdin_stdout", "input": "1\n10 1\n1 5 -1\n6 -1 2\n1", "output": "-2\n"}, {"type": "stdin_stdout", "input": "1\n10 1\n1 5 -2\n6 -1 2\n1", "outpu... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nPete and his mate Phil are out in the countryside shooting clay pigeons with a shotgun - amazing fun. \n\nThey decide to have a competition. 3 rounds, 2 shots each. Winner is the one with the most hits.\n\nSome of the cla... | [{"input": "[[{\"P1\": \"XX\", \"P2\": \"XO\"}, false], [{\"P1\": \"OX\", \"P2\": \"XX\"}, false], [{\"P1\": \"OO\", \"P2\": \"XX\"}, true]]", "output": "[\"Phil Wins!\"]", "fn_name": "shoot"}, {"input": "[[{\"P1\": \"XX\", \"P2\": \"XO\"}, true], [{\"P1\": \"OX\", \"P2\": \"OO\"}, false], [{\"P1\": \"XX\", \"P2\": \"O... | code_functional |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nThe game of billiards involves two players knocking 3 balls around\non a green baize table. Well, there is more to it, but for our\npurposes this is sufficient.\nThe game consists of several rounds and in each round both ... | [{"type": "stdin_stdout", "input": "5\n140 82\n141 134\n90 110\n339 106\n88 90", "output": "1 278\n"}, {"type": "stdin_stdout", "input": "5\n140 82\n176 134\n90 110\n289 106\n88 90", "output": "1 263\n"}, {"type": "stdin_stdout", "input": "5\n140 147\n141 71\n172 110\n339 30\n40 90", "output": "1 434\n"}, {"type": "std... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nAka Beko, trying to escape from 40 bandits, got lost in the city of A. Aka Beko wants to go to City B, where the new hideout is, but the map has been stolen by a bandit.\n\nKobborg, one of the thieves, sympathized with Ak... | [{"type": "stdin_stdout", "input": "0100\n0101\n10100\n10000\n0101011\n1011\n011111\n#", "output": "Yes\nNo\nYes\nNo\nYes\nYes\nYes\n"}, {"type": "stdin_stdout", "input": "0100\n0100\n10100\n10000\n0101011\n1001\n011111\n#", "output": "Yes\nYes\nYes\nNo\nYes\nNo\nYes\n"}, {"type": "stdin_stdout", "input": "0100\n0100\n... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nA positive integer may be expressed as a sum of different prime numbers (primes), in one way or another. Given two positive integers n and k, you should count the number of ways to express n as a sum of k different primes... | [{"type": "stdin_stdout", "input": "24 3\n24 2\n2 1\n1 1\n4 2\n18 3\n17 1\n17 3\n17 4\n110 5\n1000 10\n1120 14\n0 0", "output": "2\n3\n1\n0\n0\n2\n1\n0\n1\n79\n200102899\n2079324314\n"}, {"type": "stdin_stdout", "input": "24 3\n24 2\n2 1\n1 1\n4 2\n33 3\n17 1\n17 3\n17 4\n100 5\n1000 10\n1120 14\n0 0", "output": "2\n3\... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nThere are n walruses standing in a queue in an airport. They are numbered starting from the queue's tail: the 1-st walrus stands at the end of the queue and the n-th walrus stands at the beginning of the queue. The i-th w... | [{"type": "stdin_stdout", "input": "15\n18 6 18 21 14 20 13 9 18 20 28 13 19 25 21\n", "output": "10 -1 8 8 6 6 0 -1 2 2 3 -1 -1 0 -1 "}, {"type": "stdin_stdout", "input": "15\n14 4 5 12 6 19 14 19 12 22 23 17 14 21 27\n", "output": "7 -1 -1 0 -1 6 1 4 -1 3 2 0 -1 -1 -1 "}, {"type": "stdin_stdout", "input": "15\n14 4 5... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nYour aged grandfather is tragically optimistic about Team GB's chances in the upcoming World Cup, and has enlisted you to help him make [Union Jack](https://en.wikipedia.org/wiki/Union_Jack) flags to decorate his house wi... | [{"input": "109.1", "output": "[\"X-----------------------------------------------------XX-----------------------------------------------------X\\n-X----------------------------------------------------XX----------------------------------------------------X-\\n--X---------------------------------------------------XX----... | code_functional |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nYou are given circle $A$ with radius $r_a$ and with central coordinate $(x_a, y_a)$ and circle $B$ with radius $r_b$ and with central coordinate $(x_b, y_b)$.\n\nWrite a program which prints:\n\n* \"2\" if $B$ is in $A$,\... | [{"type": "stdin_stdout", "input": "2\n1.3018830993798196 1.1804991696233216 6.678597997840617 2.1321559253491804 2.072303142011048 4.898405435743801\n1.6154186783950772 0.39921226227011497 2.512872370263131 5.273208013897418 2.169775861927481 3.924014997809771", "output": "2\n1\n"}, {"type": "stdin_stdout", "input": "... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nUser ainta has a stack of n red and blue balls. He can apply a certain operation which changes the colors of the balls inside the stack.\n\n While the top ball inside the stack is red, pop the ball from the top of the st... | [{"type": "stdin_stdout", "input": "50\nBRRRBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB\n", "output": "1125899906842609\n"}, {"type": "stdin_stdout", "input": "50\nBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB\n", "output": "1125899906842623\n"}, {"type": "stdin_stdout", "input": "50\nBBBBBBBBBBBBBBBBBBBBBBBBBB... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nA trick of fate caused Hatsumi and Taku to come to know each other. To keep the encounter in memory, they decided to calculate the difference between their ages. But the difference in ages varies depending on the day it i... | [{"type": "stdin_stdout", "input": "1505 13 9\n2619 11 3", "output": "1114\n"}, {"type": "stdin_stdout", "input": "2137 -1 28\n1419 -2 1", "output": "719\n"}, {"type": "stdin_stdout", "input": "2137 -1 28\n1818 -1 1", "output": "320\n"}, {"type": "stdin_stdout", "input": "2137 -1 28\n3039 -1 1", "output": "902\n"}, {"t... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nBetter things, cheaper. There is a fierce battle at the time sale held in some supermarkets today. \"LL-do\" here in Aizu is one such supermarket, and we are holding a slightly unusual time sale to compete with other chai... | [{"type": "stdin_stdout", "input": "6 5\n1 1 . 0 0 4\n1 . . . . .\n. . 2 2 . .\n. . 2 2 3 3\nP . - . . .\n5\n0 50 5 10\n1 20 0 10\n2 10 5 15\n3 150 3 10\n4 100 8 9\n0 0", "output": "330\n"}, {"type": "stdin_stdout", "input": "6 5\n1 0 . 0 0 4\n1 . . . . .\n. . 2 2 . .\n. . 2 2 3 3\nP . . . . .\n5\n0 50 8 10\n1 20 0 10\... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nCreate a function that takes an input String and returns a String, where all the uppercase words of the input String are in front and all the lowercase words at the end.\nThe order of the uppercase and lowercase words sho... | [{"input": "\"i First need Thing In coffee The Morning\"", "output": "[\"First Thing In The Morning i need coffee\"]", "fn_name": "capitals_first"}, {"input": "\"Life gets Sometimes pretty !Hard\"", "output": "[\"Life Sometimes gets pretty\"]", "fn_name": "capitals_first"}, {"input": "\"sense Does to That Make you?\"",... | code_functional |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nThere is a grid, consisting of n rows and m columns. Each cell of the grid is either free or blocked. One of the free cells contains a lab. All the cells beyond the borders of the grid are also blocked.\n\nA crazy robot h... | [{"type": "stdin_stdout", "input": "1\n3 31\n############################..#\n.............................L.\n############################..#\n", "output": "############################++#\n+++++++++++++++++++++++++++++L+\n############################++#\n"}, {"type": "stdin_stdout", "input": "1\n3 31\n###############... | code_stdio |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.