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\nThe __Hamming weight__ of a string is the number of symbols that are different from the zero-symbol of the alphabet used. There are several algorithms for efficient computing of the Hamming weight for numbers. In this Kat... | [{"input": "2048", "output": "[1]", "fn_name": "hamming_weight"}, {"input": "10", "output": "[2]", "fn_name": "hamming_weight"}, {"input": "21", "output": "[3]", "fn_name": "hamming_weight"}, {"input": "0", "output": "[0]", "fn_name": "hamming_weight"}, {"input": "1", "output": "[1]", "fn_name": "hamming_weight"}, {"in... | code_functional |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nTraining is indispensable for achieving good results at ICPC. Rabbit wants to win at ICPC, so he decided to practice today as well.\n\nToday's training is to gain dexterity that never mistypes by carefully stacking blocks... | [{"type": "stdin_stdout", "input": "3\n10 40\n15 40\n20 30", "output": "110\n"}, {"type": "stdin_stdout", "input": "3\n10 40\n15 40\n40 30", "output": "120\n"}, {"type": "stdin_stdout", "input": "3\n10 40\n15 40\n20 32", "output": "112\n"}, {"type": "stdin_stdout", "input": "3\n10 36\n15 40\n20 32", "output": "108\n"},... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\n# Task\n Smartphones software security has become a growing concern related to mobile telephony. It is particularly important as it relates to the security of available personal information.\n \n For this reason, Ahmed de... | [{"input": "\"4334\"", "output": "[\"impossible\"]", "fn_name": "decrypt"}, {"input": "\"123456\"", "output": "[\"738496\"]", "fn_name": "decrypt"}, {"input": "\"353\"", "output": "[\"123\"]", "fn_name": "decrypt"}, {"input": "\"444\"", "output": "[\"404\"]", "fn_name": "decrypt"}, {"input": "\"147\"", "output": "[\"37... | code_functional |
[
{
"content": "Solve the following coding problem using the programming language python:\n\n\"What are your shoe sizes?\"\n\nSuddenly, the doctor asked me when I met him for the first time.\n\n\"It's 23.5\"\n\"Oh, that's a really nice number. It's 2 to the 4th power plus 2 to the 2nd power, 2 to the 1st power, 2... | [{"type": "stdin_stdout", "input": "27.100228165013633\n158.95452966627283\n-0.21569613349567962", "output": "NA\nNA\n"}, {"type": "stdin_stdout", "input": "27.432484603703674\n158.95452966627283\n-0.21569613349567962", "output": "NA\nNA\n"}, {"type": "stdin_stdout", "input": "27.932276079901406\n158.95452966627283\n-0... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\n# Task\n Consider the following algorithm for constructing 26 strings S(1) .. S(26):\n```\nS(1) = \"a\";\nFor i in [2, 3, ..., 26]:\nS(i) = S(i - 1) + character(i) + S(i - 1).```\n\n For example:\n```\nS(1) = \"a\"\nS(2) ... | [{"input": "12", "output": "[\"c\"]", "fn_name": "abacaba"}, {"input": "16", "output": "[\"e\"]", "fn_name": "abacaba"}, {"input": "1", "output": "[\"a\"]", "fn_name": "abacaba"}, {"input": "2", "output": "[\"b\"]", "fn_name": "abacaba"}, {"input": "3", "output": "[\"a\"]", "fn_name": "abacaba"}, {"input": "4", "output... | code_functional |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nSlime and his $n$ friends are at a party. Slime has designed a game for his friends to play.\n\nAt the beginning of the game, the $i$-th player has $a_i$ biscuits. At each second, Slime will choose a biscuit randomly unif... | [{"type": "stdin_stdout", "input": "100\n4364 698 1003 1128 1513 39 4339 969 7452 3415 1154 1635 6649 136 1442 50 834 1680 107 978 983 3176 4017 1692 1113 1504 1118 396 1975 2053 2366 3022 3007 167 610 4649 14659 2331 4565 318 7232 204 7131 6122 2885 5748 1998 3833 6799 4219 8454 8698 4964 1736 1554 1665 2425 4227 1967... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nПоликарп мечтает стать программистом и фанатеет от степеней двойки. Среди двух чисел ему больше нравится то, которое делится на большую степень числа 2. \n\nПо заданной последовательности целых положительных чисел a_1, a_... | [{"type": "stdin_stdout", "input": "100\n1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 ... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nYou certainly can tell which is the larger number between 2^(10) and 2^(15).\n\nBut what about, say, 2^(10) and 3^(10)? You know this one too.\n\nThings tend to get a bit more complicated with **both** different bases and... | [{"input": "[1024, 97]\n[1024, 81]", "output": "[-1]", "fn_name": "compare_powers"}, {"input": "[34, 98]\n[51, 67]", "output": "[-1]", "fn_name": "compare_powers"}, {"input": "[2, 100]\n[2, 150]", "output": "[1]", "fn_name": "compare_powers"}, {"input": "[2, 100]\n[3, 100]", "output": "[1]", "fn_name": "compare_powers"... | code_functional |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nZS the Coder is playing a game. There is a number displayed on the screen and there are two buttons, ' + ' (plus) and '<image>' (square root). Initially, the number 2 is displayed on the screen. There are n + 1 levels in ... | [{"type": "stdin_stdout", "input": "7816\n", "output": "2\n17\n46\n97\n176\n289\n442\n641\n892\n1201\n1574\n2017\n2536\n3137\n3826\n4609\n5492\n6481\n7582\n8801\n10144\n11617\n13226\n14977\n16876\n18929\n21142\n23521\n26072\n28801\n31714\n34817\n38116\n41617\n45326\n49249\n53392\n57761\n62362\n67201\n72284\n77617\n8320... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\n[Run-length encoding](http://en.wikipedia.org/wiki/Run-length_encoding) (RLE) is a very simple form of lossless data compression in which runs of data are stored as a single data value and count.\n\nA simple form of RLE w... | [{"input": "\"QQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQ... | code_functional |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nPetya loves lucky numbers. We all know that lucky numbers are the positive integers whose decimal representations contain only the lucky digits 4 and 7. For example, numbers 47, 744, 4 are lucky and 5, 17, 467 are not.\n\... | [{"type": "stdin_stdout", "input": "544958\n", "output": "4477777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nDr. A of the Aizu Institute of Biological Research discovered a mysterious insect on a certain southern island. The shape is elongated like a hornworm, but since one segment is shaped like a ball, it looks like a beaded b... | [{"type": "stdin_stdout", "input": "rbgrg\nbbbrbgr\nrbg\nrgbbrgrb\nrrgbgrggb\nggrgbrbggr\nrrrrr\nbgbr\n0", "output": "5\n7\n1\n6\nNA\n11\n0\n4\n"}, {"type": "stdin_stdout", "input": "grgbr\nrbbgbbr\nbgr\nbgbrrgbr\nbggrgbgrr\ngggbrggrbr\nrrrrr\nbgbr\n0", "output": "5\n7\n1\n9\nNA\n11\n0\n4\n"}, {"type": "stdin_stdout", ... | 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\nAfter IOI Ilya decided to make a business. He found a social network called \"TheScorpyBook.com\". It currently has N registered users. As in any soci... | [{"type": "stdin_stdout", "input": "4\n1111\n1000\n1000\n1000", "output": "6\n"}, {"type": "stdin_stdout", "input": "4\n0111\n1100\n0000\n1001", "output": "2\n"}, {"type": "stdin_stdout", "input": "4\n1111\n1010\n1000\n1010", "output": "4\n"}, {"type": "stdin_stdout", "input": "4\n0011\n0000\n0000\n1001", "output": "0\... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nPetr stands in line of n people, but he doesn't know exactly which position he occupies. He can say that there are no less than a people standing in front of him and no more than b people standing behind him. Find the num... | [{"type": "stdin_stdout", "input": "100 81 58\n", "output": "19\n"}, {"type": "stdin_stdout", "input": "100 81 54\n", "output": "19\n"}, {"type": "stdin_stdout", "input": "100 81 91\n", "output": "19"}, {"type": "stdin_stdout", "input": "100 11 88\n", "output": "89"}, {"type": "stdin_stdout", "input": "59 12 33\n", "ou... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nWe have a sequence of N \\times K integers: X=(X_0,X_1,\\cdots,X_{N \\times K-1}). Its elements are represented by another sequence of N integers: A=(A_0,A_1,\\cdots,A_{N-1}). For each pair i, j (0 \\leq i \\leq K-1,\\ 0 ... | [{"type": "stdin_stdout", "input": "11 97\n0 1 8 2 5 4 2 6 2 3 5", "output": "0 1 8 6 2 3 5\n"}, {"type": "stdin_stdout", "input": "11 47\n0 1 0 3 10 5 1 36 2 2 0", "output": "10 5 1 36 0\n"}, {"type": "stdin_stdout", "input": "11 101\n0 2 4 1 5 4 4 6 0 3 5", "output": "2 4 6 0 3 5\n"}, {"type": "stdin_stdout", "input"... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\n```if-not:julia,racket\nWrite a function that returns the total surface area and volume of a box as an array: `[area, volume]`\n```\n```if:julia\nWrite a function that returns the total surface area and volume of a box as... | [{"input": "10\n10\n10", "output": "[[600, 1000]]", "fn_name": "get_size"}, {"input": "4\n2\n6", "output": "[[88, 48]]", "fn_name": "get_size"}, {"input": "1\n2\n1", "output": "[[10, 2]]", "fn_name": "get_size"}, {"input": "1\n2\n2", "output": "[[16, 4]]", "fn_name": "get_size"}, {"input": "1\n1\n1", "output": "[[6, 1]... | code_functional |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nTakahashi will take part in an eating contest. Teams of N members will compete in this contest, and Takahashi's team consists of N players numbered 1 through N from youngest to oldest. The consumption coefficient of Membe... | [{"type": "stdin_stdout", "input": "11 14\n3 1 4 1 0 9 0 20 1 2 10\n15 6 7 26 3 2 3 8 4 8 2", "output": "20\n"}, {"type": "stdin_stdout", "input": "11 14\n3 1 4 1 0 9 0 20 1 2 10\n15 6 7 26 3 4 3 8 4 8 2", "output": "22\n"}, {"type": "stdin_stdout", "input": "11 14\n3 1 4 1 2 9 2 11 1 3 10\n15 9 7 26 3 2 3 8 4 8 2", "o... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nYou are given two integers $n$ and $m$ ($m < n$). Consider a convex regular polygon of $n$ vertices. Recall that a regular polygon is a polygon that is equiangular (all angles are equal in measure) and equilateral (all si... | [{"type": "stdin_stdout", "input": "2\n69 120\n11 9\n", "output": "NO\nNO\n"}, {"type": "stdin_stdout", "input": "2\n34 230\n4 15\n", "output": "NO\nNO\n"}, {"type": "stdin_stdout", "input": "2\n34 230\n4 27\n", "output": "NO\nNO\n"}, {"type": "stdin_stdout", "input": "2\n11 101\n13 4\n", "output": "NO\nNO\n"}, {"type"... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nArkady decided to buy roses for his girlfriend.\n\nA flower shop has white, orange and red roses, and the total amount of them is n. Arkady thinks that red roses are not good together with white roses, so he won't buy a b... | [{"type": "stdin_stdout", "input": "30 15\n7926 577 5009 7237 4395 3239 8994 4429 8126 2925 139 320 4442 3397 1292 2800 9505 6043 5946 8058 4031 6871 4689 1977 73 440 5320 5290 4707 387\nOOWOWWORRWOWORWRRRRWORROOWWROW\n", "output": "91633\n"}, {"type": "stdin_stdout", "input": "30 15\n7926 577 5009 7237 4395 3239 8994 ... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nYou are given two integers $a$ and $b$. Moreover, you are given a sequence $s_0, s_1, \\dots, s_{n}$. All values in $s$ are integers $1$ or $-1$. It's known that sequence is $k$-periodic and $k$ divides $n+1$. In other wo... | [{"type": "stdin_stdout", "input": "904132655 827386249 118827660 334\n+++-+++++--+++----+-+-+-+-+--+-+---++--++--++--+-+-+++-+++--+-+-+----+-+-++++-----+--++++------+++-+-+-++-++++++++-+-++-+++--+--++------+--+-+++--++--+---++-++-+-+-++---++-++--+-+-++-+------+-+----+++-+++--+-+-+--+--+--+------+--+---+--+-++--+++---+... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nA one-dimensional Japanese crossword can be represented as a binary string of length x. An encoding of this crossword is an array a of size n, where n is the number of segments formed completely of 1's, and a_{i} is the l... | [{"type": "stdin_stdout", "input": "10 1\n5 78 3 87 4 9 5 8 9 1235\n", "output": "NO\n"}, {"type": "stdin_stdout", "input": "10 1\n5 78 3 87 4 9 5 8 9 1235\n", "output": "NO\n"}, {"type": "stdin_stdout", "input": "10 1\n5 24 3 87 4 9 5 8 9 1235\n", "output": "NO\n"}, {"type": "stdin_stdout", "input": "10 1\n5 24 3 0 4 ... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nYou are given an undirected unweighted graph with N vertices and M edges that contains neither self-loops nor double edges.\n\nHere, a self-loop is an edge where a_i = b_i (1≤i≤M), and double edges are two edges where (a_... | [{"type": "stdin_stdout", "input": "8 28\n1 2\n1 3\n1 4\n1 5\n1 6\n1 7\n1 8\n2 3\n2 4\n2 5\n2 6\n2 7\n2 8\n3 4\n3 5\n3 6\n3 7\n3 8\n4 5\n4 6\n4 7\n4 8\n5 6\n5 7\n5 8\n6 7\n6 8\n7 8\n", "output": "5040\n"}, {"type": "stdin_stdout", "input": "8 27\n1 2\n1 3\n1 4\n1 5\n1 6\n1 7\n1 8\n2 3\n2 4\n2 5\n2 6\n2 7\n3 4\n3 5\n3 6... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nExample\n\nInput\n\nmmemewwemeww\n\n\nOutput\n\nCat\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": "mmemwweemeww", "output": "Rabbit\n"}, {"type": "stdin_stdout", "input": "wwemeewwmemm", "output": "Rabbit\n"}, {"type": "stdin_stdout", "input": "mmemwweeneww", "output": "Rabbit\n"}, {"type": "stdin_stdout", "input": "mnemwweeneww", "output": "Rabbit\n"}, {"type": "stdin_stdout", "i... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nDevu has an array A consisting of N positive integers. He would like to perform following operation on array.\n\n- Pick some two elements a, b in the array (a could be same as b, but their corresponding indices in the arr... | [{"type": "stdin_stdout", "input": "2 4\n1 18\n1\n2\n5\n4", "output": "Yes\nYes\nYes\nYes\n"}, {"type": "stdin_stdout", "input": "2 4\n1 3\n1\n2\n3\n4\n", "output": "Yes\nYes\nYes\nNo\n"}, {"type": "stdin_stdout", "input": "2 4\n1 3\n1\n2\n3\n3", "output": "Yes\nYes\nYes\nYes\n"}, {"type": "stdin_stdout", "input": "2 4... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nYou've come to your favorite store Infinitesco to buy some ice tea.\n\nThe store sells ice tea in bottles of different volumes at different costs. Specifically, a 0.25-liter bottle costs Q yen, a 0.5-liter bottle costs H ... | [{"type": "stdin_stdout", "input": "12345678 87654321 12345678 87654321\n226515686", "output": "2796489721305108\n"}, {"type": "stdin_stdout", "input": "12345678 87654321 12873114 87654321\n226515686", "output": "2915962248666204\n"}, {"type": "stdin_stdout", "input": "12345678 87654321 12345678 87654321\n123456789", "... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nThe Physical education teacher at SESC is a sort of mathematician too. His most favorite topic in mathematics is progressions. That is why the teacher wants the students lined up in non-decreasing height form an arithmeti... | [{"type": "stdin_stdout", "input": "100\n246 485 -940 -186 -841 -98 711 429 -154 164 -244 -111 886 -447 22 480 224 -132 927 812 -243 -152 -843 403 -320 -346 -407 827 645 -903 -172 540 -359 498 270 18 374 -52 -983 -164 -707 -242 -159 -825 -889 661 -629 212 849 -891 -622 810 957 897 -110 -293 -257 822 690 369 -914 212 -3... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nPeter can see a clock in the mirror from the place he sits in the office.\nWhen he saw the clock shows 12:22\n\n\n\n1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n\n\n\n\nHe knows that the time is 11:38\n\n\n\n1\n2\n3\n4\n5\n6\n7... | [{"input": "\"06:35\"", "output": "[\"05:25\"]", "fn_name": "what_is_the_time"}, {"input": "\"11:59\"", "output": "[\"12:01\"]", "fn_name": "what_is_the_time"}, {"input": "\"12:02\"", "output": "[\"11:58\"]", "fn_name": "what_is_the_time"}, {"input": "\"04:00\"", "output": "[\"08:00\"]", "fn_name": "what_is_the_time"},... | code_functional |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nYou are given a non-empty string s=s_1s_2... s_n, which consists only of lowercase Latin letters. Polycarp does not like a string if it contains at least one string \"one\" or at least one string \"two\" (or both at the s... | [{"type": "stdin_stdout", "input": "10\nonetwonetwooneooonetwooo\ntwo\none\ntwooooo\nttttwo\nttwwoo\neoono\nonnne\noneeeee\noneeeeeeetwooooo\n", "output": "6\n2 6 10 13 18 21 \n1\n2 \n1\n2 \n1\n2 \n1\n5 \n0\n\n0\n\n0\n\n1\n2 \n2\n2 11 \n"}, {"type": "stdin_stdout", "input": "10\nonetwonetwooneooonetwooo\nuwo\none\ntwoo... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nGiven an integer N, find the base -2 representation of N.\nHere, S is the base -2 representation of N when the following are all satisfied:\n - S is a string consisting of 0 and 1.\n - Unless S = 0, the initial character ... | [{"type": "stdin_stdout", "input": "-1000000000\n", "output": "11000101101001010100101000000000\n"}, {"type": "stdin_stdout", "input": "-790013317\n", "output": "11010001001111101010111110001111\n"}, {"type": "stdin_stdout", "input": "1000000000\n", "output": "1001100111011111101111000000000\n"}, {"type": "stdin_stdout... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nLittle Vasya has received a young builder’s kit. The kit consists of several wooden bars, the lengths of all of them are known. The bars can be put one on the top of the other if their lengths are the same.\n\nVasya wants... | [{"type": "stdin_stdout", "input": "123\n112 277 170 247 252 115 157 293 256 143 196 90 12 164 164 42 8 223 167 109 175 232 239 111 148 51 9 254 93 32 268 162 231 91 47 162 161 191 195 145 247 292 129 199 230 94 144 217 18 205 176 20 143 198 121 243 211 262 230 277 195 255 108 290 220 275 158 2 286 200 60 267 278 207 1... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nTreeland is a country in which there are n towns connected by n - 1 two-way road such that it's possible to get from any town to any other town. \n\nIn Treeland there are 2k universities which are located in different tow... | [{"type": "stdin_stdout", "input": "35 15\n6 12 32 18 11 10 29 9 30 27 31 14 8 24 28 25 19 15 21 3 4 1 33 22 23 17 16 13 7 2\n1 2\n20 3\n1 4\n20 5\n20 6\n1 7\n13 8\n4 9\n1 10\n1 11\n1 12\n1 13\n18 14\n10 15\n1 16\n16 17\n1 18\n1 19\n1 20\n20 21\n1 22\n27 23\n25 24\n1 25\n20 26\n20 27\n18 28\n4 29\n13 30\n4 31\n1 32\n20... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nMonocarp is playing a computer game. He's going to kill $n$ monsters, the $i$-th of them has $h_i$ health.\n\nMonocarp's character has two spells, either of which he can cast an arbitrary number of times (possibly, zero) ... | [{"type": "stdin_stdout", "input": "1\n43\n1 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": "22\n"}, {"type": "stdin_stdout", "input": "1\n30\n1 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": "15\n"}, {"type": "stdin_stdout", "input": "3\n4\n1 ... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nFor this kata, you are given three points ```(x1,y1,z1)```, ```(x2,y2,z2)```, and ```(x3,y3,z3)``` that lie on a straight line in 3-dimensional space.\nYou have to figure out which point lies in between the other two.\n\n... | [{"input": "0.25\n0.5\n0.75\n3.25\n-0.5\n-0.25\n1.0\n0.25\n0.5", "output": "[3]", "fn_name": "middle_point"}, {"input": "-1\n0\n2\n-2\n4\n-1\n-3\n8\n-4", "output": "[2]", "fn_name": "middle_point"}, {"input": "0\n2\n0\n6\n-2\n8\n3\n0\n4", "output": "[3]", "fn_name": "middle_point"}, {"input": "1\n0\n4\n5\n0\n6\n-7\n0\n... | code_functional |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nMad scientist Mike has just finished constructing a new device to search for extraterrestrial intelligence! He was in such a hurry to launch it for the first time that he plugged in the power wires without giving it a pro... | [{"type": "stdin_stdout", "input": "+--+--+------+++++++-+-+++--++---+--+-+---+--+++-+++-------+++++-+-++++--+-+-+++++++----+----+++----+-+++-+++-----+++-+-++-+-+++++-+--++----+--+-++-----+-+-++++---+++---+-+-+-++++--+--+++---+++++-+---+-----+++-++--+++---++-++-+-+++-+-+-+---+++--+--++++-+-+--++-------+--+---++-----+++... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nNick has n bottles of soda left after his birthday. Each bottle is described by two values: remaining amount of soda a_{i} and bottle volume b_{i} (a_{i} ≤ b_{i}).\n\nNick has decided to pour all remaining soda into minim... | [{"type": "stdin_stdout", "input": "90\n4 2 21 69 53 39 2 2 8 58 7 5 2 82 7 9 13 10 2 44 1 7 2 1 50 42 36 17 14 46 19 1 50 20 51 46 9 59 73 61 76 4 19 22 1 43 53 2 5 5 32 7 5 42 30 14 32 6 6 15 20 24 13 8 5 19 9 9 7 20 7 2 55 36 5 33 64 20 22 22 9 30 67 38 68 2 13 19 2 9\n48 4 39 85 69 70 11 42 65 77 61 6 60 84 67 15 9... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nMike is the president of country What-The-Fatherland. There are n bears living in this country besides Mike. All of them are standing in a line and they are numbered from 1 to n from left to right. i-th bear is exactly a_... | [{"type": "stdin_stdout", "input": "20\n452405440 586588704 509061481 392584366 16115810 148658854 66743034 290624691 677780684 519361360 208050516 401554301 954478790 989443769 387546138 832279893 1081316002 80960260 846049648 588066499\n", "output": "1081316002 954478790 452405440 392584366 387546138 387546138 208050... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nAdilbek's house is located on a street which can be represented as the OX axis. This street is really dark, so Adilbek wants to install some post lamps to illuminate it. Street has $n$ positions to install lamps, they cor... | [{"type": "stdin_stdout", "input": "20 16 16\n1 2 3 4 5 6 8 9 10 11 13 14 15 16 18 19\n2 1 1 1 1 1 3 3 2 2 1 3 3 3 3 2\n", "output": "3\n"}, {"type": "stdin_stdout", "input": "20 16 16\n1 2 3 4 5 6 8 9 10 11 13 14 15 16 18 19\n2 1 1 1 1 1 3 3 2 2 1 3 3 3 3 2\n", "output": "3\n"}, {"type": "stdin_stdout", "input": "20 1... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nIf the girl doesn't go to Denis, then Denis will go to the girl. Using this rule, the young man left home, bought flowers and went to Nastya. \n\nOn the way from Denis's house to the girl's house is a road of $n$ lines. T... | [{"type": "stdin_stdout", "input": "30 8\n0 1 7 10 23 24 26 30\n40 13\n", "output": "30\n"}, {"type": "stdin_stdout", "input": "30 8\n0 1 7 10 23 24 26 30\n40 7\n", "output": "30\n"}, {"type": "stdin_stdout", "input": "30 8\n0 1 7 12 23 24 26 30\n40 7\n", "output": "30\n"}, {"type": "stdin_stdout", "input": "30 8\n0 2 ... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nSnuke has an integer sequence A of length N.\nHe will make three cuts in A and divide it into four (non-empty) contiguous subsequences B, C, D and E.\nThe positions of the cuts can be freely chosen.\nLet P,Q,R,S be the su... | [{"type": "stdin_stdout", "input": "5574\n150872158 2 6 1 3 8 10 4 9 3 5 2 10 2 8 4 2 3 10 8 4 3 1 8 3 5 8 3 7 3 10 7 4 6 1 1 8 10 1 1 10 9 7 9 1 3 7 7 8 6 7 8 6 10 5 2 1 2 2 2 6 10 3 6 6 2 8 1 9 3 6 8 10 10 5 1 8 4 5 1 6 2 7 7 5 3 6 10 6 9 2 9 9 10 1 10 9 10 5 3 10 8 6 10 2 3 1 7 2 7 2 5 8 7 10 3 10 4 1 2 2 1 2 9 2 3 ... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nA sequence of $n$ numbers is called a permutation if it contains all integers from $1$ to $n$ exactly once. For example, the sequences [$3, 1, 4, 2$], [$1$] and [$2,1$] are permutations, but [$1,2,1$], [$0,1$] and [$1,3,4... | [{"type": "stdin_stdout", "input": "1\n50 870\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\n", "output": "YES\n"}, {"type": "stdin_stdout", "input": "5\n3 13\n3 1 4\n1 1\n1\n3 3\n1 4 2\n2 1\n4 3\n5 6\n1 2 3 4 5\n", "output"... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nThere is a triangle formed by three points $(x_1, y_1)$, $(x_2, y_2)$, $(x_3, y_3)$ on a plain.\n\nWrite a program which prints \"YES\" if a point $P$ $(x_p, y_p)$ is in the triangle and \"NO\" if not.\n\nConstraints\n\nY... | [{"type": "stdin_stdout", "input": "2.5236948660396488 1.2449675008007697 3.467160130839816 2.2489154237675044 4.3267713977209254 3.696599910445261 2.778529750649784 0.5428461273225557\n0.3648696681668867 1.6775294144371997 2.646749575901687 5.368903351235283 5.958977255484857 4.673632823800934 -0.048505034276450476 4.... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\n# Task\n You're given a two-dimensional array of integers `matrix`. Your task is to determine the smallest non-negative integer that is not present in this array.\n\n# Input/Output\n\n\n - `[input]` 2D integer array `matr... | [{"input": "[[4, 5, 3, -4, 3, 8], [2, 0, 6, 5, 4, 9], [7, 5, 6, 8, 2, 6], [1, 4, 7, 8, 9, 11], [1, 3, 10, 5, 5, 1], [12, 7, 3, 4, 4, 3]]", "output": "[13]", "fn_name": "smallest_integer"}, {"input": "[[4, 5, 3, 21, 3, 8], [2, 2, 6, 5, 10, 9], [7, 5, 6, 8, 2, 6], [1, 4, 7, 8, 9, 0], [1, 3, 6, 5, 5, 1], [2, 7, 3, 4, 4, 3... | code_functional |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nYou are given N integers; the i-th of them is A_i. Find the maximum possible sum of the absolute differences between the adjacent elements after arranging these integers in a row in any order you like.\n\nConstraints\n\n*... | [{"type": "stdin_stdout", "input": "5\n52\n-1\n-2\n-2\n-1", "output": "110\n"}, {"type": "stdin_stdout", "input": "5\n89\n-1\n-2\n-2\n-1", "output": "184\n"}, {"type": "stdin_stdout", "input": "5\n46\n-1\n-4\n-2\n-1", "output": "102\n"}, {"type": "stdin_stdout", "input": "5\n115\n-1\n0\n-2\n-1", "output": "236\n"}, {"t... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nTriangular number is the amount of points that can fill equilateral triangle. \n\nExample: the number 6 is a triangular number because all sides of a triangle has the same amount of points.\n\n```\nHint!\nT(n) = n * (n + ... | [{"input": "14", "output": "[false]", "fn_name": "is_triangular"}, {"input": "27", "output": "[false]", "fn_name": "is_triangular"}, {"input": "10", "output": "[true]", "fn_name": "is_triangular"}, {"input": "15", "output": "[true]", "fn_name": "is_triangular"}, {"input": "21", "output": "[true]", "fn_name": "is_triang... | code_functional |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nYou are given a permutation of integers from 1 to n. Exactly once you apply the following operation to this permutation: pick a random segment and shuffle its elements. Formally: Pick a random segment (continuous subsequ... | [{"type": "stdin_stdout", "input": "100\n30 99 96 51 67 72 33 35 93 70 25 24 6 9 22 83 86 5 79 46 29 88 66 20 87 47 45 71 48 52 61 37 19 40 44 11 8 42 63 92 31 94 2 4 28 77 21 75 13 95 76 14 53 69 54 38 59 60 98 55 39 68 85 23 15 18 58 78 43 49 16 1 82 91 7 84 34 89 17 27 90 26 36 81 64 74 50 57 10 73 12 62 3 100 80 32... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nThere are two standard ways to represent a graph $G = (V, E)$, where $V$ is a set of vertices and $E$ is a set of edges; Adjacency list representation and Adjacency matrix representation.\n\nAn adjacency-list representati... | [{"type": "stdin_stdout", "input": "4\n1 1 0 4\n2 1 1\n-1 -1\n4 1 2", "output": "0 0 0 1\n1 0 0 0\n0 0 0 0\n0 1 0 0\n"}, {"type": "stdin_stdout", "input": "4\n1 2 2 4\n2 1 4\n3 -1\n4 1 3", "output": "0 1 0 1\n0 0 0 1\n0 0 0 0\n0 0 1 0\n"}, {"type": "stdin_stdout", "input": "4\n1 2 1 4\n2 1 4\n1 -1\n4 1 3", "output": "1... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nGiven are integers A, B, and N.\nFind the maximum possible value of floor(Ax/B) - A × floor(x/B) for a non-negative integer x not greater than N.\nHere floor(t) denotes the greatest integer not greater than the real numbe... | [{"type": "stdin_stdout", "input": "1000000 1000000000000 1000000000000\n", "output": "999999\n"}, {"type": "stdin_stdout", "input": "1000000 948240928204 329810943092\n", "output": "347813\n"}, {"type": "stdin_stdout", "input": "133333 329230329032 493028310923\n", "output": "133332\n"}, {"type": "stdin_stdout", "inpu... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nEverybody seems to think that the Martians are green, but it turns out they are metallic pink and fat. Ajs has two bags of distinct nonnegative integers. The bags are disjoint, and the union of the sets of numbers in the ... | [{"type": "stdin_stdout", "input": "36 81\n4 5 7 8 13 14 16 17 22 23 25 26 31 32 34 35 40 41 43 44 49 50 52 53 58 59 61 62 67 68 70 71 76 77 79 80\n", "output": "9\n3 12 21 30 39 48 57 66 75\n"}, {"type": "stdin_stdout", "input": "36 156\n8 1 8 9 26 14 13 33 22 32 24 70 31 32 34 35 40 41 52 44 49 50 36 53 46 56 61 62 9... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nProfessor Pathfinder is a distinguished authority on the structure of hyperlinks in the World Wide Web. For establishing his hypotheses, he has been developing software agents, which automatically traverse hyperlinks and ... | [{"type": "stdin_stdout", "input": "5 6\n/home/ACM/index.html\nlmth.xedni/CPCI/\n/ICPC/general.html\n/ICPC/japanese/index.html\n/ICPC/secret/confidential/2005/index.html\n/home/ACM/\n/ho/e/ICPC/..mACM/\n/ICPC/secret/\n/ICPC/secret/index.html\n/ICPC\n/ICPC/../ICPC/index.html\n/ICPC\n/ICPC/general.html\n/ICPC/japanese/..... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nFrom Wikipedia : \"The n-back task is a continuous performance task that is commonly used as an assessment in cognitive neuroscience to measure a part of working memory and working memory capacity. [...] The subject is pr... | [{"input": "1\n[1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1... | code_functional |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nUtkarsh is forced to play yet another one of Ashish's games. The game progresses turn by turn and as usual, Ashish moves first.\n\nConsider the 2D plane. There is a token which is initially at $(0,0)$. In one move a playe... | [{"type": "stdin_stdout", "input": "5\n16 1\n3 2\n9 1\n65 19\n14195 55\n", "output": "Utkarsh\nUtkarsh\nUtkarsh\nUtkarsh\nUtkarsh\n"}, {"type": "stdin_stdout", "input": "5\n10 1\n3 2\n9 1\n65 19\n14195 55\n", "output": "Utkarsh\nUtkarsh\nUtkarsh\nUtkarsh\nUtkarsh\n"}, {"type": "stdin_stdout", "input": "5\n16 1\n4 2\n9 ... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nSnuke loves constructing integer sequences.\nThere are N piles of stones, numbered 1 through N.\nThe pile numbered i consists of a_i stones.\nSnuke will construct an integer sequence s of length Σa_i, as follows:\n - Amon... | [{"type": "stdin_stdout", "input": "10\n1 3 2 6 2 4 4 5 8 1", "output": "10\n14\n0\n10\n0\n0\n0\n0\n2\n0\n"}, {"type": "stdin_stdout", "input": "10\n1 3 1 6 3 4 6 6 4 1", "output": "10\n14\n0\n11\n0\n0\n0\n0\n0\n0\n"}, {"type": "stdin_stdout", "input": "10\n1 4 0 1 1 4 4 0 22 1", "output": "8\n12\n0\n0\n0\n0\n0\n0\n18\... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nFor given three integers $a, b, c$, print the minimum value and the maximum value.\n\nConstraints\n\n* $-1,000,000,000 \\leq a, b, c \\leq 1,000,000,000$\n\nInput\n\nThe input is given in the following format.\n\n\n$a \\;... | [{"type": "stdin_stdout", "input": "-30 -1 -1", "output": "-30 -1\n"}, {"type": "stdin_stdout", "input": "-22 -1 -1", "output": "-22 -1\n"}, {"type": "stdin_stdout", "input": "-22 -2 -2", "output": "-22 -2\n"}, {"type": "stdin_stdout", "input": "-2 10 -1", "output": "-2 10\n"}, {"type": "stdin_stdout", "input": "-2 28 ... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nAnia has a large integer S. Its decimal representation has length n and doesn't contain any leading zeroes. Ania is allowed to change at most k digits of S. She wants to do it in such a way that S still won't contain any ... | [{"type": "stdin_stdout", "input": "400 224\n34034718296316650556302576767095880542740697596682657060609028712014739414658241556774411582749368771597248873201583574900424227251655547840887764275893533353440635216728376201808545879398359535670372855472971530695051695650262058940466340529417646357776899296790403916961389... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nDetermine if we can choose K different integers between 1 and N (inclusive) so that no two of them differ by 1.\n\nConstraints\n\n* 1\\leq N,K\\leq 100\n* N and K are integers.\n\nInput\n\nInput is given from Standard Inp... | [{"type": "stdin_stdout", "input": "135 27", "output": "YES\n"}, {"type": "stdin_stdout", "input": "135 47", "output": "YES\n"}, {"type": "stdin_stdout", "input": "149 47", "output": "YES\n"}, {"type": "stdin_stdout", "input": "149 50", "output": "YES\n"}, {"type": "stdin_stdout", "input": "151 50", "output": "YES\n"},... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nThe Chef has prepared the appetizers in the shapes of letters to spell a special message for the guests. There are n appetizers numbered from 0 to n-1 such that if the appetizers are arrayed in this order, they will displ... | [{"type": "stdin_stdout", "input": "2\n2 chef\n4 eipelpparuoyojne", "output": "cehf\nerlopopniupjeyae\n"}, {"type": "stdin_stdout", "input": "2\n2 chef\n4 enjoyourappmepie", "output": "cehf\neayejpuinpopomre\n"}, {"type": "stdin_stdout", "input": "2\n2 cief\n4 enjoyourappmepie", "output": "ceif\neayejpuinpopomre\n"}, {... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nThere are N observatories in AtCoder Hill, called Obs. 1, Obs. 2, ..., Obs. N. The elevation of Obs. i is H_i.\nThere are also M roads, each connecting two different observatories. Road j connects Obs. A_j and Obs. B_j.\n... | [{"type": "stdin_stdout", "input": "6 5\n8 6 9 1 2 1\n1 3\n4 2\n4 3\n4 6\n4 6\n", "output": "3\n"}, {"type": "stdin_stdout", "input": "6 5\n8 6 18 1 4 1\n1 3\n4 0\n4 0\n4 6\n4 6", "output": "3\n"}, {"type": "stdin_stdout", "input": "6 5\n8 6 18 1 4 0\n1 3\n4 0\n4 0\n4 6\n4 6", "output": "4\n"}, {"type": "stdin_stdout",... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nGiven is a positive integer L.\nFind the maximum possible volume of a rectangular cuboid whose sum of the dimensions (not necessarily integers) is L.\n\n-----Constraints-----\n - 1 ≤ L ≤ 1000\n - L is an integer.\n\n-----... | [{"type": "stdin_stdout", "input": "1000\n", "output": "37037037.037037037313\n"}, {"type": "stdin_stdout", "input": "999\n", "output": "36926037.000000000000\n"}, {"type": "stdin_stdout", "input": "430\n", "output": "2944703.703703703824\n"}, {"type": "stdin_stdout", "input": "392\n", "output": "2230973.629629629664\n... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nRecently you have bought a snow walking robot and brought it home. Suppose your home is a cell $(0, 0)$ on an infinite grid.\n\nYou also have the sequence of instructions of this robot. It is written as the string $s$ con... | [{"type": "stdin_stdout", "input": "6\nLRU\nDURLDRUDRULRDURDDL\nLRUDDLRUDRUL\nLLLLRRRR\nURDUR\nLLL\n", "output": "2\nLR\n14\nLLLUUUURRRDDDD\n12\nLLLUUURRRDDD\n2\nLR\n2\nUD\n0\n\n"}, {"type": "stdin_stdout", "input": "6\nLRU\nDURLDRUDRULRDURDDL\nLRUDDLRUDRUL\nLLLLRRRR\nURDUR\nLLL\n", "output": "2\nLR\n14\nLLLUUUURRRDDDD... | 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.4997987526\n"}, {"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 2... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nBritish mathematician John Littlewood once said about Indian mathematician Srinivasa Ramanujan that \"every positive integer was one of his personal friends.\"\n\nIt turns out that positive integers can also be friends wi... | [{"type": "stdin_stdout", "input": "1\n69\n2 4 10 16 22 28 19 40 37 52 92 43 70 76 118 88 94 100 106 112 118 124 130 200 142 148 154 160 166 324 178 184 190 196 300 208 214 129 226 167 238 244 250 209 262 322 274 280 286 462 298 304 310 316 322 328 169 110 591 352 358 364 370 376 382 388 391 397 403\n", "output": "25\n... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nOur hardworking chef is bored of sleeping in his restaurants. He has decided to settle down. The first thing he must do is to find a suitable location to build a palatial home. \n\nThink of the city as a two-dimensional g... | [{"type": "stdin_stdout", "input": "3\n5\n0 0\n-1 -1\n2 0\n-1 1\n0 -2\n5\n31 11\n30 -41\n20 13\n25 28\n25 38\n2\n-1 0\n1 2", "output": "1\n1\n9\n"}, {"type": "stdin_stdout", "input": "3\n5\n-1 0\n-1 0\n1 4\n0 0\n0 -1\n5\n31 11\n52 -41\n18 1\n25 18\n25 60\n2\n-1 -1\n2 5", "output": "1\n1\n28\n"}, {"type": "stdin_stdout"... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nSagheer is playing a game with his best friend Soliman. He brought a tree with n nodes numbered from 1 to n and rooted at node 1. The i-th node has a_{i} apples. This tree has a special property: the lengths of all paths ... | [{"type": "stdin_stdout", "input": "21\n6194737 6429360 6047962 1014039 9196042 2483033 9232471 5444322 4437778 6614229 4791649 7417126 7679607 790939 3062370 174847 8404336 832859 2083127 9041108 3074902\n1 2 3 4 4 6 7 2 9 10 9 12 12 1 15 1 17 1 19 19\n", "output": "0\n"}, {"type": "stdin_stdout", "input": "21\n619473... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nTo participate in a prize draw each one gives his/her firstname. \n\nEach letter of a firstname\nhas a value which is its rank in the English alphabet. `A` and `a` have rank `1`, `B` and `b` rank `2` and so on. \n\nThe *l... | [{"input": "\"Addison,Jayden,Sofia,Michael,Andrew,Lily,Benjamin\"\n[4, 2, 1, 4, 3, 1, 2]\n8", "output": "[\"Not enough participants\"]", "fn_name": "rank"}, {"input": "\"Addison,Jayden,Sofia,Michael,Andrew,Lily,Benjamin\"\n[4, 2, 1, 4, 3, 1, 2]\n4", "output": "[\"Benjamin\"]", "fn_name": "rank"}, {"input": "\"Avery,Oli... | code_functional |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nIt started as a discussion with a friend, who didn't fully grasp some way of setting defaults, but I thought the idea was cool enough for a beginner kata: binary `OR` each matching element of two given arrays (or lists, i... | [{"input": "[1, 0, 3]\n[1, 2, 3]\n3", "output": "[[1, 2, 3]]", "fn_name": "or_arrays"}, {"input": "[1, 2, 3]\n[1, 2, 3]", "output": "[[1, 2, 3]]", "fn_name": "or_arrays"}, {"input": "[1, 2, 3]\n[4, 5, 6]", "output": "[[5, 7, 7]]", "fn_name": "or_arrays"}, {"input": "[1, 2, 3]\n[1, 2]", "output": "[[1, 2, 3]]", "fn_name... | code_functional |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nCompute A + B.\n\nConstraints\n\n* -1000 ≤ A, B ≤ 1000\n\nInput\n\nThe input will consist of a series of pairs of integers A and B separated by a space, one pair of integers per line. The input will be terminated by EOF.\... | [{"type": "stdin_stdout", "input": "1 2\n10 5\n101 20", "output": "3\n15\n121\n"}, {"type": "stdin_stdout", "input": "1 2\n10 4\n101 20", "output": "3\n14\n121\n"}, {"type": "stdin_stdout", "input": "1 2\n10 4\n101 37", "output": "3\n14\n138\n"}, {"type": "stdin_stdout", "input": "1 2\n11 4\n101 37", "output": "3\n15\n... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nIn the city of Saint Petersburg, a day lasts for $2^{100}$ minutes. From the main station of Saint Petersburg, a train departs after $1$ minute, $4$ minutes, $16$ minutes, and so on; in other words, the train departs at t... | [{"type": "stdin_stdout", "input": "1000010011100010111000001101000011001010011101011001101100000001011011000000101101101011101111011011\n", "output": "50\n"}, {"type": "stdin_stdout", "input": "1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111\n", "output": "50\n"}, {... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nYou are given a rooted tree consisting of $n$ vertices numbered from $1$ to $n$. The root of the tree is a vertex number $1$.\n\nA tree is a connected undirected graph with $n-1$ edges.\n\nYou are given $m$ queries. The $... | [{"type": "stdin_stdout", "input": "10 6\n1 2\n1 3\n1 4\n2 5\n2 6\n5 7\n7 8\n7 9\n9 10\n4 3 8 9 10\n3 2 4 6\n3 4 1 5\n3 4 8 2\n2 6 10\n3 5 4 7\n", "output": "YES\nYES\nYES\nYES\nYES\nYES\n"}, {"type": "stdin_stdout", "input": "10 6\n1 2\n1 3\n1 4\n2 5\n2 6\n5 7\n7 8\n7 9\n9 10\n4 3 8 9 10\n3 2 4 6\n3 4 1 5\n3 4 8 1\n2 ... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nTwo positive integers a and b have a sum of s and a bitwise XOR of x. How many possible values are there for the ordered pair (a, b)?\n\n\n-----Input-----\n\nThe first line of the input contains two integers s and x (2 ≤ ... | [{"type": "stdin_stdout", "input": "549755813887 549755813887\n", "output": "549755813886\n"}, {"type": "stdin_stdout", "input": "549755813888 549755813886\n", "output": "274877906944\n"}, {"type": "stdin_stdout", "input": "547616456703 547599679487\n", "output": "68719476736\n"}, {"type": "stdin_stdout", "input": "274... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nKoto Municipal Subway\n\nKoto Municipal Subway\n\nKoto City is a famous city whose roads are in a grid pattern, as shown in the figure below. The roads extending from north to south and the roads extending from east to we... | [{"type": "stdin_stdout", "input": "2 1\n11 5\n7 6\n5 0\n76 1\n1 41\n0 0", "output": "0.414213562373\n2.81024967591\n0.0827625302982\n3.60555127546\n52.7401153702\n40.0\n"}, {"type": "stdin_stdout", "input": "2 1\n14 6\n5 4\n7 7\n76 3\n9 000\n0 0", "output": "0.414213562373\n3.89949493661\n0.123105625618\n0.0\n50.74011... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nFailed Sort - Bug Fixing #4\nOh no, Timmy's Sort doesn't seem to be working? Your task is to fix the sortArray function to sort all numbers in ascending order\n\nWrite your solution by modifying this code:\n\n```python\nd... | [{"input": "\"12345\"", "output": "[\"12345\"]", "fn_name": "sort_array"}, {"input": "\"54321\"", "output": "[\"12345\"]", "fn_name": "sort_array"}, {"input": "\"34251\"", "output": "[\"12345\"]", "fn_name": "sort_array"}, {"input": "\"11111\"", "output": "[\"11111\"]", "fn_name": "sort_array"}, {"input": "\"10101\"", ... | code_functional |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nThere are N slimes standing on a number line. The i-th slime from the left is at position x_i.\n\nIt is guaruanteed that 1 \\leq x_1 < x_2 < \\ldots < x_N \\leq 10^{9}.\n\nNiwango will perform N-1 operations. The i-th ope... | [{"type": "stdin_stdout", "input": "12\n367101616 467388357 159541726 1477792495 1190847685 1723370727 668687333 270216579 135685914 125686970 1191846896 1765707086", "output": "469392584\n"}, {"type": "stdin_stdout", "input": "12\n367101616 467388357 127795962 1640220090 1190847685 1723370727 402149677 270216579 13568... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nA binary string is a string that consists of characters $0$ and $1$.\n\nLet $\\operatorname{MEX}$ of a binary string be the smallest digit among $0$, $1$, or $2$ that does not occur in the string. For example, $\\operator... | [{"type": "stdin_stdout", "input": "6\n01\n1111\n01100\n101\n0000\n01010\n", "output": "1\n0\n2\n1\n1\n2\n"}, {"type": "stdin_stdout", "input": "6\n01\n1111\n01100\n100\n0000\n01010\n", "output": "1\n0\n2\n1\n1\n2\n"}, {"type": "stdin_stdout", "input": "6\n01\n1011\n01100\n100\n0000\n01010\n", "output": "1\n1\n2\n1\n1\... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nA Bingo game is played by one gamemaster and several players. At the beginning of a game, each player is given a card with M × M numbers in a matrix (See Figure 10).\n\n<image>\n\nAs the game proceeds, the gamemaster anno... | [{"type": "stdin_stdout", "input": "4 3\n10 25 11 20 6 2 1 15 23\n5 21 1 12 23 17 7 26 2\n8 18 4 22 13 27 16 5 11\n19 9 24 2 11 5 14 28 16\n4 3\n12 13 20 24 28 32 15 16 17\n12 13 21 25 29 33 16 17 18\n12 13 22 26 30 34 17 18 15\n12 13 23 27 31 35 18 15 16\n4 3\n11 12 13 14 15 16 17 18 19\n21 22 23 24 25 26 27 28 29\n31... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nThe average miner Vaganych took refresher courses. As soon as a miner completes the courses, he should take exams. The hardest one is a computer test called \"Testing Pants for Sadness\".\n\nThe test consists of n questio... | [{"type": "stdin_stdout", "input": "50\n515844718 503470143 928669067 209884122 322869098 241621928 844696197 105586164 552680307 968792756 135928721 842094825 298782438 829020472 791637138 285482545 811025527 428952878 887796419 11883658 546401594 6272027 100292274 308219869 372132044 955814846 644008184 521195760 919... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nArpa is taking a geometry exam. Here is the last problem of the exam.\n\nYou are given three points a, b, c.\n\nFind a point and an angle such that if we rotate the page around the point by the angle, the new position of ... | [{"type": "stdin_stdout", "input": "-947393823 -495674431 211535284 -877153626 -522763219 -778236665\n", "output": "No\n"}, {"type": "stdin_stdout", "input": "-947393823 -495674431 211535284 -877153626 -522763219 -778236665\n", "output": "No\n"}, {"type": "stdin_stdout", "input": "-211700879 -495674431 211535284 -87715... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nFind the number of ways to choose a pair of an even number and an odd number from the positive integers between 1 and K (inclusive). The order does not matter.\n\n-----Constraints-----\n - 2\\leq K\\leq 100\n - K is an in... | [{"type": "stdin_stdout", "input": "-2373", "output": "1407782\n"}, {"type": "stdin_stdout", "input": "-1265", "output": "400056\n"}, {"type": "stdin_stdout", "input": "-1867", "output": "871422\n"}, {"type": "stdin_stdout", "input": "-1056", "output": "278784\n"}, {"type": "stdin_stdout", "input": "-1235", "output": "... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nThere are n kangaroos with pockets. Each kangaroo has a size (integer number). A kangaroo can go into another kangaroo's pocket if and only if the size of kangaroo who hold the kangaroo is at least twice as large as the s... | [{"type": "stdin_stdout", "input": "100\n154\n60\n97\n638\n139\n150\n570\n579\n601\n647\n804\n237\n245\n549\n288\n347\n778\n282\n916\n441\n974\n145\n957\n1006\n655\n702\n930\n618\n132\n520\n972\n48\n94\n54\n682\n433\n896\n134\n845\n636\n242\n842\n125\n141\n240\n130\n409\n666\n948\n938\n604\n110\n474\n484\n364\n40\n807\... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nJohny likes numbers n and k very much. Now Johny wants to find the smallest integer x greater than n, so it is divisible by the number k.\n\n\n-----Input-----\n\nThe only line contains two integers n and k (1 ≤ n, k ≤ 10^... | [{"type": "stdin_stdout", "input": "1000000000 1000000000\n", "output": "2000000000\n"}, {"type": "stdin_stdout", "input": "1000000010 1000000000\n", "output": "2000000000\n"}, {"type": "stdin_stdout", "input": "1398941105 1000000001\n", "output": "2000000002\n"}, {"type": "stdin_stdout", "input": "1000100010 100001000... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nTakahashi is not good at problems about trees in programming contests, and Aoki is helping him practice.\n\nFirst, Takahashi created a tree with N vertices numbered 1 through N, and wrote 0 at each edge.\n\nThen, Aoki gav... | [{"type": "stdin_stdout", "input": "10 0\n1 1\n2 6\n11 2\n-1 4\n0 10", "output": "YES\n"}, {"type": "stdin_stdout", "input": "10 -1\n1 1\n2 6\n11 2\n-1 5\n0 5", "output": "YES\n"}, {"type": "stdin_stdout", "input": "10 -1\n1 1\n2 3\n11 2\n-1 5\n0 5", "output": "YES\n"}, {"type": "stdin_stdout", "input": "10 0\n1 1\n11 ... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nThe city of Fishtopia can be imagined as a grid of 4 rows and an odd number of columns. It has two main villages; the first is located at the top-left cell (1,1), people who stay there love fishing at the Tuna pond at the... | [{"type": "stdin_stdout", "input": "100 80\n", "output": "YES\n....................................................................................................\n.########################################...........................................................\n.########################################............... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nVasya is about to take his first university exam in about several minutes. And it's not just some ordinary exam, it's on mathematical analysis. Of course, right now Vasya can only think of one thing: what the result of hi... | [{"type": "stdin_stdout", "input": "100 1\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 99\n1\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 ... | 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\nIf you write a solution in Python, then prefer to send it in PyPy to speed up execution time.\n\nA session has begun at Beland State University. Many s... | [{"type": "stdin_stdout", "input": "10 50\n10 10 10 10 10 10 10 10 10 10\n", "output": "0 0 0 0 0 1 2 3 4 5 \n"}, {"type": "stdin_stdout", "input": "10 50\n10 10 10 10 10 10 10 10 10 10\n", "output": "0 0 0 0 0 1 2 3 4 5 "}, {"type": "stdin_stdout", "input": "10 71\n10 10 10 10 10 10 10 10 10 10\n", "output": "0 0 0 0 ... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nSome new animals have arrived at the zoo. The zoo keeper is concerned that perhaps the animals do not have the right tails. To help her, you must correct the broken function to make sure that the second argument (tail), i... | [{"input": "\"Giraffe\"\n\"d\"", "output": "[false]", "fn_name": "correct_tail"}, {"input": "\"Meerkat\"\n\"t\"", "output": "[true]", "fn_name": "correct_tail"}, {"input": "\"Badger\"\n\"s\"", "output": "[false]", "fn_name": "correct_tail"}, {"input": "\"Rhino\"\n\"o\"", "output": "[true]", "fn_name": "correct_tail"}, ... | code_functional |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nDima got into number sequences. Now he's got sequence a_1, a_2, ..., a_{n}, consisting of n positive integers. Also, Dima has got a function f(x), which can be defined with the following recurrence: f(0) = 0; f(2·x) = f... | [{"type": "stdin_stdout", "input": "8\n851991424 32517099 310793856 776130403 342626527 58796623 49544509 517126753\n", "output": "2\n"}, {"type": "stdin_stdout", "input": "8\n851991424 32517099 310793856 771296843 342626527 58796623 49544509 517126753\n", "output": "1\n"}, {"type": "stdin_stdout", "input": "8\n8519914... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nRead problems statements in Mandarin Chinese , Russian and Vietnamese as well. \n\nChef belongs to a very rich family which owns many gold mines. Today, he brought N gold coins and decided to form a triangle using these c... | [{"type": "stdin_stdout", "input": "3\n5\n13\n106", "output": "2\n4\n14\n"}, {"type": "stdin_stdout", "input": "3\n5\n13\n68", "output": "2\n4\n11\n"}, {"type": "stdin_stdout", "input": "3\n5\n1\n106", "output": "2\n1\n14\n"}, {"type": "stdin_stdout", "input": "3\n5\n1\n122", "output": "2\n1\n15\n"}, {"type": "stdin_st... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nYour goal in this kata is to implement a difference function, which subtracts one list from another and returns the result.\n\nIt should remove all values from list `a`, which are present in list `b`.\n\n```python\narray_... | [{"input": "[1, 2, 2]\n[]", "output": "[[1, 2, 2]]", "fn_name": "array_diff"}, {"input": "[1, 2, 2]\n[1]", "output": "[[2, 2]]", "fn_name": "array_diff"}, {"input": "[1, 2, 2]\n[2]", "output": "[[1]]", "fn_name": "array_diff"}, {"input": "[1, 2]\n[1]", "output": "[[2]]", "fn_name": "array_diff"}, {"input": "[]\n[1, 2]"... | code_functional |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nMisha and Vanya have played several table tennis sets. Each set consists of several serves, each serve is won by one of the players, he receives one point and the loser receives nothing. Once one of the players scores exa... | [{"type": "stdin_stdout", "input": "1 1000000000 1000000000\n", "output": "2000000000\n"}, {"type": "stdin_stdout", "input": "1000000000 1000000000 1000000000\n", "output": "2\n"}, {"type": "stdin_stdout", "input": "2 1000000000 1000000000\n", "output": "1000000000\n"}, {"type": "stdin_stdout", "input": "1000000000 999... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nThis problem consists of three subproblems: for solving subproblem F1 you will receive 8 points, for solving subproblem F2 you will receive 15 points, and for solving subproblem F3 you will receive 10 points.\n\nManao has... | [{"type": "stdin_stdout", "input": "10 4\n2\n7\n1\n9\n8\n10\n5\n10\n1\n20\n", "output": "38\n"}, {"type": "stdin_stdout", "input": "10 4\n1\n7\n1\n9\n8\n10\n5\n10\n1\n20\n", "output": "39\n"}, {"type": "stdin_stdout", "input": "10 5\n2\n13\n3\n9\n8\n7\n9\n7\n1\n18\n", "output": "36\n"}, {"type": "stdin_stdout", "input"... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nThis is the easy version of the problem. The difference between the versions is in the number of possible operations that can be made. You can make hacks if and only if you solved both versions of the problem.\n\nYou are ... | [{"type": "stdin_stdout", "input": "5\n2 2\n10\n11\n3 3\n011\n101\n110\n4 4\n1111\n0110\n0110\n1111\n5 5\n01011\n11001\n00010\n11011\n10000\n2 3\n011\n101\n", "output": "1\n1 1 2 1 2 2 \n6\n1 1 1 2 2 2 \n1 1 2 1 2 2 \n1 2 1 3 2 2 \n1 2 2 2 2 3 \n2 1 2 2 3 1 \n2 1 2 2 3 2 \n20\n1 1 1 2 2 2 \n1 2 1 3 2 2 \n1 2 2 2 2 3 \n... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nFor a finite set of integers X, let f(X)=\\max X - \\min X.\nGiven are N integers A_1,...,A_N.\nWe will choose K of them and let S be the set of the integers chosen. If we distinguish elements with different indices even ... | [{"type": "stdin_stdout", "input": "10 6\n1000000000 1000000000 1000000000 1000000000 1000000000 0 0 0 0 0\n", "output": "999998537\n"}, {"type": "stdin_stdout", "input": "10 8\n1000000000 1100000000 1000001010 1000000000 1000000000 0 0 -2 0 0", "output": "600007816\n"}, {"type": "stdin_stdout", "input": "10 8\n1000000... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nSome time ago Leonid have known about idempotent functions. Idempotent function defined on a set {1, 2, ..., n} is such function $g : \\{1,2, \\ldots, n \\} \\rightarrow \\{1,2, \\ldots, n \\}$, that for any $x \\in \\{1,... | [{"type": "stdin_stdout", "input": "142\n34 88 88 88 88 88 131 53 88 130 131 88 88 130 88 131 53 130 130 34 88 88 131 130 53 88 88 34 131 130 88 131 130 34 130 53 53 34 53 34 130 34 88 88 130 88 131 130 34 53 88 34 53 88 130 53 34 53 88 131 130 34 88 88 130 88 130 130 131 131 130 53 131 130 131 130 53 34 131 34 88 53 8... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nHow Many Divisors?\n\nWrite a program which reads three integers a, b and c, and prints the number of divisors of c between a and b.\n\nConstraints\n\n* 1 ≤ a, b, c ≤ 10000\n* a ≤ b\n\nInput\n\nThree integers a, b and c a... | [{"type": "stdin_stdout", "input": "4 32 120", "output": "10\n"}, {"type": "stdin_stdout", "input": "13 14 107", "output": "0\n"}, {"type": "stdin_stdout", "input": "5 14 149", "output": "0\n"}, {"type": "stdin_stdout", "input": "13 14 80", "output": "0\n"}, {"type": "stdin_stdout", "input": "5 14 241", "output": "0\n"... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nGilbert is the network admin of Ginkgo company. His boss is mad about the messy network cables on the floor. He finally walked up to Gilbert and asked the lazy network admin to illustrate how computers and switches are co... | [{"type": "stdin_stdout", "input": "4\n 0 2 2 2\n 2 0 2 2\n 2 2 -1 2\n 2 2 2 0\n4\n -1 2 4 4\n 2 -1 4 4\n 4 4 -1 2\n 4 4 2 0\n2\n 0 12\n 12 0\n0", "output": "4\n2 3 3\n2 2 2 2 2 2 2 2 2 2 2\n"}, {"type": "stdin_stdout", "input": "4\n -1 2 2 2\n 2 0 2 2\n 2 2 -1 ... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nAccording to a new ISO standard, a flag of every country should have, strangely enough, a chequered field n × m, each square should be wholly painted one of 26 colours. The following restrictions are set: \n\n * In each ... | [{"type": "stdin_stdout", "input": "1 500\nwljexjwjwsxhascgpyezfotqyieywzyzpnjzxqebroginhlpsvtbgmbckgqixkdveraxlgleieeagubywaacncxoouibbhwyxhjiczlymscsqlttecvundzjqtuizqwsjalmizgeekugacatlwhiiyaamjuiafmyzxadbxsgwhfawotawfxkpyzyoceiqfppituvaqmgfjinulkbkgpnibaefqaqiptctoqhcnnfihmzijnwpxdikwefpxicbspdkppznpiqrpkyvcxapoaof... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nCan you imagine our life if we removed all zeros from it? For sure we will have many problems.\n\nIn this problem we will have a simple example if we removed all zeros from our life, it's the addition operation. Let's ass... | [{"type": "stdin_stdout", "input": "1000000000\n1000000000\n", "output": "YES\n"}, {"type": "stdin_stdout", "input": "1000000000\n1000010000\n", "output": "NO\n"}, {"type": "stdin_stdout", "input": "1000000000\n1001010000\n", "output": "NO\n"}, {"type": "stdin_stdout", "input": "999999999\n999999999\n", "output": "YES\... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nYou've had a baby.\n\nWell done. Nice isn't it? Life destroying... but in a good way.\n\nPart of your new routine is lying awake at night worrying that you've either lost the baby... or that you have more than 1!\n\nGiven... | [{"input": "\"Why the hell are there so many babies?!\"", "output": "[1]", "fn_name": "baby_count"}, {"input": "\"Anyone remember life before babies?\"", "output": "[1]", "fn_name": "baby_count"}, {"input": "\"none here\"", "output": "[\"Where's the baby?!\"]", "fn_name": "baby_count"}, {"input": "\"Happy babies boom b... | code_functional |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nSereja loves all sorts of algorithms. He has recently come up with a new algorithm, which receives a string as an input. Let's represent the input string of the algorithm as q = q_1q_2... q_{k}. The algorithm consists of ... | [{"type": "stdin_stdout", "input": "yxzyzxzzxyyzzxxxzyyzzyzxxzxyzyyzxyzxyxxyzxyxzyzxyzxyyxzzzyzxyyxyzxxy\n10\n17 67\n6 35\n12 45\n56 56\n14 30\n25 54\n1 1\n46 54\n3 33\n19 40\n", "output": "NO\nNO\nNO\nYES\nYES\nNO\nYES\nNO\nNO\nYES\n"}, {"type": "stdin_stdout", "input": "yxzyzxzzxyyzzxxxzyyzzyzxxzxyzyyzxyzxyxxyzxyxzyz... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nTakahashi, who is a novice in competitive programming, wants to learn M algorithms.\nInitially, his understanding level of each of the M algorithms is 0.\nTakahashi is visiting a bookstore, where he finds N books on algor... | [{"type": "stdin_stdout", "input": "12 12 48311\n2997 79802 84238 34346 35199 2284 77696 46340 54797 36702 97764 42765 11582\n82923 47331 39508 81928 63775 90952 64439 99662 74546 15843 11552 23897 87476\n26261 21259 714 72469 92132 94958 69101 38760 4916 38769 60706 90149 70017\n35433 97674 53722 44881 95786 42614 799... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nThe All-Berland National Olympiad in Informatics has just ended! Now Vladimir wants to upload the contest from the Olympiad as a gym to a popular Codehorses website.\n\nUnfortunately, the archive with Olympiad's data is a... | [{"type": "stdin_stdout", "input": "20\nphp8vy 1\nkeeona 0\n8 0\nwzf4eb 0\n16 1\n9 0\nf2548d 0\n11 0\nyszsig 0\nyyf4q2 0\n1pon1p 1\njvpwuo 0\nd9stsx 0\ne14bkx 1\n5 0\n17 0\nsbklx4 0\nsfms2u 1\n6 0\n18 1\n", "output": "16\nmove 16 1\nmove 18 2\nmove 5 20\nmove 6 19\nmove php8vy 3\nmove 1pon1p 4\nmove e14bkx 5\nmove sfms... | code_stdio |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.