messages listlengths 1 1 | ground_truth stringlengths 88 726k | dataset stringclasses 2
values |
|---|---|---|
[
{
"content": "Solve the following coding problem using the programming language python:\n\nYou are given several queries. Each query consists of three integers p, q and b. You need to answer whether the result of p/q in notation with base b is a finite fraction.\n\nA fraction in notation with base b is finite i... | [{"type": "stdin_stdout", "input": "11\n1 1000000000000000000 10000000\n2 999 9\n2 999 333111\n0 15 14\n17 128 2\n13 311992186885373952 18\n1971402979058461 97576870171850009 100\n14 19 23\n3 21914624432020321 23\n0 21914624432020321 46\n3 21914624432020321 47\n", "output": "Finite\nInfinite\nFinite\nFinite\nFinite\nFi... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nVasya studies positional numeral systems. Unfortunately, he often forgets to write the base of notation in which the expression is written. Once he saw a note in his notebook saying a + b = ?, and that the base of the pos... | [{"type": "stdin_stdout", "input": "1000 1000\n", "output": "5\n"}, {"type": "stdin_stdout", "input": "1000 539\n", "output": "4\n"}, {"type": "stdin_stdout", "input": "999 1000\n", "output": "4\n"}, {"type": "stdin_stdout", "input": "1000 999\n", "output": "4\n"}, {"type": "stdin_stdout", "input": "998 1000\n", "outpu... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nWe have a grid with H rows and W columns of squares. We will represent the square at the i-th row from the top and j-th column from the left as (i,\\ j). Also, we will define the distance between the squares (i_1,\\ j_1) ... | [{"type": "stdin_stdout", "input": "6 7 12", "output": "RRRRRRR\nRRRRRRR\nRRRRRRR\nRRRRRRR\nRRRRRRR\nYRRRRRR\n"}, {"type": "stdin_stdout", "input": "7 6 1", "output": "RBRBRB\nBRBRBR\nRBRBRB\nBRBRBR\nRBRBRB\nBRBRBR\nRBRBRB\n"}, {"type": "stdin_stdout", "input": "6 6 12", "output": "RRRRRR\nRRRRRR\nRRRRRR\nRRRRRR\nRRRRR... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nTwo strings ```a``` and b are called isomorphic if there is a one to one mapping possible for every character of ```a``` to every character of ```b```. And all occurrences of every character in ```a``` map to same charact... | [{"input": "\"RAMBUNCTIOUSLY\"\n\"THERMODYNAMICS\"", "output": "[true]", "fn_name": "isomorph"}, {"input": "\"DISCRIMINATIVE\"\n\"SIMPLIFICATION\"", "output": "[true]", "fn_name": "isomorph"}, {"input": "\"abcdefghijk\"\n\"abcdefghijba\"", "output": "[false]", "fn_name": "isomorph"}, {"input": "\"ABCBACCBA\"\n\"ABCBACC... | code_functional |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nYour task it to return ```true``` if the fractional part (rounded to 1 digit) of the result (```a``` / ```b```) exists, more than ```0``` and is multiple of ```n```.\nOtherwise return ```false```. (For Python return True ... | [{"input": "3691401\n1892272\n5", "output": "[false]", "fn_name": "isMultiple"}, {"input": "666\n665\n2", "output": "[false]", "fn_name": "isMultiple"}, {"input": "5\n2\n3", "output": "[false]", "fn_name": "isMultiple"}, {"input": "5\n3\n4", "output": "[false]", "fn_name": "isMultiple"}, {"input": "5\n4\n3", "output": ... | code_functional |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nThere are n seats in the train's car and there is exactly one passenger occupying every seat. The seats are numbered from 1 to n from left to right. The trip is long, so each passenger will become hungry at some moment of... | [{"type": "stdin_stdout", "input": "100 1000000000\n12 803 439 918 435 300 497 520 718 573 782 523 328 88 275 159 128 389 920 869 503 80 490 289 22 889 353 799 29 131 587 123 405 221 727 135 248 348 299 833 19 943 471 410 635 626 784 712 213 724 550 661 860 536 718 173 406 832 520 748 512 29 466 982 574 848 11 693 915 ... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nMishka is trying really hard to avoid being kicked out of the university. In particular, he was doing absolutely nothing for the whole semester, miraculously passed some exams so that just one is left.\n\nThere were $n$ c... | [{"type": "stdin_stdout", "input": "200\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 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\n", "output": "0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nFox Ciel is participating in a party in Prime Kingdom. There are n foxes there (include Fox Ciel). The i-th fox is ai years old.\n\nThey will have dinner around some round tables. You want to distribute foxes such that:\n... | [{"type": "stdin_stdout", "input": "178\n5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 12 6 6 ... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nDuring their New Year holidays, Alice and Bob play the following game using an array $a$ of $n$ integers:\n\nPlayers take turns, Alice moves first.\n\nEach turn a player chooses any element and removes it from the array.\... | [{"type": "stdin_stdout", "input": "4\n4\n5 0 6 3\n3\n1 2 1\n4\n2 4 2 2\n2\n14 2\n", "output": "Alice\nAlice\nAlice\nAlice\n"}, {"type": "stdin_stdout", "input": "4\n4\n5 0 6 3\n3\n1 2 1\n4\n2 4 2 2\n2\n14 3\n", "output": "Alice\nAlice\nAlice\nAlice\n"}, {"type": "stdin_stdout", "input": "4\n4\n5 2 10 3\n3\n6 2 0\n4\n2... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nRingo Kingdom Congress is voting on a bill.\n\nN members are present, and the i-th member (1 ≤ i ≤ N) has w_i white ballots and b_i blue ballots. Each member i will put all the w_i white ballots into the box if he/she is ... | [{"type": "stdin_stdout", "input": "1 60\n11 10\n5 8\n3 4\n13 -1\n4 7", "output": "1\n"}, {"type": "stdin_stdout", "input": "1 60\n11 10\n5 8\n4 4\n13 -1\n4 7", "output": "1\n"}, {"type": "stdin_stdout", "input": "1 60\n11 10\n5 8\n4 4\n13 -1\n7 7", "output": "1\n"}, {"type": "stdin_stdout", "input": "1 60\n11 10\n5 8\... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nA factory produces thimbles in bulk. Typically, it can produce up to a thimbles a day. However, some of the machinery is defective, so it can currently only produce b thimbles each day. The factory intends to choose a k-d... | [{"type": "stdin_stdout", "input": "5 2 2 1 8\n1 1 2\n1 5 3\n1 2 1\n2 2\n1 4 0\n1 3 2\n2 1\n2 3\n", "output": "3\n4\n4\n"}, {"type": "stdin_stdout", "input": "5 2 2 1 8\n1 1 1\n1 5 3\n1 2 1\n2 2\n1 4 2\n1 3 2\n2 1\n2 3\n", "output": "3\n6\n4\n"}, {"type": "stdin_stdout", "input": "5 2 2 1 8\n1 1 2\n1 5 3\n1 2 1\n2 2\n1... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nThree friends are going to meet each other. Initially, the first friend stays at the position $x = a$, the second friend stays at the position $x = b$ and the third friend stays at the position $x = c$ on the coordinate a... | [{"type": "stdin_stdout", "input": "8\n4 6 16\n7 6 35\n12 5 1\n2 15 3\n1 1000000000 0000000000\n1 1000000000 459694946\n2 0 9\n4 2 6\n", "output": "20\n54\n18\n22\n1999999996\n1999999994\n14\n4\n"}, {"type": "stdin_stdout", "input": "8\n4 6 16\n7 6 35\n12 5 1\n2 15 3\n1 1000000000 0000000000\n1 1000000000 459694946\n1 ... | 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\nThe BerTV channel every day broadcasts one episode of one of the $k$ TV shows. You know the schedule for the next $n$ days: a sequence of integers $a_1... | [{"type": "stdin_stdout", "input": "4\n5 2 2\n1 2 1 2 2\n9 3 3\n3 3 3 2 2 4 1 1 1\n4 18 4\n10 8 6 4\n16 10 8\n3 1 7 1 5 4 2 6 7 6 5 8 9 8 11 3\n", "output": "1\n1\n4\n6\n"}, {"type": "stdin_stdout", "input": "4\n5 2 4\n1 2 1 2 1\n9 3 3\n3 3 3 2 2 4 1 1 1\n4 18 4\n10 8 6 4\n16 10 8\n3 1 4 2 5 4 2 6 5 6 5 10 9 8 9 3\n", ... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\n# Scenario \n\n*Now that the competition gets tough it will* **_Sort out the men from the boys_** . \n\n**_Men_** are the **_Even numbers_** and **_Boys_** are the **_odd_**  ![!a... | [{"input": "[-17, -45, -15, -33, -85, -56, -86, -30]", "output": "[[-86, -56, -30, -15, -17, -33, -45, -85]]", "fn_name": "men_from_boys"}, {"input": "[49, 818, -282, 900, 928, 281, -282, -1]", "output": "[[-282, 818, 900, 928, 281, 49, -1]]", "fn_name": "men_from_boys"}, {"input": "[-53, -26, -53, -27, -49, -51, -14]"... | code_functional |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nVasya used to be an accountant before the war began and he is one of the few who knows how to operate a computer, so he was assigned as the programmer.\n\nWe all know that programs often store sets of integers. For exampl... | [{"type": "stdin_stdout", "input": "56\npair pair pair int int pair pair pair pair pair int pair int int pair pair int pair pair pair int pair int int pair int pair int pair pair pair pair int pair pair int int pair int int pair int int int int int pair pair pair pair pair pair pair pair pair int pair pair int pair pai... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nAmicable numbers are two different numbers so related that the sum of the proper divisors of each is equal to the other number. (A proper divisor of a number is a positive factor of that number other than the number itsel... | [{"input": "220221\n282224", "output": "[false]", "fn_name": "amicable_numbers"}, {"input": "122265\n139815", "output": "[true]", "fn_name": "amicable_numbers"}, {"input": "299920\n9284", "output": "[false]", "fn_name": "amicable_numbers"}, {"input": "999220\n2849", "output": "[false]", "fn_name": "amicable_numbers"}, ... | code_functional |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nOne day Vasya decided to have a look at the results of Berland 1910 Football Championship’s finals. Unfortunately he didn't find the overall score of the match; however, he got hold of a profound description of the match'... | [{"type": "stdin_stdout", "input": "89\nH\nVOCI\nVOCI\nH\nVOCI\nH\nH\nVOCI\nVOCI\nVOCI\nH\nH\nH\nVOCI\nVOCI\nVOCI\nH\nVOCI\nVOCI\nH\nVOCI\nVOCI\nVOCI\nH\nVOCI\nH\nVOCI\nH\nVOCI\nH\nVOCI\nVOCI\nH\nVOCI\nVOCI\nVOCI\nVOCI\nVOCI\nVOCI\nH\nVOCI\nVOCI\nVOCI\nVOCI\nH\nVOCI\nH\nH\nVOCI\nH\nVOCI\nH\nVOCI\nVOCI\nVOCI\nVOCI\nVOCI... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nMonocarp wrote down two numbers on a whiteboard. Both numbers follow a specific format: a positive integer $x$ with $p$ zeros appended to its end.\n\nNow Monocarp asks you to compare these two numbers. Can you help him?\n... | [{"type": "stdin_stdout", "input": "23\n1 3\n100 1\n2 3\n200 1\n3 3\n300 1\n4 3\n400 1\n5 3\n500 1\n6 3\n600 1\n1 7\n1000000 4\n10 9\n1000000 4\n100 14\n1000010 4\n1000 7\n1000000 4\n10000 6\n1000000 4\n100000 5\n1000000 4\n1000000 4\n1000000 4\n1000000 4\n100000 5\n1000000 4\n10000 6\n1000000 4\n1000 7\n1000000 4\n100... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nTwilight Sparkle once got a crystal from the Crystal Mine. A crystal of size n (n is odd; n > 1) is an n × n matrix with a diamond inscribed into it.\n\nYou are given an odd integer n. You need to draw a crystal of size n... | [{"type": "stdin_stdout", "input": "101\n", "output": "**************************************************D**************************************************\n*************************************************DDD*************************************************\n************************************************DDDDD******... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nTake an input string and return a string that is made up of the number of occurences of each english letter in the input followed by that letter, sorted alphabetically. The output string shouldn't contain chars missing fr... | [{"input": "\"The quick brown fox jumps over the lazy dog.\"", "output": "[\"1a1b1c1d3e1f1g2h1i1j1k1l1m1n4o1p1q2r1s2t2u1v1w1x1y1z\"]", "fn_name": "string_letter_count"}, {"input": "\"abccdefgdhijklmno_pqrsTuvwxYz\"", "output": "[\"1a1b2c2d1e1f1g1h1i1j1k1l1m1n1o1p1q1r1s1t1u1v1w1x1y1z\"]", "fn_name": "string_letter_count... | code_functional |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nMobile Display Keystrokes\n\nDo you remember the old mobile display keyboards? Do you also remember how inconvenient it was to write on it?\nWell, here you have to calculate how much keystrokes you have to do for a specif... | [{"input": "\"longwordwhichdontreallymakessense\"", "output": "[107]", "fn_name": "mobile_keyboard"}, {"input": "\"thisisasms\"", "output": "[37]", "fn_name": "mobile_keyboard"}, {"input": "\"codewars\"", "output": "[26]", "fn_name": "mobile_keyboard"}, {"input": "\"zruf\"", "output": "[16]", "fn_name": "mobile_keyboar... | code_functional |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nA prime number n (11, 19, 23, etc.) that divides by 4 and has 3 has an interesting property. The results of calculating the remainder of the square of a natural number (1, 2, ..., n -1) of 1 or more and less than n divide... | [{"type": "stdin_stdout", "input": "11\n173\n0", "output": "4\n4\n4\n4\n4\n84\n86\n86\n84\n86\n84\n86\n86\n84\n84\n86\n86\n84\n84\n84\n84\n86\n86\n86\n86\n84\n84\n84\n84\n84\n86\n86\n86\n84\n86\n84\n86\n84\n84\n84\n84\n84\n84\n86\n84\n84\n86\n84\n86\n86\n86\n84\n86\n84\n86\n84\n84\n86\n84\n84\n84\n84\n86\n86\n84\n86\n8... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nAt a geometry lesson Bob learnt that a triangle is called right-angled if it is nondegenerate and one of its angles is right. Bob decided to draw such a triangle immediately: on a sheet of paper he drew three points with ... | [{"type": "stdin_stdout", "input": "-100 -100 100 100 -100 100\n", "output": "RIGHT\n"}, {"type": "stdin_stdout", "input": "-100 -100 100 -100 0 73\n", "output": "NEITHER\n"}, {"type": "stdin_stdout", "input": "-45 -87 -34 -79 -60 -62\n", "output": "NEITHER\n"}, {"type": "stdin_stdout", "input": "-45 -87 -44 -79 -60 -6... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nThis kata is about multiplying a given number by eight if it is an even number and by nine otherwise.\n\nWrite your solution by modifying this code:\n\n```python\ndef simple_multiplication(number) :\n\t\n```\n\nYour solut... | [{"input": "2", "output": "[16]", "fn_name": "simple_multiplication"}, {"input": "8", "output": "[64]", "fn_name": "simple_multiplication"}, {"input": "4", "output": "[32]", "fn_name": "simple_multiplication"}, {"input": "5", "output": "[45]", "fn_name": "simple_multiplication"}, {"input": "1", "output": "[9]", "fn_nam... | code_functional |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nTanya has $n$ candies numbered from $1$ to $n$. The $i$-th candy has the weight $a_i$.\n\nShe plans to eat exactly $n-1$ candies and give the remaining candy to her dad. Tanya eats candies in order of increasing their num... | [{"type": "stdin_stdout", "input": "105\n5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 4 5 5 5 6\n", "output": "100\n"}, {"type": "stdin_stdout", "input": "105\n5 5 5... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nDescription overhauled by V\n\n---\n\nI've invited some kids for my son's birthday, during which I will give to each kid some amount of candies.\n\nEvery kid hates receiving less amount of candies than any other kids, and... | [{"input": "101", "output": "[7041757898200960193617914702466542659236800]", "fn_name": "candies_to_buy"}, {"input": "100", "output": "[69720375229712477164533808935312303556800]", "fn_name": "candies_to_buy"}, {"input": "61", "output": "[591133442051411133755680800]", "fn_name": "candies_to_buy"}, {"input": "60", "out... | code_functional |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nIlya lives in a beautiful city of Chordalsk.\n\nThere are $n$ houses on the street Ilya lives, they are numerated from $1$ to $n$ from left to right; the distance between every two neighboring houses is equal to $1$ unit.... | [{"type": "stdin_stdout", "input": "41\n1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 1\n", "output": "39\n"}, {"type": "stdin_stdout", "input": "41\n1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 1\n", "outpu... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nAn bydrocarbon is an organic compound which contains only carbons and hydrogens. An isomer is a compound that has the same number of carbons but different structures. Heptane, for example, is a hydrocarbon with 7 carbons.... | [{"type": "stdin_stdout", "input": "1\n30", "output": "1\n14348906\n"}, {"type": "stdin_stdout", "input": "1\n30", "output": "1\n14348906\n"}, {"type": "stdin_stdout", "input": "1\n25", "output": "1\n1062881\n"}, {"type": "stdin_stdout", "input": "1\n29", "output": "1\n9565937\n"}, {"type": "stdin_stdout", "input": "1\... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nSection numbers are strings of dot-separated integers. The highest level sections (chapters) are numbered 1, 2, 3, etc. Second level sections are numbered 1.1, 1.2, 1.3, 2.1, 2.2, 2.3, etc. Next level sections are numbere... | [{"input": "\"1.2.3.4\"\n\"1.2.3.4\"", "output": "[0]", "fn_name": "compare"}, {"input": "\"1.2.3\"\n\"1.02.003\"", "output": "[0]", "fn_name": "compare"}, {"input": "\"3.0.0\"\n\"3.1.1\"", "output": "[-1]", "fn_name": "compare"}, {"input": "\"1.2.1\"\n\"1.2.0\"", "output": "[1]", "fn_name": "compare"}, {"input": "\"3.... | code_functional |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nYou are given an array $a$ consisting of $n$ integers.\n\nYou can remove at most one element from this array. Thus, the final length of the array is $n-1$ or $n$.\n\nYour task is to calculate the maximum possible length o... | [{"type": "stdin_stdout", "input": "12\n123654 1 2 3 4 5 6 7 16 9 10 11\n", "output": "10\n"}, {"type": "stdin_stdout", "input": "12\n123654 1 2 3 4 5 6 7 8 9 10 11\n", "output": "11\n"}, {"type": "stdin_stdout", "input": "12\n123654 1 2 6 4 5 6 7 16 9 10 11\n", "output": "7\n"}, {"type": "stdin_stdout", "input": "12\n... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nFor a non-negative integer K, we define a fractal of level K as follows:\n\n* A fractal of level 0 is a grid with just one white square.\n* When K > 0, a fractal of level K is a 3^K \\times 3^K grid. If we divide this gri... | [{"type": "stdin_stdout", "input": "2\n3 2 7 8\n12 3 1 15", "output": "10\n23\n"}, {"type": "stdin_stdout", "input": "2\n0 2 7 8\n12 3 1 15", "output": "13\n23\n"}, {"type": "stdin_stdout", "input": "2\n0 2 10 8\n6 3 1 15", "output": "16\n17\n"}, {"type": "stdin_stdout", "input": "2\n15 2 4 4\n7 6 1 26", "output": "13\... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nWe saw the little game Marmot made for Mole's lunch. Now it's Marmot's dinner time and, as we all know, Marmot eats flowers. At every dinner he eats some red and white flowers. Therefore a dinner can be represented as a s... | [{"type": "stdin_stdout", "input": "3 1\n1 3\n2 3\n4 10\n", "output": "14\n12\n2032\n"}, {"type": "stdin_stdout", "input": "3 1\n1 3\n2 3\n4 6\n", "output": "14\n12\n112\n"}, {"type": "stdin_stdout", "input": "3 1\n2 6\n1 3\n4 4\n", "output": "124\n14\n16\n"}, {"type": "stdin_stdout", "input": "3 1\n1 3\n2 5\n1 6\n", "... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nVasya and Petya wrote down all integers from 1 to n to play the \"powers\" game (n can be quite large; however, Vasya and Petya are not confused by this fact).\n\nPlayers choose numbers in turn (Vasya chooses first). If s... | [{"type": "stdin_stdout", "input": "1000000000\n", "output": "Vasya\n"}, {"type": "stdin_stdout", "input": "1000000000\n", "output": "Vasya\n"}, {"type": "stdin_stdout", "input": "1000000001\n", "output": "Vasya\n"}, {"type": "stdin_stdout", "input": "0000000001\n", "output": "Vasya\n"}, {"type": "stdin_stdout", "input... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\n## Task:\nYou have to create a function `isPronic` to check whether the argument passed is a Pronic Number and return true if it is & false otherwise.\n\n### Description:\n\n`Pronic Number` -A pronic number, oblong number... | [{"input": "-27", "output": "[false]", "fn_name": "is_pronic"}, {"input": "-3", "output": "[false]", "fn_name": "is_pronic"}, {"input": "3", "output": "[false]", "fn_name": "is_pronic"}, {"input": "4", "output": "[false]", "fn_name": "is_pronic"}, {"input": "5", "output": "[false]", "fn_name": "is_pronic"}, {"input": "... | code_functional |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nWhat are you doing at the end of the world? Are you busy? Will you save us?\n\n<image>\n\nNephren is playing a game with little leprechauns.\n\nShe gives them an infinite array of strings, f0... ∞.\n\nf0 is \"What are you... | [{"type": "stdin_stdout", "input": "10\n100000 873326525630182716\n100000 620513733919162415\n100000 482953375281256917\n100000 485328193417229962\n100000 353549227094721271\n100000 367447590857326107\n100000 627193846053528323\n100000 243833127760837417\n100000 287297493528203749\n100000 70867563577617188\n", "output"... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nA palindrome is a word, phrase, number, or other sequence of characters which reads the same backward as forward. Examples of numerical palindromes are:\n\n2332 \n110011 \n54322345\n\nYou'll be given 2 numbers as argument... | [{"input": "\"ACCDDCCA\"\n3", "output": "[\"Not valid\"]", "fn_name": "palindrome"}, {"input": "773\n\"1551\"", "output": "[\"Not valid\"]", "fn_name": "palindrome"}, {"input": "6\n4", "output": "[[11, 22, 33, 44]]", "fn_name": "palindrome"}, {"input": "-4505\n15", "output": "[\"Not valid\"]", "fn_name": "palindrome"},... | code_functional |
[
{
"content": "Solve the following coding problem using the programming language python:\n\n< PREVIOUS KATA\nNEXT KATA >\n \n###Task:\n\nYou have to write a function `pattern` which returns the following Pattern(See Examples) upto (3n-2) rows, where n is parameter.\n\n* Note:`Returning` the pattern is not the sa... | [{"input": "5", "output": "[\" 11111 \\n 22222 \\n 33333 \\n 44444 \\n1234555554321\\n1234555554321\\n1234555554321\\n1234555554321\\n1234555554321\\n 44444 \\n 33333 \\n 22222 \\n 11111 \"]", "fn_name": "pattern"}, {"input": "3", "output": "[\" 111 \\n 222 \\n1233321... | code_functional |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nThe cows have just learned what a primitive root is! Given a prime p, a primitive root $\\operatorname{mod} p$ is an integer x (1 ≤ x < p) such that none of integers x - 1, x^2 - 1, ..., x^{p} - 2 - 1 are divisible by p, ... | [{"type": "stdin_stdout", "input": "1583\n", "output": "672\n"}, {"type": "stdin_stdout", "input": "1987\n", "output": "660\n"}, {"type": "stdin_stdout", "input": "1993\n", "output": "656\n"}, {"type": "stdin_stdout", "input": "1997\n", "output": "996\n"}, {"type": "stdin_stdout", "input": "1999\n", "output": "648\n"},... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nProblem Statement\n\nIn the headquarter building of ICPC (International Company of Plugs & Connectors), there are $M$ light bulbs and they are controlled by $N$ switches. Each light bulb can be turned on or off by exactly... | [{"type": "stdin_stdout", "input": "3 10 3\n000 0000000000\n110 0000001011\n101 1111111100\n2 6 0\n1 2 0\n2 1 1\n01 1\n11 11 10\n10000000000 10000000000\n11000000000 00000000000\n01100000000 00100000000\n00110000000 00010000000\n00011000000 00001000000\n00001100000 00000100000\n01000110000 00000010000\n00000011000 0000... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nThere is data that records the altitude of mountains that have been climbed so far. Create a program that reads this data and outputs the elevation difference between the highest and lowest mountains.\n\n\n\nInput\n\nThe ... | [{"type": "stdin_stdout", "input": "3783.6109384455353\n1821.5992049377405\n649.3237125101873\n2008.8147615323267\n1214.1371939030753", "output": "3134.28722594\n"}, {"type": "stdin_stdout", "input": "3784.5476877206565\n1821.5992049377405\n649.3237125101873\n2008.8147615323267\n1214.1371939030753", "output": "3135.223... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nThere are n workers in a company, each of them has a unique id from 1 to n. Exaclty one of them is a chief, his id is s. Each worker except the chief has exactly one immediate superior.\n\nThere was a request to each of t... | [{"type": "stdin_stdout", "input": "10 6\n3 0 0 0 0 0 0 1 0 0\n", "output": "7\n"}, {"type": "stdin_stdout", "input": "10 6\n3 1 0 0 0 0 0 1 0 0\n", "output": "6\n"}, {"type": "stdin_stdout", "input": "10 6\n3 0 1 0 0 0 0 1 0 1\n", "output": "5\n"}, {"type": "stdin_stdout", "input": "10 6\n3 0 0 0 0 0 0 1 0 1\n", "outp... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nIn Wolf town there are 2 big markets S and T. The distance between these markets is D. Chef Ciel would like to run 2 restaurants in Wolf town, where the first restaurant will be supplied by the market S and the second one... | [{"type": "stdin_stdout", "input": "4\n15 15 50\n15 15 18\n43 88 200\n2013 2013 2013", "output": "20.000\n0.0\n69.00000\n0"}, {"type": "stdin_stdout", "input": "4\n15 15 50\n15 15 18\n43 88 200\n2013 2013 2013", "output": "20.0\n0\n69.0\n0\n"}, {"type": "stdin_stdout", "input": "4\n2 25 50\n15 12 28\n11 88 200\n2715 17... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nThis is an interactive problem.\n\nYou are given a sorted in increasing order singly linked list. You should find the minimum integer in the list which is greater than or equal to x.\n\nMore formally, there is a singly li... | [{"type": "stdin_stdout", "input": "10 3 632584719\n378382911 9\n978367651 -1\n176599346 7\n557138623 8\n441019502 4\n823417558 2\n244832688 10\n702148024 6\n385598339 5\n357778234 1\n", "output": "? 3\n? 9\n! 978367651\n"}, {"type": "stdin_stdout", "input": "10 3 632584719\n378382911 9\n978367651 -1\n176599346 7\n5571... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nWe have a string S consisting of lowercase English letters.\nIf the length of S is at most K, print S without change.\nIf the length of S exceeds K, extract the first K characters in S, append ... to the end of them, and ... | [{"type": "stdin_stdout", "input": "99\nlbyhybgfptdyuqnlszvxoggbjhrjopbevyrzytfhiabtoozntnxxcvmhckjlwxnzniwzzxzvmfiztyirssfeauzncyosgrmsgull\n", "output": "lbyhybgfptdyuqnlszvxoggbjhrjopbevyrzytfhiabtoozntnxxcvmhckjlwxnzniwzzxzvmfiztyirssfeauzncyosgrmsgul...\n"}, {"type": "stdin_stdout", "input": "100\nvefcekrnrodmjprt... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\n## Task\nTo charge your mobile phone battery, do you know how much time it takes from 0% to 100%? It depends on your cell phone battery capacity and the power of the charger. A rough calculation method is:\n\n```\n0% --> ... | [{"input": "1000\n5000", "output": "[0.26]", "fn_name": "calculate_time"}, {"input": "3050\n2600", "output": "[1.53]", "fn_name": "calculate_time"}, {"input": "2000\n1000", "output": "[2.6]", "fn_name": "calculate_time"}, {"input": "5000\n1000", "output": "[6.5]", "fn_name": "calculate_time"}, {"input": "1000\n500", "o... | code_functional |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nKavi has 2n points lying on the OX axis, i-th of which is located at x = i.\n\nKavi considers all ways to split these 2n points into n pairs. Among those, he is interested in good pairings, which are defined as follows:\n... | [{"type": "stdin_stdout", "input": "1000000\n", "output": "126330412"}, {"type": "stdin_stdout", "input": "372544\n", "output": "214345447\n"}, {"type": "stdin_stdout", "input": "315936\n", "output": "256195953\n"}, {"type": "stdin_stdout", "input": "446167\n", "output": "461428149\n"}, {"type": "stdin_stdout", "input"... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nYou are given an array of integers. Vasya can permute (change order) its integers. He wants to do it so that as many as possible integers will become on a place where a smaller integer used to stand. Help Vasya find the m... | [{"type": "stdin_stdout", "input": "6\n300000000 200000000 300000000 200000000 1000000000 300000000\n", "output": "3\n"}, {"type": "stdin_stdout", "input": "6\n300000000 200000000 300000000 200000000 1000000000 300000000\n", "output": "3\n"}, {"type": "stdin_stdout", "input": "6\n506233607 200000000 300000000 200000000... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nHave you ever tasted Martian food? Well, you should.\n\nTheir signature dish is served on a completely black plate with the radius of R, flat as a pancake.\n\nFirst, they put a perfectly circular portion of the Golden Hon... | [{"type": "stdin_stdout", "input": "2\n4 3 1\n5 2 2\n", "output": "0.9230769231\n0.6521739130\n"}, {"type": "stdin_stdout", "input": "2\n8 3 1\n4 2 2\n", "output": "2.4489795918\n0.6666666667\n"}, {"type": "stdin_stdout", "input": "2\n9 3 1\n4 2 2\n", "output": "2.5714285714\n0.6666666667\n"}, {"type": "stdin_stdout", ... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nYou are a given an array $a$ of length $n$. Find a subarray $a[l..r]$ with length at least $k$ with the largest median.\n\nA median in an array of length $n$ is an element which occupies position number $\\lfloor \\frac{n... | [{"type": "stdin_stdout", "input": "100 16\n14 94 97 89 73 165 11 78 10 30 54 57 88 57 44 6 33 40 17 26 69 100 92 67 22 59 80 67 17 29 76 69 133 7 86 45 1 98 99 25 65 102 94 91 7 24 53 40 53 91 59 32 67 24 25 157 55 46 68 53 2 15 92 5 53 37 76 40 49 94 4 8 76 12 50 2 54 86 49 95 81 5 34 28 21 47 97 73 96 56 32 78 71 38... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nSnuke lives at position x on a number line.\nOn this line, there are two stores A and B, respectively at position a and b, that offer food for delivery.\nSnuke decided to get food delivery from the closer of stores A and ... | [{"type": "stdin_stdout", "input": "1 999 1000\n", "output": "A\n"}, {"type": "stdin_stdout", "input": "1 1455 0000", "output": "B\n"}, {"type": "stdin_stdout", "input": "1 1200 0101", "output": "B\n"}, {"type": "stdin_stdout", "input": "1 999 0000", "output": "B\n"}, {"type": "stdin_stdout", "input": "1 381 1110", "ou... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\n### What is simplifying a square root?\n\nIf you have a number, like 80, for example, you would start by finding the greatest perfect square divisible by 80. In this case, that's 16. Find the square root of 16, and multip... | [{"input": "200", "output": "[\"10 sqrt 2\"]", "fn_name": "simplify"}, {"input": "18", "output": "[\"3 sqrt 2\"]", "fn_name": "simplify"}, {"input": "20", "output": "[\"2 sqrt 5\"]", "fn_name": "simplify"}, {"input": "24", "output": "[\"2 sqrt 6\"]", "fn_name": "simplify"}, {"input": "32", "output": "[\"4 sqrt 2\"]", "... | code_functional |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nSimple transposition is a basic and simple cryptography technique. We make 2 rows and put first a letter in the Row 1, the second in the Row 2, third in Row 1 and so on until the end. Then we put the text from Row 2 next ... | [{"input": "\"Imagination is more important than knowledge\"", "output": "[\"Iaiaini oeipratta nwegmgnto smr motn hnkolde\"]", "fn_name": "simple_transposition"}, {"input": "\"The better part of valor is discretion\"", "output": "[\"Tebte ato ao sdsrtoh etrpr fvlri icein\"]", "fn_name": "simple_transposition"}, {"input... | code_functional |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nExample\n\nInput\n\n2 2 2 1\n0 0 0\n\n\nOutput\n\n24\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. Your... | [{"type": "stdin_stdout", "input": "26 2 22 0\n-1 2 0", "output": "1336\n"}, {"type": "stdin_stdout", "input": "36 2 22 0\n-1 2 0", "output": "1816\n"}, {"type": "stdin_stdout", "input": "36 2 43 0\n-1 2 0", "output": "3412\n"}, {"type": "stdin_stdout", "input": "3 8 88 0\n-2 8 -1", "output": "1984\n"}, {"type": "stdin... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nRecently Vova found $n$ candy wrappers. He remembers that he bought $x$ candies during the first day, $2x$ candies during the second day, $4x$ candies during the third day, $\\dots$, $2^{k-1} x$ candies during the $k$-th ... | [{"type": "stdin_stdout", "input": "53\n3\n3\n3\n3\n3\n3\n3\n3\n3\n3\n3\n3\n3\n3\n3\n3\n3\n3\n3\n3\n3\n3\n3\n3\n3\n3\n3\n3\n3\n3\n3\n3\n3\n3\n3\n3\n3\n3\n3\n3\n3\n3\n3\n3\n3\n3\n3\n3\n3\n3\n3\n3\n3\n", "output": "1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nYou are given a string of length N. Calculate the number of distinct substrings of S.\n\nConstraints\n\n* 1 \\leq N \\leq 500,000\n* S consists of lowercase English letters.\n\nInput\n\nInput is given from Standard Input ... | [{"type": "stdin_stdout", "input": "mjssissippi", "output": "57\n"}, {"type": "stdin_stdout", "input": "mjssisrippi", "output": "61\n"}, {"type": "stdin_stdout", "input": "mjssisripph", "output": "62\n"}, {"type": "stdin_stdout", "input": "hppirsitsjm", "output": "63\n"}, {"type": "stdin_stdout", "input": "mjsthspiroh"... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nSnuke has decided to use a robot to clean his room.\n\nThere are N pieces of trash on a number line. The i-th piece from the left is at position x_i. We would like to put all of them in a trash bin at position 0.\n\nFor t... | [{"type": "stdin_stdout", "input": "16 10\n1 12 12 27 52 132 731 18298 395504 534840 1276551 903860 9384806 19108104 82684732 535447408", "output": "3248775590\n"}, {"type": "stdin_stdout", "input": "16 10\n0 12 12 27 52 132 731 18298 395504 534840 1276551 903860 9384806 19108104 82684732 535447408", "output": "3248775... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nThe winner of the card game popular in Berland \"Berlogging\" is determined according to the following rules. If at the end of the game there is only one player with the maximum number of points, he is the winner. The sit... | [{"type": "stdin_stdout", "input": "12\natrtthfpcvishmqbakprquvnejr 185\natrtthfpcvishmqbakprquvnejr -699\natrtthfpcvishmqbakprquvnejr -911\natrtthfpcvishmqbakprquvnejr -220\nfcgslzkicjrpbqaifgweyzreajjfdo 132\nfcgslzkicjrpbqaifgweyzreajjfdo -242\nm 177\nm -549\natrtthfpcvishmqbakprquvnejr -242\nm 38\natrtthfpcvishmqba... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nProblem statement\n\n2D, who is good at cooking, is trying to make lunch. Cooking requires all N ingredients a_ {0}, a_ {1},…, a_ {N−1}.\n\nNow, 2D's refrigerator doesn't contain any ingredients, so I have to go to the su... | [{"type": "stdin_stdout", "input": "2\npaks 0\naxii -1\n-1\nnkua hx`j", "output": "-1\n"}, {"type": "stdin_stdout", "input": "2\ntako -1\njiay -1\n0\npuja yakh", "output": "-2\n"}, {"type": "stdin_stdout", "input": "2\npaks -2\nayhi -1\n0\nmauk j`xh", "output": "-3\n"}, {"type": "stdin_stdout", "input": "2\npaks 1\naxi... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nYour friend gave you a dequeue D as a birthday present.\nD is a horizontal cylinder that contains a row of N jewels.\nThe values of the jewels are V_1, V_2, ..., V_N from left to right. There may be jewels with negative v... | [{"type": "stdin_stdout", "input": "50 100\n-10000000 -10000000 -10000000 -10000000 -10000000 -10000000 -10000000 -10000000 -10000000 -10000000 -10000000 -10000000 -10000000 -10000000 -10000000 -10000000 -10000000 -10000000 -10000000 -10000000 -10000000 -10000000 -10000000 -10000000 -10000000 -10000000 -10000000 -10000... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nA permutation p of size n is an array such that every integer from 1 to n occurs exactly once in this array.\n\nLet's call a permutation an almost identity permutation iff there exist at least n - k indices i (1 ≤ i ≤ n) ... | [{"type": "stdin_stdout", "input": "1000 4\n", "output": "373086956251\n"}, {"type": "stdin_stdout", "input": "1000 4\n", "output": "373086956251\n"}, {"type": "stdin_stdout", "input": "800 4\n", "output": "152620985001\n"}, {"type": "stdin_stdout", "input": "800 4\n", "output": "152620985001\n"}, {"type": "stdin_stdou... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nproblem\n\nYou are a traveler traveling on the JOI Highway. The JOI Highway is a road that extends straight from east to west, and there are n post towns on the JOI Highway. Numbered. The westernmost post town on the JOI ... | [{"type": "stdin_stdout", "input": "7 5\n2\n0\n1\n1\n2\n-1\n2\n-1\n2\n2\n-3", "output": "10\n"}, {"type": "stdin_stdout", "input": "7 0\n1\n-1\n1\n3\n1\n-1\n3\n-2\n-1\n1\n0", "output": "0\n"}, {"type": "stdin_stdout", "input": "7 0\n1\n-1\n1\n2\n1\n-1\n3\n-2\n-1\n1\n0", "output": "0\n"}, {"type": "stdin_stdout", "input... | 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": "100000 77777\n", "output": "177777\n"}, {"type": "stdin_stdout", "input": "150234 77777\n", "output": "177777\n"}, {"type": "stdin_stdout", "input": "77777 77777\n", "output": "177777\n"}, {"type": "stdin_stdout", "input": "47774 47774\n", "output": "147774\n"}, {"type": "stdin_stdou... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nKilani is playing a game with his friends. This game can be represented as a grid of size $n \\times m$, where each cell is either empty or blocked, and every player has one or more castles in some cells (there are no two... | [{"type": "stdin_stdout", "input": "4 7 2\n13 1\n....###\n.#..1..\n.#.###.\n2#.....\n", "output": "18 1 \n"}, {"type": "stdin_stdout", "input": "4 7 2\n13 1\n###....\n..1..#.\n.###.#.\n.....#2\n", "output": "18 1 \n"}, {"type": "stdin_stdout", "input": "4 7 2\n13 1\n###....\n..1..#.\n.###.#.\n.....#2\n", "output": "18 ... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nOur master carpenter is designing a condominium called Bange Hills Mansion. The condominium is constructed by stacking up floors of the same height. The height of each floor is designed so that the total height of the sta... | [{"type": "stdin_stdout", "input": "000 12 208", "output": "197\n"}, {"type": "stdin_stdout", "input": "000 9 208", "output": "200\n"}, {"type": "stdin_stdout", "input": "000 4 120", "output": "117\n"}, {"type": "stdin_stdout", "input": "000 16 106", "output": "91\n"}, {"type": "stdin_stdout", "input": "000 26 106", "o... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nVladik often travels by trains. He remembered some of his trips especially well and I would like to tell you about one of these trips:\n\nVladik is at initial train station, and now n people (including Vladik) want to get... | [{"type": "stdin_stdout", "input": "100\n931 4584 2116 3004 3813 62 2819 2998 2080 4906 3198 2443 2952 3793 1958 3864 3985 3169 3134 4011 4525 995 4163 308 4362 1148 4906 3092 1647 244 1370 1424 2753 84 2997 1197 2606 425 3501 2606 683 4747 3884 4787 2166 3017 3080 4303 3352 1667 2636 3994 757 2388 870 1788 988 1303 0 ... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nThe Smart Beaver from ABBYY decided to have a day off. But doing nothing the whole day turned out to be too boring, and he decided to play a game with pebbles. Initially, the Beaver has n pebbles. He arranges them in a eq... | [{"type": "stdin_stdout", "input": "1000000000\n", "output": "1998535156\n"}, {"type": "stdin_stdout", "input": "999161856\n", "output": "1998319610\n"}, {"type": "stdin_stdout", "input": "999936000\n", "output": "1999743134\n"}, {"type": "stdin_stdout", "input": "999999948\n", "output": "1833697140\n"}, {"type": "stdi... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nOur world is one-dimensional, and ruled by two empires called Empire A and Empire B.\nThe capital of Empire A is located at coordinate X, and that of Empire B is located at coordinate Y.\nOne day, Empire A becomes incline... | [{"type": "stdin_stdout", "input": "99 99 -22 62\n-9 -54 -13 -39 -79 -88 -6 -14 -41 -29 -2 -69 -30 -20 -33 -8 -24 -80 -19 -87 -32 -60 -40 -59 -44 -52 -3 -67 -18 -51 -56 -12 -7 -31 -48 -27 -68 -78 -21 -11 -49 -93 -1 -64 -82 -66 -70 -58 -84 -26 -57 -37 -53 -89 -50 -34 -61 -46 -92 -95 -99 -63 -65 -28 -10 -16 -73 -55 -98 -... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nLet's call an array $a$ consisting of $n$ positive (greater than $0$) integers beautiful if the following condition is held for every $i$ from $1$ to $n$: either $a_i = 1$, or at least one of the numbers $a_i - 1$ and $a_... | [{"type": "stdin_stdout", "input": "4\n1\n12\n13\n35\n", "output": "1\n4\n4\n6\n"}, {"type": "stdin_stdout", "input": "4\n1\n12\n11\n14\n", "output": "1\n4\n4\n4\n"}, {"type": "stdin_stdout", "input": "4\n1\n12\n22\n35\n", "output": "1\n4\n5\n6\n"}, {"type": "stdin_stdout", "input": "4\n2\n12\n11\n14\n", "output": "2\n... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nPermutation $p$ is a sequence of integers $p=[p_1, p_2, \\dots, p_n]$, consisting of $n$ distinct (unique) positive integers between $1$ and $n$, inclusive. For example, the following sequences are permutations: $[3, 4, 1... | [{"type": "stdin_stdout", "input": "4\n5\n1 3 4 5 5\n4\n1 1 3 4\n2\n2 2\n1\n1\n", "output": "1 3 4 5 2 \n-1\n2 1 \n1 \n"}, {"type": "stdin_stdout", "input": "4\n5\n1 3 4 5 5\n4\n1 1 3 4\n2\n2 2\n1\n1\n", "output": "1 3 4 5 2 \n-1\n2 1 \n1 \n"}, {"type": "stdin_stdout", "input": "4\n5\n2 3 4 5 5\n4\n1 1 3 4\n2\n2 2\n1\n... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nWe define the function `f1(n,k)`, as the least multiple of `n` that has all its digits less than `k`. \n\nWe define the function `f2(n,k)`, as the least multiple of `n` that has all the digits that are less than `k`.\n\nE... | [{"input": "9567100\n8", "output": "[9567115]", "fn_name": "find_f1_eq_f2"}, {"input": "568525\n7", "output": "[568531]", "fn_name": "find_f1_eq_f2"}, {"input": "14990\n7", "output": "[14996]", "fn_name": "find_f1_eq_f2"}, {"input": "30500\n3", "output": "[30501]", "fn_name": "find_f1_eq_f2"}, {"input": "62550\n5", "ou... | code_functional |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nAlice guesses the strings that Bob made for her.\n\nAt first, Bob came up with the secret string $a$ consisting of lowercase English letters. The string $a$ has a length of $2$ or more characters. Then, from string $a$ he... | [{"type": "stdin_stdout", "input": "11\nabbaac\nabbaac\nabbaac\nabbaac\nabbaac\nabbaac\nabbaac\nabbaac\nac\nbccddaaf\nzzzzzzzzzz\n", "output": "abac\nabac\nabac\nabac\nabac\nabac\nabac\nabac\nac\nbcdaf\nzzzzzz\n"}, {"type": "stdin_stdout", "input": "10\nabbaac\nac\nbccddaaf\nzzzzzzzzzz\nabbaac\nac\nbccddaaf\nzzzzzzzzzz... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nMashmokh's boss, Bimokh, didn't like Mashmokh. So he fired him. Mashmokh decided to go to university and participate in ACM instead of finding a new job. He wants to become a member of Bamokh's team. In order to join he w... | [{"type": "stdin_stdout", "input": "2000 2000\n", "output": "585712681"}, {"type": "stdin_stdout", "input": "1544 1794\n", "output": "933285446"}, {"type": "stdin_stdout", "input": "1639 1056\n", "output": "467464129"}, {"type": "stdin_stdout", "input": "2000 1000\n", "output": "228299266"}, {"type": "stdin_stdout", "i... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nHave you ever had an infinite loop when you ran a hard-working program? It would be convenient to be able to determine in advance whether a program will stop executing without having to execute it.\n\nUnfortunately, it is... | [{"type": "stdin_stdout", "input": "6\n10 SET d 1\n20 SET h 5\n100 ADD s s i\n110 SUB i i c\n120 IF i 100\n124 HALT", "output": "c=0\nd=1\nh=5\ni=0\ns=0\n"}, {"type": "stdin_stdout", "input": "6\n10 SET c 1\n20 SET h 5\n100 ADD s s i\n110 SUB i i c\n209 IF j 100\n200 HALT", "output": "c=1\nh=5\ni=0\nj=0\ns=0\n"}, {"typ... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nFinally, a basketball court has been opened in SIS, so Demid has decided to hold a basketball exercise session. $2 \\cdot n$ students have come to Demid's exercise session, and he lined up them into two rows of the same s... | [{"type": "stdin_stdout", "input": "100\n4 1 4 1 4 1 4 1 4 1 4 1 4 1 4 1 4 1 4 1 4 1 4 1 4 1 4 1 4 1 4 1 4 1 4 1 4 1 4 1 4 1 4 1 4 1 4 1 4 1 4 1 4 1 4 1 4 1 4 1 4 1 4 1 4 1 4 1 4 1 4 1 4 1 4 1 4 1 4 1 4 1 4 1 4 1 4 1 4 1 4 1 4 1 4 1 4 1 4 1\n1 4 1 4 1 4 1 4 1 4 1 4 1 4 1 4 1 4 1 4 1 4 1 4 1 4 1 4 1 4 1 4 1 4 1 4 1 4 1 ... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nThere is a rectangular grid of n rows of m initially-white cells each.\n\nArkady performed a certain number (possibly zero) of operations on it. In the i-th operation, a non-empty subset of rows R_{i} and a non-empty subs... | [{"type": "stdin_stdout", "input": "50 8\n.....#..\n........\n........\n.....#..\n.....#..\n........\n........\n........\n........\n...#....\n...#....\n........\n...#....\n#.#.#...\n...#....\n...#....\n........\n...#....\n...#....\n...#....\n........\n#.#.#...\n.....#..\n........\n#.#.#...\n#.#.#...\n#.#.#...\n...#....... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nTakahashi is standing on a two-dimensional plane, facing north. Find the minimum positive integer K such that Takahashi will be at the starting position again after he does the following action K times:\n\n* Go one meter ... | [{"type": "stdin_stdout", "input": "1329", "output": "120\n"}, {"type": "stdin_stdout", "input": "1162", "output": "180\n"}, {"type": "stdin_stdout", "input": "1369", "output": "360\n"}, {"type": "stdin_stdout", "input": "1527", "output": "120\n"}, {"type": "stdin_stdout", "input": "1874", "output": "180\n"}, {"type": ... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nNumber of tanka\n\nWishing to die in the spring under the flowers\n\nThis is one of the famous tanka poems that Saigyo Hoshi wrote. Tanka is a type of waka poem that has been popular in Japan for a long time, and most of ... | [{"type": "stdin_stdout", "input": "1\n1\n3\n1531\n2317\n714\n225725068861419081\n0", "output": "10\n10\n13\n55955\n155155\n7277\n3223333233333322222322232232233222323233333233223332\n"}, {"type": "stdin_stdout", "input": "1\n1\n4\n1531\n2317\n714\n225725068861419081\n0", "output": "10\n10\n14\n55955\n155155\n7277\n322... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nYou are given an array of non-negative integers, your task is to complete the series from 0 to the highest number in the array.\n\nIf the numbers in the sequence provided are not in order you should order them, but if a v... | [{"input": "[1, 4, 6]", "output": "[[0, 1, 2, 3, 4, 5, 6]]", "fn_name": "complete_series"}, {"input": "[3, 4, 5]", "output": "[[0, 1, 2, 3, 4, 5]]", "fn_name": "complete_series"}, {"input": "[2, 1]", "output": "[[0, 1, 2]]", "fn_name": "complete_series"}, {"input": "[1, 4, 4, 6]", "output": "[[0]]", "fn_name": "complet... | code_functional |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nPaladin Manao caught the trail of the ancient Book of Evil in a swampy area. This area contains n settlements numbered from 1 to n. Moving through the swamp is very difficult, so people tramped exactly n - 1 paths. Each o... | [{"type": "stdin_stdout", "input": "50 2 5\n9 14\n46 34\n40 35\n44 30\n32 16\n1 38\n48 2\n17 14\n50 25\n6 1\n45 19\n21 15\n22 11\n15 33\n8 28\n2 32\n10 22\n37 3\n43 39\n25 16\n9 19\n16 3\n28 32\n20 45\n24 32\n4 18\n49 39\n13 45\n26 4\n11 33\n14 37\n42 19\n31 45\n38 3\n34 8\n18 29\n35 34\n29 16\n7 46\n19 28\n27 33\n30 9... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nPolycarp has found a table having an infinite number of rows and columns. The rows are numbered from $1$, starting from the topmost one. The columns are numbered from $1$, starting from the leftmost one.\n\nInitially, the... | [{"type": "stdin_stdout", "input": "100\n1\n2\n2\n3\n4\n5\n6\n13\n15\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n35\n20\n21\n22\n23\n24\n25\n26\n27\n28\n23\n30\n31\n32\n33\n34\n35\n36\n19\n38\n60\n40\n41\n42\n43\n44\n119\n46\n47\n77\n49\n44\n51\n45\n53\n54\n55\n56\n57\n58\n87\n60\n61\n42\n63\n64\n65\n66\n67\n68\n69\n70\n12... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nTo celebrate the start of the Rio Olympics (and the return of 'the Last Leg' on C4 tonight) this is an Olympic inspired kata.\n\nGiven a string of random letters, you need to examine each. Some letters naturally have 'rin... | [{"input": "\"eCEHWEPwwnvzMicyaRjk\"", "output": "[\"Bronze!\"]", "fn_name": "olympic_ring"}, {"input": "\"EWlZlDFsEIBufsalqof\"", "output": "[\"Silver!\"]", "fn_name": "olympic_ring"}, {"input": "\"JKniLfLW\"", "output": "[\"Not even a medal!\"]", "fn_name": "olympic_ring"}, {"input": "\"wHjMudLwtoPGocnJ\"", "output":... | code_functional |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nThe Little Elephant loves chess very much. \n\nOne day the Little Elephant and his friend decided to play chess. They've got the chess pieces but the board is a problem. They've got an 8 × 8 checkered board, each square i... | [{"type": "stdin_stdout", "input": "WBWBWBWB\nBWBWBWBW\nBWBWBWBW\nBWBWBWBW\nWBWBWBWB\nWBWBWBWB\nBWBWBWBW\nWBWBWBWB\n", "output": "YES\n"}, {"type": "stdin_stdout", "input": "BWBWBWBW\nWBWBWBWB\nBWBWBWBW\nBWBWBWBW\nWBWBWBWB\nWBWBWBWB\nWBWBWBWB\nWBWBWBWB\n", "output": "YES\n"}, {"type": "stdin_stdout", "input": "BWBWBWBW... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nThe semester is already ending, so Danil made an effort and decided to visit a lesson on harmony analysis to know how does the professor look like, at least. Danil was very bored on this lesson until the teacher gave the ... | [{"type": "stdin_stdout", "input": "8\n", "output": "++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\n+*+*+*+*+... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nEvery Codeforces user has rating, described with one integer, possibly negative or zero. Users are divided into two divisions. The first division is for users with rating 1900 or higher. Those with rating 1899 or lower be... | [{"type": "stdin_stdout", "input": "50\n67 1\n89 2\n83 1\n-26 1\n88 2\n-22 2\n-98 2\n-83 1\n58 2\n26 2\n-37 1\n-51 2\n29 1\n47 2\n-70 1\n81 2\n36 1\n52 2\n93 2\n-12 2\n-12 1\n5 2\n91 1\n3 1\n-27 1\n18 1\n-60 1\n-15 1\n17 1\n-33 1\n-74 2\n5 2\n-62 2\n72 1\n-22 1\n-58 1\n-9 1\n57 1\n-18 2\n-11 1\n-103 2\n74 2\n-20 2\n21 ... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nReca company makes monitors, the most popular of their models is AB999 with the screen size a × b centimeters. Because of some production peculiarities a screen parameters are integer numbers. Recently the screen sides ra... | [{"type": "stdin_stdout", "input": "2000000000 2000000000 1999999998 1999999999\n", "output": "1999999998 1999999999"}, {"type": "stdin_stdout", "input": "2000000000 2000000000 1999999999 1999999998\n", "output": "1999999999 1999999998"}, {"type": "stdin_stdout", "input": "1688112099 1875662241 198852947 116042960\n", ... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nRecall that the permutation is an array consisting of $n$ distinct integers from $1$ to $n$ in arbitrary order. For example, $[2,3,1,5,4]$ is a permutation, but $[1,2,2]$ is not a permutation ($2$ appears twice in the arr... | [{"type": "stdin_stdout", "input": "250000 993244853\n", "output": "872048421\n"}, {"type": "stdin_stdout", "input": "244435 994838543\n", "output": "634651929\n"}, {"type": "stdin_stdout", "input": "234324 994631069\n", "output": "720229385\n"}, {"type": "stdin_stdout", "input": "249996 997202249\n", "output": "633673... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nThe Cybermen solved that first test much quicker than the Daleks. Luckily for us, the Daleks were angry (shocking!) and they destroyed some of the Cybermen.\n\nAfter the fighting stopped, Heidi gave them another task to w... | [{"type": "stdin_stdout", "input": "5 0\n2 1\n-2 -1\n-1 1\n-2 -2\n2 2\n", "output": "1\n"}, {"type": "stdin_stdout", "input": "5 1\n1 1\n-1 -1\n-1 1\n-2 -2\n2 0\n", "output": "2\n"}, {"type": "stdin_stdout", "input": "5 1\n2 1\n-1 -1\n-1 1\n-2 -2\n2 0\n", "output": "2\n"}, {"type": "stdin_stdout", "input": "5 1\n2 1\n-... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nProgrammer Sasha has recently begun to study data structures. His coach Stas told him to solve the problem of finding a minimum on the segment of the array in <image>, which Sasha coped with. For Sasha not to think that h... | [{"type": "stdin_stdout", "input": "10 3\n-20\n-63\n-64\n45\n-84\n-13\n79\n-31\n70\n-100\n", "output": "-20\n45\n45\n45\n79\n79\n79\n70\n"}, {"type": "stdin_stdout", "input": "10 3\n-20\n-52\n-64\n45\n-139\n-13\n79\n-31\n89\n-100\n", "output": "-20\n45\n45\n45\n79\n79\n89\n89"}, {"type": "stdin_stdout", "input": "10 3\... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nIf we alternate the vowels and consonants in the string `\"have\"`, we get the following list, arranged alphabetically:\n`['ahev', 'aveh', 'ehav', 'evah', 'vahe', 'veha']`. These are the only possibilities in which vowels... | [{"input": "\"acidity\"", "output": "[\"caditiy\"]", "fn_name": "solve"}, {"input": "\"codewars\"", "output": "[\"failed\"]", "fn_name": "solve"}, {"input": "\"orudere\"", "output": "[\"ederoru\"]", "fn_name": "solve"}, {"input": "\"oruder\"", "output": "[\"edorur\"]", "fn_name": "solve"}, {"input": "\"zodiac\"", "outp... | code_functional |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nDivision of Big Integers\n\nGiven two integers $A$ and $B$, compute the quotient, $\\frac{A}{B}$. Round down to the nearest decimal.\n\nInput\n\nTwo integers $A$ and $B$ separated by a space character are given in a line.... | [{"type": "stdin_stdout", "input": "12 -1", "output": "-12\n"}, {"type": "stdin_stdout", "input": "10 -1", "output": "-10\n"}, {"type": "stdin_stdout", "input": "20 -1", "output": "-20\n"}, {"type": "stdin_stdout", "input": "11 -1", "output": "-11\n"}, {"type": "stdin_stdout", "input": "15 -1", "output": "-15\n"}, {"ty... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nVasya has n items lying in a line. The items are consecutively numbered by numbers from 1 to n in such a way that the leftmost item has number 1, the rightmost item has number n. Each item has a weight, the i-th item weig... | [{"type": "stdin_stdout", "input": "2 100 100 10000 10000\n100 100\n", "output": "20000\n"}, {"type": "stdin_stdout", "input": "2 110 100 10000 10000\n100 100\n", "output": "21000\n"}, {"type": "stdin_stdout", "input": "2 110 100 10000 11101\n100 000\n", "output": "11000\n"}, {"type": "stdin_stdout", "input": "2 110 10... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nRng is going to a festival.\n\nThe name of the festival is given to you as a string S, which ends with `FESTIVAL`, from input. Answer the question: \"Rng is going to a festival of what?\" Output the answer.\n\nHere, assum... | [{"type": "stdin_stdout", "input": "CODEFESTIVALFERTIVAL", "output": "CODEFESTIVAL\n"}, {"type": "stdin_stdout", "input": "CODEFESTIWALFESTIWAL", "output": "CODEFESTIWAL\n"}, {"type": "stdin_stdout", "input": "LAWITSEFLAWITSEFEDOC", "output": "LAWITSEFLAWI\n"}, {"type": "stdin_stdout", "input": "CODEFWSTIWALFESTIEAL", ... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nproblem\n\nI want to put as many rectangular tiles as possible on a rectangular wall with a size of $ h $ in height and $ w $ in width, and a size of $ a $ in height and $ b $ in width.\n\nThe following conditions must be... | [{"type": "stdin_stdout", "input": "87 15\n12 66", "output": "1305\n"}, {"type": "stdin_stdout", "input": "87 29\n12 66", "output": "2523\n"}, {"type": "stdin_stdout", "input": "27 27\n16 16", "output": "473\n"}, {"type": "stdin_stdout", "input": "27 32\n16 16", "output": "352\n"}, {"type": "stdin_stdout", "input": "-1... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nYou are given three integers $a$, $b$, and $c$. Determine if one of them is the sum of the other two.\n\n\n-----Input-----\n\nThe first line contains a single integer $t$ ($1 \\leq t \\leq 9261$) — the number of test case... | [{"type": "stdin_stdout", "input": "47\n1 1 1\n1 1 1\n1 1 1\n1 1 1\n1 1 1\n1 1 1\n1 1 1\n1 1 1\n1 1 1\n1 1 1\n1 1 1\n1 1 1\n1 1 1\n1 1 1\n1 1 1\n1 1 1\n1 1 1\n1 1 1\n1 1 1\n1 1 1\n1 1 1\n1 1 1\n1 1 1\n1 1 1\n1 1 1\n1 1 1\n1 1 1\n1 1 1\n1 1 1\n1 1 1\n1 1 1\n1 1 1\n1 1 1\n1 1 1\n1 1 1\n1 1 1\n1 1 1\n1 1 1\n1 1 1\n1 1 1\n... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nAs a strict big brother, I do limit my young brother Vasya on time he spends on computer games. I define a prime-time as a time period till which Vasya have a permission to play computer games. I specify start hour and en... | [{"input": "9\n10\n11", "output": "[false]", "fn_name": "can_i_play"}, {"input": "12\n12\n13", "output": "[true]", "fn_name": "can_i_play"}, {"input": "13\n10\n15", "output": "[true]", "fn_name": "can_i_play"}, {"input": "14\n9\n14", "output": "[false]", "fn_name": "can_i_play"}, {"input": "15\n8\n12", "output": "[fals... | code_functional |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nAs you know, majority of students and teachers of Summer Informatics School live in Berland for the most part of the year. Since corruption there is quite widespread, the following story is not uncommon.\n\nElections are ... | [{"type": "stdin_stdout", "input": "10 10\n7 29\n10 31\n9 40\n5 17\n5 30\n6 85\n2 53\n7 23\n4 57\n10 9\n", "output": "49\n"}, {"type": "stdin_stdout", "input": "10 10\n5 81\n7 68\n7 48\n1 10\n5 37\n7 97\n8 54\n7 41\n7 56\n5 21\n", "output": "110\n"}, {"type": "stdin_stdout", "input": "10 10\n7 29\n10 54\n9 40\n5 17\n5 ... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nYou are given a rectangular board of M × N squares. Also you are given an unlimited number of standard domino pieces of 2 × 1 squares. You are allowed to rotate the pieces. You are asked to place as many dominoes as possi... | [{"type": "stdin_stdout", "input": "14 16\n", "output": "112\n"}, {"type": "stdin_stdout", "input": "15 16\n", "output": "120\n"}, {"type": "stdin_stdout", "input": "16 16\n", "output": "128\n"}, {"type": "stdin_stdout", "input": "14 15\n", "output": "105\n"}, {"type": "stdin_stdout", "input": "15 15\n", "output": "112... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\n# Task \n\n**_Given_** *a number* , **_Return_** **_The Maximum number _** *could be formed from the digits of the number given* . \n___\n# Notes\n\n* **_Only Natural numbers_** *passed to the function , numbers Conta... | [{"input": "1000000", "output": "[1000000]", "fn_name": "max_number"}, {"input": "566797", "output": "[977665]", "fn_name": "max_number"}, {"input": "63792", "output": "[97632]", "fn_name": "max_number"}, {"input": "7389", "output": "[9873]", "fn_name": "max_number"}, {"input": "213", "output": "[321]", "fn_name": "max... | code_functional |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nJack decides to invite Emma out for a dinner. Jack is a modest student, he doesn't want to go to an expensive restaurant. Emma is a girl with high taste, she prefers elite places.\n\nMunhattan consists of n streets and m ... | [{"type": "stdin_stdout", "input": "10 10\n256 72 455 45 912 506 235 68 951 92\n246 305 45 212 788 621 449 876 459 899\n732 107 230 357 370 610 997 669 61 192\n131 93 481 527 983 920 825 540 435 54\n777 682 984 20 337 480 264 137 249 502\n51 467 479 228 923 752 714 436 199 973\n3 91 612 571 631 212 751 84 886 948\n252 ... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nYou are going to be given an array of integers. Your job is to take that array and find an index N where the sum of the integers to the left of N is equal to the sum of the integers to the right of N. If there is no index... | [{"input": "[-100, -99, -98, -97, -96, -95, -94, -93, -92, -91, -90, -89, -88, -87, -86, -85, -84, -83, -82, -81, -80, -79, -78, -77, -76, -75, -74, -73, -72, -71, -70, -69, -68, -67, -66, -65, -64, -63, -62, -61, -60, -59, -58, -57, -56, -55, -54, -53, -52, -51, -50, -49, -48, -47, -46, -45, -44, -43, -42, -41, -40, -... | code_functional |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.