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\nDo you know Just Odd Inventions? The business of this company is to \"just odd inventions\". Here, it is abbreviated as JOI.\n\nJOI is conducting research to confine many microorganisms in one petri dish alive. There are ... | [{"type": "stdin_stdout", "input": "6\n12 13\n5 9\n2 4\n10 12\n6 12\n6 11", "output": "5\n"}, {"type": "stdin_stdout", "input": "6\n12 38\n5 9\n2 4\n10 12\n6 12\n11 9", "output": "5\n"}, {"type": "stdin_stdout", "input": "6\n12 13\n5 9\n2 2\n10 12\n6 12\n6 11", "output": "5\n"}, {"type": "stdin_stdout", "input": "6\n12... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nPeter wrote on the board a strictly increasing sequence of positive integers a_1, a_2, ..., a_{n}. Then Vasil replaced some digits in the numbers of this sequence by question marks. Thus, each question mark corresponds to... | [{"type": "stdin_stdout", "input": "98\n?\n?0\n2?\n6?\n6?\n69\n??\n??\n96\n1?2\n??3\n104\n??4\n1?9\n??2\n18?\n?01\n205\n?19\n244\n??8\n?5?\n?5?\n276\n??3\n???\n???\n?28\n?3?\n3??\n??8\n355\n4?0\n4??\n?10\n??1\n417\n4?9\n?3?\n4?4\n?61\n?8?\n???\n507\n?2?\n???\n??6\n5?7\n540\n5?9\n???\n?7?\n5??\n591\n?9?\n6?0\n620\n??4\n... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nExample\n\nInput\n\n3\n\n\nOutput\n\n1\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 program shoul... | [{"type": "stdin_stdout", "input": "20093", "output": "276\n"}, {"type": "stdin_stdout", "input": "5663", "output": "100\n"}, {"type": "stdin_stdout", "input": "1761", "output": "292\n"}, {"type": "stdin_stdout", "input": "2283", "output": "36\n"}, {"type": "stdin_stdout", "input": "1253", "output": "88\n"}, {"type": "... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nWe understand that reading English is a great pain to many of you. So we’ll keep this problem statememt simple. Write a program that reports the point equally distant from a set of lines given as the input. In case of no ... | [{"type": "stdin_stdout", "input": "2\n-35 -35 100 100\n-49 49 1588 -2000\n4\n0 0 0 3\n0 0 3 0\n0 3 3 3\n3 0 3 3\n4\n0 3 -4 6\n3 0 6 -4\n2 3 6 6\n-1 2 -4 6\n0", "output": "Many\n1.500000 1.500000\n1.000000 1.000000\n"}, {"type": "stdin_stdout", "input": "2\n-35 -35 100 100\n-49 49 1588 -2000\n4\n0 0 0 4\n0 0 3 0\n0 3 3... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nYou're given an array $a$ of $n$ integers, such that $a_1 + a_2 + \\cdots + a_n = 0$.\n\nIn one operation, you can choose two different indices $i$ and $j$ ($1 \\le i, j \\le n$), decrement $a_i$ by one and increment $a_j... | [{"type": "stdin_stdout", "input": "7\n4\n-3 5 -3 1\n2\n1 -1\n4\n-3 2 -3 4\n4\n-1 1 1 -1\n7\n-5 7 -6 -4 17 -13 4\n6\n-1000000000 -1000000000 -1000000000 1000000000 1000000000 1000000000\n1\n0\n", "output": "3\n0\n4\n1\n8\n3000000000\n0\n"}, {"type": "stdin_stdout", "input": "7\n4\n-3 5 -3 1\n2\n1 -1\n4\n-3 2 -3 4\n4\n-... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nproblem\n\nCryptography is all the rage at xryuseix's school. Xryuseix, who lives in a grid of cities, has come up with a new cryptography to decide where to meet.\n\nThe ciphertext consists of the $ N $ character string ... | [{"type": "stdin_stdout", "input": "5\nAMazA", "output": "3\nAAA\n"}, {"type": "stdin_stdout", "input": "5\nAMAza", "output": "3\nAAA\n"}, {"type": "stdin_stdout", "input": "5\nAMBza", "output": "3\nAAA\n"}, {"type": "stdin_stdout", "input": "5\nAaBzM", "output": "3\nAAA\n"}, {"type": "stdin_stdout", "input": "5\nAazBM... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nPinkie Pie has bought a bag of patty-cakes with different fillings! But it appeared that not all patty-cakes differ from one another with filling. In other words, the bag contains some patty-cakes with the same filling.\n... | [{"type": "stdin_stdout", "input": "4\n7\n1 7 1 6 4 4 6\n8\n1 1 4 6 4 6 4 7\n3\n3 3 3\n6\n2 5 2 3 1 4\n", "output": "3\n2\n0\n4\n"}, {"type": "stdin_stdout", "input": "4\n7\n1 7 1 6 4 7 6\n8\n1 1 4 6 4 6 4 7\n3\n3 3 3\n6\n2 5 2 3 1 4\n", "output": "3\n2\n0\n4\n"}, {"type": "stdin_stdout", "input": "4\n7\n1 7 1 6 4 7 6\... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\n# Task\n Initially a number `1` is written on a board. It is possible to do the following operations with it:\n```\nmultiply the number by 3;\nincrease the number by 5.```\nYour task is to determine that using this two op... | [{"input": "12345", "output": "[false]", "fn_name": "number_increasing"}, {"input": "54321", "output": "[true]", "fn_name": "number_increasing"}, {"input": "100", "output": "[false]", "fn_name": "number_increasing"}, {"input": "101", "output": "[true]", "fn_name": "number_increasing"}, {"input": "2", "output": "[false]... | code_functional |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nRecall that a binary search tree is a rooted binary tree, whose nodes each store a key and each have at most two distinguished subtrees, left and right. The key in each node must be greater than any key stored in the left... | [{"type": "stdin_stdout", "input": "1000000\n", "output": "0\n"}, {"type": "stdin_stdout", "input": "360561\n", "output": "0\n"}, {"type": "stdin_stdout", "input": "699049\n", "output": "1\n"}, {"type": "stdin_stdout", "input": "699047\n", "output": "0\n"}, {"type": "stdin_stdout", "input": "699050\n", "output": "1\n"}... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nIn this Kata, you will be given an array of integers whose elements have both a negative and a positive value, except for one integer that is either only negative or only positive. Your task will be to find that integer. ... | [{"input": "[-110, 110, -38, -38, -62, 62, -38, -38, -38]", "output": "[-38]", "fn_name": "solve"}, {"input": "[-9, -105, -9, -9, -9, -9, 105]", "output": "[-9]", "fn_name": "solve"}, {"input": "[-3, 1, 2, 3, -1, -4, -2]", "output": "[-4]", "fn_name": "solve"}, {"input": "[1, -1, 2, -2, 3, 3]", "output": "[3]", "fn_nam... | code_functional |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nD: Sunburn-Suntan-\n\nstory\n\nAizunyan is a second-year student who belongs to the programming contest club of Wakagamatsu High School, commonly known as the Prokon club. Cute like an angel. Aizu Nyan is planning to part... | [{"type": "stdin_stdout", "input": "20\n1\n-1 12", "output": "13\n"}, {"type": "stdin_stdout", "input": "20\n1\n-1 19", "output": "20\n"}, {"type": "stdin_stdout", "input": "20\n1\n0 19", "output": "19\n"}, {"type": "stdin_stdout", "input": "20\n1\n0 12", "output": "12\n"}, {"type": "stdin_stdout", "input": "20\n1\n0 2... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nPolycarp remembered the $2020$-th year, and he is happy with the arrival of the new $2021$-th year. To remember such a wonderful moment, Polycarp wants to represent the number $n$ as the sum of a certain number of $2020$ ... | [{"type": "stdin_stdout", "input": "5\n1\n4041\n4042\n8081\n8079\n", "output": "\nNO\nYES\nYES\nYES\nNO\n"}, {"type": "stdin_stdout", "input": "5\n1\n4041\n4042\n8081\n8079\n", "output": "NO\nYES\nYES\nYES\nNO\n"}, {"type": "stdin_stdout", "input": "5\n1\n4041\n4042\n12391\n8079\n", "output": "NO\nYES\nYES\nNO\nNO\n"},... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nExample\n\nInput\n\n1+2*3+4\n11\n\n\nOutput\n\nM\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 pro... | [{"type": "stdin_stdout", "input": "4+1*3+0\n104", "output": "I\n"}, {"type": "stdin_stdout", "input": "4+1*3+0\n102", "output": "I\n"}, {"type": "stdin_stdout", "input": "0+3*1+4\n104", "output": "I\n"}, {"type": "stdin_stdout", "input": "0+3*1+4\n129", "output": "I\n"}, {"type": "stdin_stdout", "input": "3*1+0*4\n12"... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nThere is a country with $n$ citizens. The $i$-th of them initially has $a_{i}$ money. The government strictly controls the wealth of its citizens. Whenever a citizen makes a purchase or earns some money, they must send a ... | [{"type": "stdin_stdout", "input": "10\n7 9 4 4 7 6 3 7 9 8\n10\n1 3 2\n1 10 5\n1 5 3\n1 5 2\n1 2 9\n1 2 9\n1 2 10\n1 5 7\n1 6 10\n1 10 9\n", "output": "7 10 2 4 7 10 3 7 9 9 \n"}, {"type": "stdin_stdout", "input": "10\n7 9 4 4 7 6 3 7 9 10\n10\n1 4 2\n1 10 5\n1 5 3\n1 5 2\n1 2 9\n1 2 9\n1 2 10\n1 5 7\n1 6 10\n1 10 9\n... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nHeading ##There are two integers A and B. You are required to compute the bitwise AND amongst all natural numbers lying between A and B, both inclusive.\nInput Format\n\nFirst line of the input contains T, the number of t... | [{"type": "stdin_stdout", "input": "124\n1476395008 1493172223\n1275068416 1291845631\n4009754624 4026531839\n2516582400 2533359615\n50331648 67108863\n2566914048 2583691263\n2952790016 2969567231\n3892314112 3909091327\n3489660928 3506438143\n33554432 50331647\n1694498816 1711276031\n3623878656 3640655871\n1308622848 ... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nHongcow is learning to spell! One day, his teacher gives him a word that he needs to learn to spell. Being a dutiful student, he immediately learns how to spell the word.\n\nHongcow has decided to try to make new words fr... | [{"type": "stdin_stdout", "input": "abcdefghijklmnopqrstuvwxyabcdefghijklmnopqrstuvwxy\n", "output": "25\n"}, {"type": "stdin_stdout", "input": "zyzzzyyzyyyzyyzyzyzyzyzzzyyyzzyzyyzzzzzyyyzzzzyzyy\n", "output": "50\n"}, {"type": "stdin_stdout", "input": "aaaaaaaaaaaaaaaaaaaaaaaabaaaaaaaaaaaaaaaaaaaaaaaab\n", "output": "... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nVasya studies music. \n\nHe has learned lots of interesting stuff. For example, he knows that there are 12 notes: C, C#, D, D#, E, F, F#, G, G#, A, B, H. He also knows that the notes are repeated cyclically: after H goes ... | [{"type": "stdin_stdout", "input": "F# F# F#\n", "output": "strange\n"}, {"type": "stdin_stdout", "input": "D# D# F#\n", "output": "strange\n"}, {"type": "stdin_stdout", "input": "G# G# A\n", "output": "strange\n"}, {"type": "stdin_stdout", "input": "G# C# D\n", "output": "strange\n"}, {"type": "stdin_stdout", "input":... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nMeka-Naruto plays a computer game. His character has the following ability: given an enemy hero, deal $a$ instant damage to him, and then heal that enemy $b$ health points at the end of every second, for exactly $c$ secon... | [{"type": "stdin_stdout", "input": "6\n1411352 712902 579689 383030\n997653 839911 351405 69197\n31160 1580030 281506 245835\n234837 489356 452352 448472\n382561 916024 805514 657373\n287796 831046 710305 568719\n", "output": "1411352\n997653\n31160\n234837\n382561\n287796\n"}, {"type": "stdin_stdout", "input": "6\n141... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nYou are given an undirected unweighted graph consisting of $n$ vertices and $m$ edges (which represents the map of Bertown) and the array of prices $p$ of length $m$. It is guaranteed that there is a path between each pai... | [{"type": "stdin_stdout", "input": "2\n4 3 2 3 4\n2 4 3\n1 2\n1 3\n1 4\n7 9 1 5 7\n2 10 4 8 5 6 7 3 3\n1 2\n1 3\n1 4\n3 2\n3 5\n4 2\n5 6\n1 4\n6 7\n", "output": "11\n12\n"}, {"type": "stdin_stdout", "input": "2\n4 3 2 3 4\n1 5 3\n1 2\n1 3\n1 4\n7 9 2 5 7\n3 10 4 8 5 8 7 3 3\n2 2\n2 3\n1 4\n3 2\n3 5\n4 3\n5 6\n1 4\n6 7\... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nYou are playing a game where your character should overcome different obstacles. The current problem is to come down from a cliff. The cliff has height $h$, and there is a moving platform on each height $x$ from $1$ to $h... | [{"type": "stdin_stdout", "input": "28\n8 4\n8 7 6 3\n8 5\n8 7 6 3 1\n8 5\n8 7 6 3 2\n8 6\n8 7 6 3 2 1\n8 4\n8 7 6 4\n8 5\n8 7 6 4 1\n8 5\n8 7 6 4 2\n8 6\n8 7 6 4 2 1\n8 5\n8 7 6 4 3\n8 6\n8 7 6 4 3 1\n8 6\n8 7 6 4 3 2\n8 7\n8 7 6 4 3 2 1\n8 4\n8 7 6 5\n8 5\n8 7 6 5 1\n8 5\n8 7 6 5 2\n8 6\n8 7 6 5 2 1\n8 5\n8 7 6 5 3\n... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nTo become a millionaire, M-kun has decided to make money by trading in the next N days. Currently, he has 1000 yen and no stocks - only one kind of stock is issued in the country where he lives.\n\nHe is famous across the... | [{"type": "stdin_stdout", "input": "7\n100 130 243 130 115 115 150", "output": "3165\n"}, {"type": "stdin_stdout", "input": "7\n100 130 243 130 115 115 271", "output": "5706\n"}, {"type": "stdin_stdout", "input": "7\n110 130 243 130 115 115 271", "output": "5161\n"}, {"type": "stdin_stdout", "input": "7\n110 130 136 13... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nTakahashi loves the number 7 and multiples of K.\nWhere is the first occurrence of a multiple of K in the sequence 7,77,777,\\ldots? (Also see Output and Sample Input/Output below.)\nIf the sequence contains no multiples ... | [{"type": "stdin_stdout", "input": "999983\n", "output": "999982\n"}, {"type": "stdin_stdout", "input": "999863\n", "output": "999862\n"}, {"type": "stdin_stdout", "input": "999953\n", "output": "999952\n"}, {"type": "stdin_stdout", "input": "531441\n", "output": "531441\n"}, {"type": "stdin_stdout", "input": "823543\n... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nLittle penguin Polo adores strings. But most of all he adores strings of length n.\n\nOne day he wanted to find a string that meets the following conditions: The string consists of n lowercase English letters (that is, t... | [{"type": "stdin_stdout", "input": "93563 25\n", "output": "abababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababab... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nPolycarp wants to assemble his own keyboard. Layouts with multiple rows are too complicated for him — his keyboard will consist of only one row, where all $26$ lowercase Latin letters will be arranged in some order.\n\nPo... | [{"type": "stdin_stdout", "input": "5\nababa\ncodfdoca\ncbada\nzxzytyz\nabcdefghjjkllnopqrstuvwxyza\n", "output": "YES\nabcdefghijklmnopqrstuvwxyz\nYES\nacodfbeghijklmnpqrstuvwxyz\nYES\ncbadefghijklmnopqrstuvwxyz\nYES\ntyzxabcdefghijklmnopqrsuvw\nNO\n"}, {"type": "stdin_stdout", "input": "5\nababa\ncodedoca\nabcda\nzxz... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nLittle girl Tanya climbs the stairs inside a multi-storey building. Every time Tanya climbs a stairway, she starts counting steps from $1$ to the number of steps in this stairway. She speaks every number aloud. For exampl... | [{"type": "stdin_stdout", "input": "48\n1 2 3 4 1 2 3 1 1 2 3 1 2 3 4 1 1 2 3 4 1 2 3 4 1 2 3 4 1 1 1 1 2 1 2 1 1 2 1 2 1 2 3 1 1 1 2 1\n", "output": "22\n4 3 1 3 4 1 4 4 4 1 1 1 2 2 1 2 2 3 1 1 2 1 "}, {"type": "stdin_stdout", "input": "48\n1 2 3 4 1 2 3 1 1 2 1 1 2 3 4 1 1 2 3 4 1 2 3 4 1 2 3 4 1 1 2 1 2 1 2 1 1 1 1 ... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nGiven are two strings s and t consisting of lowercase English letters. Determine if the number of non-negative integers i satisfying the following condition is finite, and find the maximum value of such i if the number is... | [{"type": "stdin_stdout", "input": "aa\naaaaaaa\n", "output": "-1\n"}, {"type": "stdin_stdout", "input": "abcabab\nab\n", "output": "3\n"}, {"type": "stdin_stdout", "input": "aba\nbaaab\n", "output": "0\n"}, {"type": "stdin_stdout", "input": "aa\naaaaaaa", "output": "-1"}, {"type": "stdin_stdout", "input": "aa\nabaaaaa... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nThe Easter Rabbit laid n eggs in a circle and is about to paint them. \n\nEach egg should be painted one color out of 7: red, orange, yellow, green, blue, indigo or violet. Also, the following conditions should be satisfi... | [{"type": "stdin_stdout", "input": "100\n", "output": "ROYGBIVGBIVGBIVGBIVGBIVGBIVGBIVGBIVGBIVGBIVGBIVGBIVGBIVGBIVGBIVGBIVGBIVGBIVGBIVGBIVGBIVGBIVGBIVGBIVG"}, {"type": "stdin_stdout", "input": "99\n", "output": "ROYGBIVROYGBIVROYGBIVROYGBIVROYGBIVROYGBIVROYGBIVROYGBIVROYGBIVROYGBIVROYGBIVROYGBIVROYGBIVROYGBIVG\n"}, {"t... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nRead problems statements in Mandarin Chinese and Russian as well. \n\nChef wants to implement wildcard pattern matching supporting only the wildcard '?'. The wildcard character '?' can be substituted by any single lower c... | [{"type": "stdin_stdout", "input": "2\ns?o?r\nsco??\nstor?\nsco??", "output": "Yes\nNo\n"}, {"type": "stdin_stdout", "input": "2\ns?or?\nsco??\nstor?\nsco??", "output": "Yes\nNo\n"}, {"type": "stdin_stdout", "input": "2\ns?or?\nsco??\nstor?\nsco??", "output": "Yes\nNo"}, {"type": "stdin_stdout", "input": "2\nr?o?s\nsco... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nYour friend recently came up with a card game called UT-Rummy.\n\nThe cards used in this game are numbered red, green, or blue and any number from 1 to 9. Each player in this game has 9 cards in his or her hand, chooses o... | [{"type": "stdin_stdout", "input": "5\n1 2 3 6 4 5 7 13 7\nR R R R R R G G G\n1 2 2 3 4 4 4 4 5\nR R R R R Q R R R\n1 3 3 4 4 4 5 5 5\nR R B R R R R R R\n1 1 1 3 4 5 6 6 10\nR R B G G G R R S\n2 2 2 3 3 3 1 1 2\nR G B R G B R G B", "output": "0\n0\n0\n0\n0\n"}, {"type": "stdin_stdout", "input": "5\n1 2 3 6 4 5 7 13 7\n... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nAs you know Appu created aversion to Maths after that maths problem given by his teacher.So he stopped studying and began to do farming. He has some land where he starts growing sugarcane. At the end of the season he grew... | [{"type": "stdin_stdout", "input": "50\n558017747 707412184 571476824 27885972 347137128 534455142 266330082 381698014 939365541 506551897 225052521 672800684 64370521 756181857 592652322 228887401 599530996 111233973 330484393 490574767 309080152 39589626 763859303 515779418 857884239 413041773 131315151 512215539 928... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nYou are given an array $a$ consisting of $n$ integers. Indices of the array start from zero (i. e. the first element is $a_0$, the second one is $a_1$, and so on).\n\nYou can reverse at most one subarray (continuous subse... | [{"type": "stdin_stdout", "input": "4\n8\n1 3 3 4 11 6 2 9\n5\n1 2 1 2 1\n10\n5 13 6 5 14 0 4 9 13 5\n4\n0 1 2 1\n", "output": "24\n5\n50\n3\n"}, {"type": "stdin_stdout", "input": "4\n8\n0 4 3 6 11 6 2 9\n5\n1 2 1 2 1\n10\n5 13 6 5 14 0 4 9 13 5\n4\n0 1 2 1\n", "output": "25\n5\n50\n3\n"}, {"type": "stdin_stdout", "inp... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nYou are given a directed acyclic graph, consisting of $n$ vertices and $m$ edges. The vertices are numbered from $1$ to $n$. There are no multiple edges and self-loops.\n\nLet $\\mathit{in}_v$ be the number of incoming ed... | [{"type": "stdin_stdout", "input": "10 45\n3 8\n3 7\n3 5\n3 2\n3 1\n3 4\n3 10\n3 6\n3 9\n8 7\n8 5\n8 2\n8 1\n8 4\n8 10\n8 6\n8 9\n7 5\n7 2\n7 1\n7 4\n7 10\n7 6\n7 9\n5 2\n5 1\n5 4\n5 10\n5 6\n5 9\n2 1\n2 4\n2 10\n2 6\n2 9\n1 4\n1 10\n1 6\n1 9\n4 10\n4 6\n4 9\n10 6\n10 9\n6 9\n", "output": "8\n"}, {"type": "stdin_stdout... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nKuro and Shiro are playing with a board composed of n squares lining up in a row.\nThe squares are numbered 1 to n from left to right, and Square s has a mark on it.\nFirst, for each square, Kuro paints it black or white ... | [{"type": "stdin_stdout", "input": "7775\n", "output": "499126064\n499126064\n796234435\n114971967\n891826170\n38460928\n746758804\n102098624\n582205169\n762199467\n509915249\n602954502\n392594249\n215817236\n170876474\n643293880\n150463555\n628074695\n355316779\n513918741\n157394975\n757039573\n277888730\n825789360\n8... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nExample\n\nInput\n\n3\ny 7\ny 6\nn 5\n\n\nOutput\n\n1\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. You... | [{"type": "stdin_stdout", "input": "3\ny 11\ny 3\nn 10", "output": "1\n"}, {"type": "stdin_stdout", "input": "3\ny 11\nx 3\nn 10", "output": "1\n"}, {"type": "stdin_stdout", "input": "3\nx 2\ny 10\nn 10", "output": "1\n"}, {"type": "stdin_stdout", "input": "3\ny 11\nw 3\nn 10", "output": "1\n"}, {"type": "stdin_stdout"... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nFukushima Prefecture is also famous for producing fruits, and among them, peaches and apples boast one of the highest production volumes in Japan. By the way, when I made a print manuscript of an English pamphlet for sale... | [{"type": "stdin_stdout", "input": "the cost of one peach is higher than th`t of one apple.", "output": "the cost of one apple is higher than th`t of one peach.\n"}, {"type": "stdin_stdout", "input": "the cost of ooe peach is higher than th`t of one apple.", "output": "the cost of ooe apple is higher than th`t of one p... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nAkaki, a patissier, can make N kinds of doughnut using only a certain powder called \"Okashi no Moto\" (literally \"material of pastry\", simply called Moto below) as ingredient. These doughnuts are called Doughnut 1, Dou... | [{"type": "stdin_stdout", "input": "5 3000\n150\n130\n150\n130\n110\n", "output": "26\n"}, {"type": "stdin_stdout", "input": "5 3000\n150\n130\n150\n130\n100", "output": "28\n"}, {"type": "stdin_stdout", "input": "5 3000\n236\n130\n150\n130\n100", "output": "27\n"}, {"type": "stdin_stdout", "input": "5 3000\n150\n173\n... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nLet's pretend your company just hired your friend from college and paid you a referral bonus. Awesome! To celebrate, you're taking your team out to the terrible dive bar next door and using the referral bonus to buy, and ... | [{"input": "21\n1.5", "output": "[3]", "fn_name": "beeramid"}, {"input": "454\n5", "output": "[5]", "fn_name": "beeramid"}, {"input": "455\n5", "output": "[6]", "fn_name": "beeramid"}, {"input": "10\n2", "output": "[2]", "fn_name": "beeramid"}, {"input": "11\n2", "output": "[2]", "fn_name": "beeramid"}, {"input": "-1\n... | code_functional |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nI have started studying electronics recently, and I came up with a circuit made up of 2 LEDs and 3 buttons.\n\nHere 's how it works: 2 buttons (`red` and `blue`) are connected to the LEDs (`red` and `blue` respectively). ... | [{"input": "\"10101010\"\n\"01010101\"", "output": "[\"RBRBRBRB\"]", "fn_name": "button_sequences"}, {"input": "\"10011010\"\n\"10110111\"", "output": "[\"RBRB\"]", "fn_name": "button_sequences"}, {"input": "\"00010100\"\n\"01011100\"", "output": "[\"BRB\"]", "fn_name": "button_sequences"}, {"input": "\"11011011\"\n\"1... | code_functional |
[
{
"content": "Solve the following coding problem using the programming language python:\n\n# Your Task\nThe city of Darkishland has a strange hotel with infinite rooms. The groups that come to this hotel follow the following rules:\n\n* At the same time only members of one group can rent the hotel.\n\n* Each gr... | [{"input": "10\n900000000000000000", "output": "[1341640786]", "fn_name": "group_size"}, {"input": "10000\n1000000000000000", "output": "[44721361]", "fn_name": "group_size"}, {"input": "2\n20000000000000", "output": "[6324555]", "fn_name": "group_size"}, {"input": "234234\n6577", "output": "[234234]", "fn_name": "grou... | code_functional |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nHideyuki is allowed by his father Ujisato some 1000 yen bills every month for his pocket money. In the first day of every month, the number of bills is decided as follows. Ujisato prepares n pieces of m-sided dice and dec... | [{"type": "stdin_stdout", "input": "2 6 -1\n2 12 0\n6 18 9\n13 2 52\n1 2008 3\n0 0 0", "output": "8.0000000000\n13.0000000000\n48.0000035281\n1.0000000000\n1001.5029880478\n"}, {"type": "stdin_stdout", "input": "2 6 -1\n2 12 0\n6 18 5\n13 2 52\n1 2008 3\n0 0 0", "output": "8.0000000000\n13.0000000000\n52.0000000000\n1.... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nYou are given an array $a$ consisting of $n$ positive integers.\n\nYou are allowed to perform this operation any number of times (possibly, zero):\n\nchoose an index $i$ ($2 \\le i \\le n$), and change $a_i$ to $a_i - a_{... | [{"type": "stdin_stdout", "input": "1\n100\n1 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2\n", "output": "YES\n"}, {"type": "stdin_stdout", "input": "10\n2\n1 1\n10\n1... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nA [Mersenne prime](https://en.wikipedia.org/wiki/Mersenne_prime) is a prime number that can be represented as:\nMn = 2^(n) - 1. Therefore, every Mersenne prime is one less than a power of two. \n\nWrite a function that wi... | [{"input": "221", "output": "[false]", "fn_name": "valid_mersenne"}, {"input": "1279", "output": "[true]", "fn_name": "valid_mersenne"}, {"input": "11", "output": "[false]", "fn_name": "valid_mersenne"}, {"input": "21", "output": "[false]", "fn_name": "valid_mersenne"}, {"input": "23", "output": "[false]", "fn_name": "... | code_functional |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nIn a new version of the famous Pinball game, one of the most important parts of the game field is a sequence of n bumpers. The bumpers are numbered with integers from 1 to n from left to right. There are two types of bump... | [{"type": "stdin_stdout", "input": "100\n<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<\n", "output": "100\n"}, {"type": "stdin_stdout", "input": "100\n>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n", "output":... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nKuro has recently won the \"Most intelligent cat ever\" contest. The three friends then decided to go to Katie's home to celebrate Kuro's winning. After a big meal, they took a small break then started playing games.\n\nK... | [{"type": "stdin_stdout", "input": "50 1\n-1 -1 -1 -1 -1 0 -1 -1 -1 0 1 0 -1 0 1 -1 -1 -1 1 0 1 -1 0 1 0 1 0 0 1 1 -1 1 -1 -1 1 1 -1 -1 0 -1 -1 1 -1 1 -1 1 1 0 0 -1\n", "output": "279519499\n"}, {"type": "stdin_stdout", "input": "50 1\n-1 -1 -1 -1 -1 0 -1 -1 -1 0 1 0 -1 0 1 -1 -1 -1 1 0 1 -1 0 1 0 1 0 0 0 1 -1 1 -1 -1 ... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nI've got a crazy mental illness.\nI dislike numbers a lot. But it's a little complicated:\nThe number I'm afraid of depends on which day of the week it is...\nThis is a concrete description of my mental illness:\n\nMonday... | [{"input": "\"Wednesday\"\n35", "output": "[false]", "fn_name": "am_I_afraid"}, {"input": "\"Wednesday\"\n34", "output": "[true]", "fn_name": "am_I_afraid"}, {"input": "\"Saturday\"\n55", "output": "[false]", "fn_name": "am_I_afraid"}, {"input": "\"Tuesday\"\n100", "output": "[true]", "fn_name": "am_I_afraid"}, {"input... | code_functional |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nToastman came up with a very easy task. He gives it to Appleman, but Appleman doesn't know how to solve it. Can you help him?\n\nGiven a n × n checkerboard. Each cell of the board has either character 'x', or character 'o... | [{"type": "stdin_stdout", "input": "19\noxoxoxoxooxoooxxoox\nxxxxxxxxoxxoxoooooo\noxoxoxooxxxooxxxooo\nxxoxxxooxooxxxoxxox\noxoxooxxxooooxxoxox\nxxxoooxoxxoxxoxxxoo\noxooxxxoooooxxoooxo\nxxooxooxoxxoxxoxxoo\noxxxxooooxxxooooxxx\nooxooxoxxoxxoxooxoo\nxxxooooxxxooooxoxox\noooxoxooxxoxooxooxx\nxxoooxxxooooxxoooxo\nooxxxoo... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nB-Mansion and courier\n\nProblem Statement\n\nTaro lives alone in a mansion. Taro, who loves studying, intends to study in his study in the house today. Taro can't concentrate outside the study, so he always studies in th... | [{"type": "stdin_stdout", "input": "1 1 110\n18", "output": "108\n"}, {"type": "stdin_stdout", "input": "1 0 110\n11", "output": "110\n"}, {"type": "stdin_stdout", "input": "1 3 110\n18", "output": "104\n"}, {"type": "stdin_stdout", "input": "1 0 192\n16", "output": "192\n"}, {"type": "stdin_stdout", "input": "1 1 192\... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nGiven is an integer N. Find the number of digits that N has in base K.\n\n-----Notes-----\nFor information on base-K representation, see Positional notation - Wikipedia.\n\n-----Constraints-----\n - All values in input ar... | [{"type": "stdin_stdout", "input": "1000000000 2\n", "output": "30\n"}, {"type": "stdin_stdout", "input": "314159265 3\n", "output": "18\n"}, {"type": "stdin_stdout", "input": "282475249 7\n", "output": "11\n"}, {"type": "stdin_stdout", "input": "282475248 7\n", "output": "10\n"}, {"type": "stdin_stdout", "input": "282... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nAlice bought a Congo Prime Video subscription and was watching a documentary on the archaeological findings from Factor's Island on Loch Katrine in Scotland. The archaeologists found a book whose age and origin are unknow... | [{"type": "stdin_stdout", "input": "cbabacacacbabacababcabcbabacababcbcabacacacbababcbcacacbcbabcbcbabacacacabacbcbacacbcabacbcabcbabcbabababcaca\n", "output": "cabaaacbabcababcbcaacbabccaaaccbabbccaccbbabccaaaccbabcaacbcbabacbabcaaabac"}, {"type": "stdin_stdout", "input": "cbabacacacb`bacababcabcbabacababcbcabacacacba... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nAlice likes word \"nineteen\" very much. She has a string s and wants the string to contain as many such words as possible. For that reason she can rearrange the letters of the string.\n\nFor example, if she has string \"... | [{"type": "stdin_stdout", "input": "nnnnnnnnnneeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeiiiiiiiiiiiiiiiiiiiitttttttttttttttttttt\n", "output": "4\n"}, {"type": "stdin_stdout", "input": "nnnnnnnnnneeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeedeeeeeeeeeeeeeeeeiiiiiiiiiiiiiiiiiiiitttttttttttttttttttt\n", "output": "4\n"}, {"t... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nIn elementary arithmetic a \"carry\" is a digit that is transferred from one column of digits to another column of more significant digits during a calculation algorithm.\n\nThis Kata is about determining the number of ca... | [{"input": "\"1 9\\n123456789 111111101\\n01 09\\n11 09\\n123 457\"", "output": "[\"1 carry operations\\n1 carry operations\\n1 carry operations\\n1 carry operations\\n1 carry operations\"]", "fn_name": "solve"}, {"input": "\"123 457\\n123 456\\n654 312\\n999 000\\n123 457\"", "output": "[\"1 carry operations\\nNo carr... | code_functional |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nPolycarp is a big lover of killing time in social networks. A page with a chatlist in his favourite network is made so that when a message is sent to some friend, his friend's chat rises to the very top of the page. The r... | [{"type": "stdin_stdout", "input": "50\njcg\nvle\njopb\nepdb\nnkef\nfv\nxj\nufe\nfuy\noqta\ngbc\nyuz\nec\nyji\nkuux\ncwm\ntq\nnno\nhp\nzry\nxxpp\ntjvo\ngyz\nkwo\nvwqz\nyaqc\njnj\nwoav\nqcv\ndcu\ngc\nhovn\nop\nevy\ndc\ntrpu\nyb\nuzfa\npca\noq\nnhxy\nsiqu\nde\nhphy\nc\nwovu\nf\nbvv\ndsik\nlwyg\n", "output": "lwyg\ndsik\n... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nTake a sentence (string) and reverse each word in the sentence. Do not reverse the order of the words, just the letters in each word.\n\nIf there is punctuation, it should be interpreted as a regular character; no special... | [{"input": "\"The red pen wrote on the wall\"", "output": "[\"ehT der nep etorw no eht llaw\"]", "fn_name": "reverser"}, {"input": "\"Green trucks drive fast\"", "output": "[\"neerG skcurt evird tsaf\"]", "fn_name": "reverser"}, {"input": "\"Pink trucks drive slow\"", "output": "[\"kniP skcurt evird wols\"]", "fn_name"... | code_functional |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nBerland Music is a music streaming service built specifically to support Berland local artist. Its developers are currently working on a song recommendation module.\n\nSo imagine Monocarp got recommended $n$ songs, number... | [{"type": "stdin_stdout", "input": "1\n50\n1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50\n10101010101010101010101010101010101010101010101010\n", "output": "26 1 27 2 28 3 29 4 30 5 31 6 32 7 33 8 34 9 35 10 36 11 37 12 38 13 ... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nGiven an array $a$ of length $n$, tell us whether it has a non-empty subsequence such that the product of its elements is not a perfect square.\n\nA sequence $b$ is a subsequence of an array $a$ if $b$ can be obtained fro... | [{"type": "stdin_stdout", "input": "1\n69\n1 1 2 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1\n", "output": "YES\n"}, {"type": "stdin_stdout", "input": "1\n69\n1 1 2 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 1 1 1 1 1... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nYou have a large electronic screen which can display up to $998244353$ decimal digits. The digits are displayed in the same way as on different electronic alarm clocks: each place for a digit consists of $7$ segments whic... | [{"type": "stdin_stdout", "input": "1\n140047\n", "output": "7111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nTakahashi is participating in a programming contest, AXC001. He has just submitted his code to Problem A.\n\nThe problem has N test cases, all of which must be passed to get an AC verdict.\n\nTakahashi's submission has pa... | [{"type": "stdin_stdout", "input": "22 22\n", "output": "Yes\n"}, {"type": "stdin_stdout", "input": "75 75\n", "output": "Yes\n"}, {"type": "stdin_stdout", "input": "26 26\n", "output": "Yes\n"}, {"type": "stdin_stdout", "input": "45 45\n", "output": "Yes\n"}, {"type": "stdin_stdout", "input": "72 72\n", "output": "Yes... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nThere are $n$ segments on a $Ox$ axis $[l_1, r_1]$, $[l_2, r_2]$, ..., $[l_n, r_n]$. Segment $[l, r]$ covers all points from $l$ to $r$ inclusive, so all $x$ such that $l \\le x \\le r$.\n\nSegments can be placed arbitrar... | [{"type": "stdin_stdout", "input": "4\n2\n-1000000000 1000000000\n-1000000000 1000000000\n2\n-1000000000 -1\n0 1000000000\n2\n-1000000000 -1\n1 1000000000\n2\n-1000000000 1\n-1 1000000000\n", "output": "1\n1\n1\n1\n"}, {"type": "stdin_stdout", "input": "4\n2\n-1000000000 1000000000\n-1000000000 1000000000\n2\n-10000000... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nSome people leave the lights at their workplaces on when they leave that is a waste of resources. As a hausmeister of DHBW, Sagheer waits till all students and professors leave the university building, then goes and turns... | [{"type": "stdin_stdout", "input": "5 93\n00000000000000000000000000000000000000000000000000000000100000000000000000000000000000000001010\n00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000\n000000100000000000000000000000000000000000000000000000000000000000000000000000000000... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nOkabe needs bananas for one of his experiments for some strange reason. So he decides to go to the forest and cut banana trees.\n\nConsider the point (x, y) in the 2D plane such that x and y are integers and 0 ≤ x, y. The... | [{"type": "stdin_stdout", "input": "1000 10000\n", "output": "74133360011484445\n"}, {"type": "stdin_stdout", "input": "1000 10000\n", "output": "74133360011484445"}, {"type": "stdin_stdout", "input": "1581 6030\n", "output": "40628923515290265\n"}, {"type": "stdin_stdout", "input": "1061 8096\n", "output": "4428677959... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nLittle Artem likes electronics. He can spend lots of time making different schemas and looking for novelties in the nearest electronics store. The new control element was delivered to the store recently and Artem immediat... | [{"type": "stdin_stdout", "input": "5 12 1\n1 5\n", "output": "0 0 0 0 0 0 0 0 0 0 0 0\n0 0 0 0 0 0 0 0 0 0 0 0\n0 0 0 0 0 0 0 0 0 0 0 0\n0 0 0 0 0 0 0 0 0 0 0 0\n0 0 0 0 0 0 0 0 0 0 0 0\n"}, {"type": "stdin_stdout", "input": "5 10 2\n1 2\n3 1 7 5\n", "output": "0 0 0 0 0 0 5 0 0 0\n0 0 0 0 0 0 0 0 0 0\n0 0 0 0 0 0 0 0... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nIt's Galactik Football time! The Galactik Football Assosiation (GFA) has announced a football tournament between all the teams of all the planets in the galaxy.\n\nEach planet of the galaxy has a government. Some governme... | [{"type": "stdin_stdout", "input": "6 6\n1 2\n1 5\n1 3\n4 5\n5 4\n4 6\n1\n3\n-1\n2\n2\n10", "output": "0\n"}, {"type": "stdin_stdout", "input": "6 6\n1 2\n1 5\n2 2\n4 5\n5 4\n2 1\n1\n1\n5\n2\n2\n6", "output": "13\n"}, {"type": "stdin_stdout", "input": "6 6\n1 2\n2 3\n1 3\n2 5\n5 2\n4 4\n1\n2\n8\n3\n4\n6", "output": "11... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\n-----Problem description-----\nAs a holiday gift, Tojo received a probability problem. The problem read as follows\nConsider an N by M grid. Rows are numbered 1 to N, from top to bottom. Columns are numbered 1 to M, from ... | [{"type": "stdin_stdout", "input": "2\n2 2\n1 6\n", "output": "3.000000\n6.000000\n"}, {"type": "stdin_stdout", "input": "2\n2 2\n1 6", "output": "3.000000\n6.000000\n"}, {"type": "stdin_stdout", "input": "2\n-1 21\n-1 13", "output": "19.0\n11.0\n"}, {"type": "stdin_stdout", "input": "2\n0 1\n18 101", "output": "0.0\n1... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nWhen you enter 8 numbers from 0 to 9, write a program that outputs the difference between the largest integer and the smallest integer that can sort the 8 numbers. The number that can be sorted may start from 0, such as 0... | [{"type": "stdin_stdout", "input": "2\n65539010\n102034250", "output": "96417531\n543098655\n"}, {"type": "stdin_stdout", "input": "2\n124008976\n66277190", "output": "986395311\n96499431\n"}, {"type": "stdin_stdout", "input": "2\n188122632\n66277190", "output": "774098523\n96499431\n"}, {"type": "stdin_stdout", "input... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\n\"It all started with a kiss.\"\n\nChotu was up all night, planning for his first kiss. He has collected the data about all the kissing spots in Allahabad.\nAccording to his survey there are N kissing spots in the city, e... | [{"type": "stdin_stdout", "input": "3000\n23295338 17341870 1800768 4339125 24688800 393432044 128136174 69457920 300338187 37790025 358007100 138139768 27657045 3574080 4554552 2407790 358704 2701283 80503008 216417600 159893600 10268874 40697856 6444438 83200390 5617752 29905568 66617460 37598066 145330344 35650804 2... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nA dice is a cube, its faces contain distinct integers from 1 to 6 as black points. The sum of numbers at the opposite dice faces always equals 7. Please note that there are only two dice (these dices are mirror of each ot... | [{"type": "stdin_stdout", "input": "100\n3\n6 5\n1 5\n2 1\n5 1\n6 5\n5 1\n6 2\n1 2\n6 5\n5 1\n5 1\n1 5\n2 6\n6 2\n5 6\n1 2\n1 5\n5 6\n1 5\n1 2\n2 6\n1 2\n6 2\n1 5\n6 2\n2 6\n1 5\n6 2\n6 5\n5 6\n1 5\n5 6\n5 1\n5 1\n2 1\n1 2\n5 6\n6 5\n1 5\n5 1\n1 2\n1 5\n1 2\n2 6\n5 1\n2 6\n2 6\n5 6\n2 6\n6 5\n6 5\n1 5\n2 1\n5 6\n5 6\n1... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nSomeday, Drazil wanted to go on date with Varda. Drazil and Varda live on Cartesian plane. Drazil's home is located in point (0, 0) and Varda's home is located in point (a, b). In each step, he can move in a unit distance... | [{"type": "stdin_stdout", "input": "-1000000000 -1000000000 2000000000\n", "output": "Yes\n"}, {"type": "stdin_stdout", "input": "-1000000000 1000000000 2000000000\n", "output": "Yes\n"}, {"type": "stdin_stdout", "input": "-1000000000 -1000000000 1000000000\n", "output": "No\n"}, {"type": "stdin_stdout", "input": "-100... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nArkady plays Gardenscapes a lot. Arkady wants to build two new fountains. There are n available fountains, for each fountain its beauty and cost are known. There are two types of money in the game: coins and diamonds, so ... | [{"type": "stdin_stdout", "input": "52 38 22\n9 25 D\n28 29 C\n29 25 D\n4 28 D\n23 29 D\n24 25 D\n17 12 C\n11 19 C\n13 14 C\n12 15 D\n7 25 C\n2 25 C\n6 17 C\n2 20 C\n15 23 D\n8 21 C\n13 15 D\n29 15 C\n25 20 D\n22 20 C\n2 13 D\n13 22 D\n27 20 C\n1 21 D\n22 17 C\n14 21 D\n4 25 D\n5 23 C\n9 21 C\n2 20 C\n14 18 C\n29 24 C\... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nYou are given an array a. Some element of this array a_{i} is a local minimum iff it is strictly less than both of its neighbours (that is, a_{i} < a_{i} - 1 and a_{i} < a_{i} + 1). Also the element can be called local ma... | [{"type": "stdin_stdout", "input": "4\n1 5 2 5\n", "output": "2\n"}, {"type": "stdin_stdout", "input": "4\n1 5 2 1\n", "output": "1\n"}, {"type": "stdin_stdout", "input": "4\n1 7 2 1\n", "output": "1\n"}, {"type": "stdin_stdout", "input": "2\n-1 1100\n", "output": "0\n"}, {"type": "stdin_stdout", "input": "4\n1 3 2 1\n... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nYou are playing one famous sandbox game with the three-dimensional world. The map of the world can be represented as a matrix of size n × m, where the height of the cell (i, j) is a_{i, j}.\n\nYou are in the cell (1, 1) r... | [{"type": "stdin_stdout", "input": "1\n8 6\n1 2 3 4 5 6\n7 8 9 10 11 12\n13 14 15 16 17 18\n19 20 21 22 23 24\n26 27 28 29 30 31\n33 34 35 36 34 35\n37 38 39 40 41 42\n44 45 46 47 48 49\n", "output": " 141\n"}, {"type": "stdin_stdout", "input": "5\n3 4\n1 2 3 ... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nOmkar is building a waterslide in his water park, and he needs your help to ensure that he does it as efficiently as possible.\n\nOmkar currently has $n$ supports arranged in a line, the $i$-th of which has height $a_i$. ... | [{"type": "stdin_stdout", "input": "3\n4\n5 3 2 1\n5\n1 2 3 10 3\n3\n1 1 1\n", "output": "4\n7\n0\n"}, {"type": "stdin_stdout", "input": "3\n4\n5 3 2 0\n5\n1 2 3 10 3\n3\n1 1 1\n", "output": "5\n7\n0\n"}, {"type": "stdin_stdout", "input": "3\n4\n5 3 2 0\n5\n1 2 3 10 3\n3\n2 1 1\n", "output": "5\n7\n1\n"}, {"type": "std... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nIt is lunch time for Mole. His friend, Marmot, prepared him a nice game for lunch.\n\nMarmot brought Mole n ordered piles of worms such that i-th pile contains a_{i} worms. He labeled all these worms with consecutive inte... | [{"type": "stdin_stdout", "input": "5\n2 12 3 4 9\n3\n1 25 11\n", "output": "1\n5\n2\n"}, {"type": "stdin_stdout", "input": "5\n2 12 3 4 9\n3\n1 25 17\n", "output": "1\n5\n3\n"}, {"type": "stdin_stdout", "input": "5\n2 17 3 4 9\n3\n1 25 13\n", "output": "1\n4\n2\n"}, {"type": "stdin_stdout", "input": "5\n2 12 3 4 9\n3\... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nAshish has a tree consisting of $n$ nodes numbered $1$ to $n$ rooted at node $1$. The $i$-th node in the tree has a cost $a_i$, and binary digit $b_i$ is written in it. He wants to have binary digit $c_i$ written in the $... | [{"type": "stdin_stdout", "input": "10\n64 0 0\n10 0 0\n17 0 1\n90 1 1\n97 1 1\n19 1 0\n26 1 1\n95 1 1\n46 0 0\n86 0 0\n5 4\n7 1\n9 5\n6 8\n1 6\n7 5\n8 10\n3 7\n3 2\n", "output": "128"}, {"type": "stdin_stdout", "input": "10\n92 0 1\n19 1 0\n46 1 0\n53 1 0\n13 1 0\n63 0 1\n3 0 1\n67 1 0\n20 0 1\n82 0 1\n6 5\n9 1\n3 7\n... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nBertown is under siege! The attackers have blocked all the ways out and their cannon is bombarding the city. Fortunately, Berland intelligence managed to intercept the enemies' shooting plan. Let's introduce the Cartesian... | [{"type": "stdin_stdout", "input": "6 389\n0.0303\n0.7536\n0.7225\n0.2404\n0.2432\n0.57407891942809\n3\n979.9372 478.06119955606886\n469.9804 408.1158\n924.0113575468439 220.5522\n", "output": "469.98040000 7.08571971\n15409.70354778 0.00000000\n469.98040000 401.57781402\n469.98040000 107.62902712\n469.98040000 109.014... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nYou have to create a function that converts integer given as string into ASCII uppercase letters.\n\nAll ASCII characters have their numerical order in table. \n\nFor example,\n\n```\nfrom ASCII table, character of number... | [{"input": "\"84726982693273833278793270857832737832657889327984726982326765836983\"", "output": "[\"THERE IS NO FUN IN ANY OTHER CASES\"]", "fn_name": "convert"}, {"input": "\"32327332327679866932328380656769833232\"", "output": "[\" I LOVE SPACES \"]", "fn_name": "convert"}, {"input": "\"7332767375693285808069826... | code_functional |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nA-Aun's breathing\n\nProblem Statement\n\nMaeda-san and Goto-san, who will both turn 70 years old in 2060, are long-time friends and friends who fought together at the ACM-ICPC in college.\n\nThe two are still excited abo... | [{"type": "stdin_stdout", "input": "4\nA\nUn\nB\nUn", "output": "NO\n"}, {"type": "stdin_stdout", "input": "4\n@\nUn\nB\nUn", "output": "NO\n"}, {"type": "stdin_stdout", "input": "4\n@\nUn\nB\nnU", "output": "NO\n"}, {"type": "stdin_stdout", "input": "4\n@\nUn\nB\noU", "output": "NO\n"}, {"type": "stdin_stdout", "input... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nYou managed to send your friend to queue for tickets in your stead, but there is a catch: he will get there only if you tell him how much that is going to take. And everybody can only take one ticket at a time, then they ... | [{"input": "[2, 5, 3, 6, 4]\n1", "output": "[18]", "fn_name": "queue"}, {"input": "[2, 5, 3, 6, 4]\n2", "output": "[12]", "fn_name": "queue"}, {"input": "[2, 5, 3, 6, 4]\n3", "output": "[20]", "fn_name": "queue"}, {"input": "[2, 5, 3, 6, 4]\n4", "output": "[17]", "fn_name": "queue"}, {"input": "[2, 5, 3, 6, 4]\n0", "ou... | code_functional |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nCalculate the minimum number of characters you need to change in the string s, so that it contains at least k different letters, or print that it is impossible.\n\nString s consists only of lowercase Latin letters, and it... | [{"type": "stdin_stdout", "input": "smaxpqplaqqbxuqxalqmbmmgubbpspxhawbxsuqhhegpmmpebqmqpbbeplwaepxmsahuepuhuhwxeqmmlgqubuaxehwuwasgxpqmugbmuawuhwqlswllssueglbxepbmwgs\n1\n", "output": "0\n"}, {"type": "stdin_stdout", "input": "smaxpqplaqqbxuqxalqmbmmgubbpspxhawbxsuqhhegpmmpebqmqpbbeplwaepxmsahuepuhuhwxeqmmlgqubuaxehwu... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nPolycarp has a strict daily schedule. He has n alarms set for each day, and the i-th alarm rings each day at the same time during exactly one minute.\n\nDetermine the longest time segment when Polycarp can sleep, i. e. no... | [{"type": "stdin_stdout", "input": "70\n03:33\n23:36\n03:16\n18:18\n06:36\n06:58\n17:27\n04:07\n14:39\n15:53\n17:09\n05:16\n20:28\n09:34\n02:41\n14:18\n20:00\n04:14\n00:25\n20:18\n16:34\n10:13\n21:45\n11:08\n16:19\n20:50\n03:08\n05:06\n02:08\n02:51\n15:16\n11:02\n18:13\n18:35\n00:04\n08:50\n06:12\n20:16\n12:05\n04:01\n... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nYou are given two integers $l$ and $r$, $l\\le r$. Find the largest possible value of $a mod b$ over all pairs $(a, b)$ of integers for which $r\\ge a \\ge b \\ge l$.\n\nAs a reminder, $a mod b$ is a remainder we get when... | [{"type": "stdin_stdout", "input": "4\n1 1\n117772020 1000000000\n13 102\n1 1716228987\n", "output": "0\n499999999\n50\n858114493\n"}, {"type": "stdin_stdout", "input": "4\n1 1\n117772020 1010000000\n16 102\n2 1716228987\n", "output": "0\n504999999\n50\n858114493\n"}, {"type": "stdin_stdout", "input": "4\n1 1\n11777202... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nRelative B man came to A child's house. He is 3 years old and loves singing. He is singing the song \"Kobutanuki Tsuneko\" (written and composed by Naozumi Yamamoto), which he learned from kindergarten. In this song, the ... | [{"type": "stdin_stdout", "input": "5\napple\nyellow\ngeorgia\ngnik\nemail\n7\napple\nyellow\ngeorgia\nking\nemail\nwink\nlucky\n0", "output": "NG\nOK\n"}, {"type": "stdin_stdout", "input": "5\napple\nyellow\ngeorgia\ngnik\nemail\n7\napple\nzellow\ngeorgia\nking\nemail\nwink\nlucky\n0", "output": "NG\nNG\n"}, {"type": ... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nYou have a garland consisting of $n$ lamps. Each lamp is colored red, green or blue. The color of the $i$-th lamp is $s_i$ ('R', 'G' and 'B' — colors of lamps in the garland).\n\nYou have to recolor some lamps in this gar... | [{"type": "stdin_stdout", "input": "500\nBRGRRBBGGRBBRBBGGGRBGBGRGRRBRRRBGRBGBRGGGRBBRRBBBRGGBGBBBGGGRGRBBBRBGGBRGGGBRGGRBRGBBGBRRGGBGRGBGGGGGRBBRGBGGRBGGGRBRGGBBGRBBRRRGBRRBGGBGBGGGGRBGRGRRGGGBRBRRGBGGGRBRBBGBBGGBRBGBRRGGRRBGGRRRRBRGRBBBRRBGRBBGBGBRRGGBRRBBRRGGRRRBGBRBBGRRRRBGGGBRGRRBRRRRGGRBRRBBRRGRGBGRRRBRRGGBBGRRBB... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nToday you are going to lead a group of elven archers to defend the castle that is attacked by an army of angry orcs. Three sides of the castle are protected by impassable mountains and the remaining side is occupied by a ... | [{"type": "stdin_stdout", "input": "100 100 1000\n814 165 709 628 263 653 940 749 331 437 129 547 575 73 480 429 396 688 489 312 425 946 444 228 547 512 477 849 53 241 643 416 141 502 449 58 686 111 171 844 113 790 79 107 399 846 945 427 361 68 295 630 260 939 679 458 485 738 202 141 166 940 5 73 108 351 245 998 640 77... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nOne of Arkady's friends works at a huge radio telescope. A few decades ago the telescope has sent a signal $s$ towards a faraway galaxy. Recently they've received a response $t$ which they believe to be a response from al... | [{"type": "stdin_stdout", "input": "01\nzbrronwaofovklkopelo\n", "output": "19\n"}, {"type": "stdin_stdout", "input": "01\nzbrronwaofovklkopelo\n", "output": "19\n"}, {"type": "stdin_stdout", "input": "01\nzbrronwaofovklkopeln\n", "output": "19\n"}, {"type": "stdin_stdout", "input": "01\nzbrrnnwaofovklkopeln\n", "outpu... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nТри брата договорились о встрече. Пронумеруем братьев следующим образом: пусть старший брат имеет номер 1, средний брат имеет номер 2, а младший брат — номер 3. \n\nКогда пришло время встречи, один из братьев опоздал. По ... | [{"type": "stdin_stdout", "input": "3 1\n", "output": "2\n"}, {"type": "stdin_stdout", "input": "2 1\n", "output": "3\n"}, {"type": "stdin_stdout", "input": "2 3\n", "output": "1\n"}, {"type": "stdin_stdout", "input": "1 2\n", "output": "3\n"}, {"type": "stdin_stdout", "input": "1 3\n", "output": "2\n"}, {"type": "stdi... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nA permutation of length $n$ 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": "3\n2\n1 2\n6\n0 0 3 10 4 3\n5\n3 6 3 1 10\n", "output": "2 1\n3 4 10 3 0 0\n10 1 3 6 3\n"}, {"type": "stdin_stdout", "input": "3\n2\n1 2\n6\n0 1 10 5 4 3\n5\n2 6 3 1 10\n", "output": "2 1\n3 4 5 10 1 0\n10 1 3 6 2\n"}, {"type": "stdin_stdout", "input": "3\n2\n1 2\n6\n2 1 6 5 4 3\n5\n... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nTakahashi's house has only one socket.\nTakahashi wants to extend it with some number of power strips, each with A sockets, into B or more empty sockets.\nOne power strip with A sockets can extend one empty socket into A ... | [{"type": "stdin_stdout", "input": "13 17\n", "output": "2\n"}, {"type": "stdin_stdout", "input": "10 19\n", "output": "2\n"}, {"type": "stdin_stdout", "input": "20 19\n", "output": "1\n"}, {"type": "stdin_stdout", "input": "2 20\n", "output": "19\n"}, {"type": "stdin_stdout", "input": "4 10\n", "output": "3\n"}, {"typ... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nTakayuki and Kazuyuki are good twins, but their behavior is exactly the opposite. For example, if Takayuki goes west, Kazuyuki goes east, and if Kazuyuki goes north, Takayuki goes south. Currently the two are in a departm... | [{"type": "stdin_stdout", "input": "6 6\n2 4\n6 2\n0 0 0 0 1 0\n0 1 1 0 0 0\n0 1 0 0 0 0\n0 0 0 1 0 0\n0 0 0 0 0 1\n0 0 0 0 0 0\n3 3\n1 1\n3 3\n0 0 0\n0 1 0\n0 0 0\n0 0", "output": "3\nNA\n"}, {"type": "stdin_stdout", "input": "6 6\n2 4\n6 2\n0 0 0 0 1 0\n0 1 0 0 1 0\n0 1 0 0 0 0\n0 1 0 1 1 0\n0 0 0 0 0 1\n0 0 0 0 0 0\... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nThere is a forest that we model as a plane and live $n$ rare animals. Animal number $i$ has its lair in the point $(x_{i}, y_{i})$. In order to protect them, a decision to build a nature reserve has been made.\n\nThe rese... | [{"type": "stdin_stdout", "input": "20\n7571542 9868879\n3634934 5986987\n2297651 5538795\n9701582 8250721\n-2913168 4968483\n8838674 5771883\n-3348778 8326335\n-577797 750161\n-7223138 9113512\n-1808146 6044926\n-756446 417388\n4700417 1550148\n-5568937 20029\n-9170707 6103893\n7445655 7161843\n8820510 4145867\n-44669... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nAnd again a misfortune fell on Poor Student. He is being late for an exam.\n\nHaving rushed to a bus stop that is in point (0, 0), he got on a minibus and they drove along a straight line, parallel to axis OX, in the dire... | [{"type": "stdin_stdout", "input": "94 2 1\n0 5000 5001 5002 5003 5004 5005 5006 5007 5008 5009 5010 5011 5012 5013 5014 5015 5016 5017 5018 5019 5020 5021 5022 5023 5024 5025 5026 5027 5028 5029 5030 5031 5032 5033 5034 5035 5036 5037 5038 5040 5041 5042 5043 5044 5045 5046 5047 5048 5049 5050 5051 5052 5053 5054 5055... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nTaro and Hanako decided to play hit-and-blow. The hit-and-blow rules are as follows.\n\n* Separated into questioners and respondents.\n* The questioner decides a 4-digit number (correct answer) that does not include dupli... | [{"type": "stdin_stdout", "input": "1234 10660\n1234 1354\n1234 1234\n1230 1023\n0123 1234\n0 0", "output": "1 0\n2 1\n4 0\n1 3\n0 3\n"}, {"type": "stdin_stdout", "input": "1234 10660\n1964 1354\n1234 1234\n1230 1023\n0123 1234\n0 0", "output": "1 0\n2 0\n4 0\n1 3\n0 3\n"}, {"type": "stdin_stdout", "input": "1234 10660... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nAnton likes to play chess, and so does his friend Danik.\n\nOnce they have played n games in a row. For each game it's known who was the winner — Anton or Danik. None of the games ended with a tie.\n\nNow Anton wonders, w... | [{"type": "stdin_stdout", "input": "379\nAADAAAAAADDAAAAAADAADADADDAAAAADADDAADAAAADDDADAAAAAAADAADAAAAAAADAAAAAAAAADAAAAAAADAAAAAAAAAAADDDADAAAAAAAADAADADAAAADAAAAAAAAAAAAAAAAADAAAADDDAADAAAAAAADAAADAAADAADDDADDAAADAAAAAADDDADDDAAADAAAADAAAAAAAAADAAADAAAAAAAAADAAAAAAAAAAAAAAAAAADADAAAAAAAAAAADAAAAADAAAADAAAAAAAAAAAAAD... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nA string is called beautiful if no two consecutive characters are equal. For example, \"ababcb\", \"a\" and \"abab\" are beautiful strings, while \"aaaaaa\", \"abaa\" and \"bb\" are not.\n\nAhcl wants to construct a beaut... | [{"type": "stdin_stdout", "input": "23\n?\n??\n???\n????\n????\n?a\n?b\n?c\na?\nb?\nc?\n?a?\n?b?\n?c?\na?a\na?b\na?c\nb?a\nb?b\nb?c\nc?a\nc?b\nc?c\n", "output": "a\nab\naba\nabab\nabab\nba\nab\nac\nab\nba\nca\nbab\naba\naca\naba\nacb\nabc\nbca\nbab\nbac\ncba\ncab\ncac\n"}, {"type": "stdin_stdout", "input": "23\n?\n??\n... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nLet us consider a grid of squares with 10^9 rows and N columns. Let (i, j) be the square at the i-th column (1 \\leq i \\leq N) from the left and j-th row (1 \\leq j \\leq 10^9) from the bottom.\n\nSnuke has cut out some ... | [{"type": "stdin_stdout", "input": "9\n17 18 51 18 28 45 112 45 23", "output": "917046249"}, {"type": "stdin_stdout", "input": "9\n17 18 51 18 34 45 112 45 23", "output": "938229436"}, {"type": "stdin_stdout", "input": "9\n17 18 51 18 34 45 190 45 23", "output": "353713429"}, {"type": "stdin_stdout", "input": "9\n17 18... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nYou are given a digital clock with $n$ digits. Each digit shows an integer from $0$ to $9$, so the whole clock shows an integer from $0$ to $10^n-1$. The clock will show leading zeroes if the number is smaller than $10^{n... | [{"type": "stdin_stdout", "input": "7\n3\n007\n4\n1000\n5\n00000\n3\n153\n4\n1247\n9\n123456789\n30\n001678294039710047203946100020\n", "output": "7\n2\n0\n11\n17\n53\n115\n"}, {"type": "stdin_stdout", "input": "7\n3\n007\n4\n1000\n5\n00000\n3\n153\n4\n1293\n9\n123456789\n30\n001678294039710047203946100020\n", "output"... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nWe have a string X, which has an even number of characters. Half the characters are `S`, and the other half are `T`.\n\nTakahashi, who hates the string `ST`, will perform the following operation 10^{10000} times:\n\n* Amo... | [{"type": "stdin_stdout", "input": "SSTTTSST", "output": "2\n"}, {"type": "stdin_stdout", "input": "TTTTSSSS", "output": "8\n"}, {"type": "stdin_stdout", "input": "TSSTTSST", "output": "2\n"}, {"type": "stdin_stdout", "input": "TTSTSSST", "output": "4\n"}, {"type": "stdin_stdout", "input": "SSTTSTST", "output": "0\n"},... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nImplement a function which behaves like the 'uniq -c' command in UNIX. \n\nIt takes as input a sequence and returns a sequence in which all duplicate elements following each other have been reduced to one instance togethe... | [{"input": "[\"a\", \"a\", \"b\", \"b\", \"c\", \"a\", \"b\", \"c\"]", "output": "[[[\"a\", 2], [\"b\", 2], [\"c\", 1], [\"a\", 1], [\"b\", 1], [\"c\", 1]]]", "fn_name": "uniq_c"}, {"input": "[\"a\", \"a\", \"a\", \"b\", \"b\", \"b\", \"c\", \"c\", \"c\"]", "output": "[[[\"a\", 3], [\"b\", 3], [\"c\", 3]]]", "fn_name":... | code_functional |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nAn expedition group flew from planet ACM-1 to Earth in order to study the bipedal species (its representatives don't even have antennas on their heads!).\n\nThe flying saucer, on which the brave pioneers set off, consists... | [{"type": "stdin_stdout", "input": "1050034174 1181487066\n", "output": "544888754\n"}, {"type": "stdin_stdout", "input": "880162386 1131317357\n", "output": "508228391\n"}, {"type": "stdin_stdout", "input": "1511923181 994962872\n", "output": "797030938\n"}, {"type": "stdin_stdout", "input": "596386879 1071021379\n", ... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nMaxim has opened his own restaurant! The restaurant has got a huge table, the table's length is p meters.\n\nMaxim has got a dinner party tonight, n guests will come to him. Let's index the guests of Maxim's restaurant fr... | [{"type": "stdin_stdout", "input": "50\n15 28 34 29 17 21 20 34 37 17 10 20 37 10 18 25 31 25 16 1 37 27 39 3 5 18 2 32 10 35 20 17 29 20 3 29 3 25 9 32 37 5 25 23 25 33 35 8 31 29\n39\n", "output": "1.499798753"}, {"type": "stdin_stdout", "input": "50\n15 28 34 29 17 21 20 34 37 17 10 20 37 10 18 25 31 25 16 1 37 27 3... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nAll space-time unified dimension sugoroku tournament. You are representing the Earth in the 21st century in the tournament, which decides only one Sugoroku absolute champion out of more than 500 trillion participants.\n\n... | [{"type": "stdin_stdout", "input": "12\n0\n-1\n7\n0\n2\n-1\n-1\n3\n-10\n-2\n1\n0", "output": "1\n"}, {"type": "stdin_stdout", "input": "12\n0\n-1\n7\n0\n2\n0\n-1\n3\n-10\n-2\n1\n0", "output": "1\n"}, {"type": "stdin_stdout", "input": "12\n0\n-1\n7\n0\n2\n0\n-2\n3\n-10\n-2\n1\n0", "output": "1\n"}, {"type": "stdin_stdou... | code_stdio |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.