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\nTaro came to a square to look for treasure. There are many treasures buried in this square, but Taro has the latest machines, so he knows everything about where the treasures are buried. Since the square is very wide Taro... | [{"type": "stdin_stdout", "input": "5 5\n10 7\n-3 -8\n2 11\n6 0\n-1 3\n-3 1 3 13\n-1 -1 9 5\n-3 -16 10 11\n-1 0 5 4\n-1 -13 15 10", "output": "2\n2\n5\n1\n3\n"}, {"type": "stdin_stdout", "input": "5 5\n10 7\n-3 -8\n2 11\n10 0\n-1 3\n-3 1 3 13\n-1 -1 9 5\n-3 -16 12 11\n0 0 5 4\n-1 -13 15 10", "output": "2\n1\n5\n0\n3\n"... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nPasser ratings are the generally accepted standard for evaluating NFL quarterbacks.\nI knew a rating of 100 is pretty good, but never knew what makes up the rating.\nSo out of curiosity I took a look at the wikipedia page... | [{"input": "432\n3554\n291\n28\n2", "output": "[112.2]", "fn_name": "passer_rating"}, {"input": "48\n192\n19\n2\n3", "output": "[39.6]", "fn_name": "passer_rating"}, {"input": "34\n172\n20\n1\n1", "output": "[69.7]", "fn_name": "passer_rating"}, {"input": "5\n76\n4\n1\n0", "output": "[158.3]", "fn_name": "passer_rating... | code_functional |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nIn Berland recently a new collection of toys went on sale. This collection consists of 10^9 types of toys, numbered with integers from 1 to 10^9. A toy from the new collection of the i-th type costs i bourles.\n\nTania ha... | [{"type": "stdin_stdout", "input": "5 100000000\n100000000 999999999 1 2 3\n", "output": "14138\n4 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 8... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nDecimal numbers are a common notation system currently in use and use ten symbols 0, 1, 2, 3, 4, 5, 6, 7, 8, and 9 to represent all numbers.\n\nBinary numbers are a popular notation in the computer world and use two symbo... | [{"type": "stdin_stdout", "input": "7\n4\n0\n24\n10\n10010\n-1", "output": "13\n10\n0\n120\n22\n2130122\n"}, {"type": "stdin_stdout", "input": "7\n4\n1\n24\n10\n10010\n-1", "output": "13\n10\n1\n120\n22\n2130122\n"}, {"type": "stdin_stdout", "input": "7\n4\n0\n12\n16\n10000\n-1", "output": "13\n10\n0\n30\n100\n2130100\... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nYour colleagues have been good enough(?) to buy you a birthday gift. Even though it is your birthday and not theirs, they have decided to play pass the parcel with it so that everyone has an even chance of winning. There ... | [{"input": "\"dog\"\n23", "output": "[\"pass out from excitement 23 times\"]", "fn_name": "present"}, {"input": "\"badpresent\"\n3", "output": "[\"Take this back!\"]", "fn_name": "present"}, {"input": "\"goodpresent\"\n9", "output": "[\"pxxmy{n|nw}\"]", "fn_name": "present"}, {"input": "\"crap\"\n10", "output": "[\"acp... | code_functional |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nFind places where a string P is found within a text T. Print all indices of T where P found. The indices of T start with 0.\n\nConstraints\n\n* 1 ≤ length of T ≤ 1000000\n* 1 ≤ length of P ≤ 10000\n* The input consists of... | [{"type": "stdin_stdout", "input": "aaaaab\naa", "output": "0\n1\n2\n3\n"}, {"type": "stdin_stdout", "input": "baaaaa\naa", "output": "1\n2\n3\n4\n"}, {"type": "stdin_stdout", "input": "aaabaa\naa", "output": "0\n1\n4\n"}, {"type": "stdin_stdout", "input": "baaaab\naa", "output": "1\n2\n3\n"}, {"type": "stdin_stdout", ... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nThe Smart Beaver from ABBYY began to develop a new educational game for children. The rules of the game are fairly simple and are described below.\n\nThe playing field is a sequence of n non-negative integers ai numbered ... | [{"type": "stdin_stdout", "input": "120\n242 524 420 973 816 432 247 666 134 849 145 366 608 930 613 315 863 628 97 109 65 704 741 314 736 17 872 971 559 648 223 771 171 327 782 837 303 393 292 339 730 834 794 868 540 251 789 893 23 305 116 220 699 863 580 992 861 393 98 253 544 171 336 207 348 496 316 285 286 727 613 ... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nSakuzyo - Imprinting\n\nA.R.C. Markland-N is a tall building with $n$ floors numbered from $1$ to $n$. Between each two adjacent floors in the building, there is a staircase connecting them.\n\nIt's lunchtime for our sens... | [{"type": "stdin_stdout", "input": "1\n100 52 99\n51 69 42 32 34 62 12 75 88 18 57 47 40 91 100 81 72 15 26 14 93 68 6 50 5 24 97 52 10 20 54 9 56 39 21 55 7 98 59 87 77 17 29 13 30 46 37 76 71 78 96 82 49 64 84 60 67 19 2 25 85 89 38 41 11 90 35 48 27 28 70 65 66 16 79 3 80 44 36 43 61 99 22 33 86 4 83 94 74 31 73 95 ... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\n### Task\n\nYes, your eyes are no problem, this is toLoverCase (), not toLowerCase (), we want to make the world full of love.\n \n### What do we need to do?\n \nYou need to add a prototype function to the String, t... | [{"input": "\"Hello World!\"", "output": "[\"ELEEV VVOEE!\"]", "fn_name": "to_lover_case"}, {"input": "\"jrvz,\"", "output": "[\"OOOO,\"]", "fn_name": "to_lover_case"}, {"input": "\"LOVE\"", "output": "[\"EVOL\"]", "fn_name": "to_lover_case"}, {"input": "\"love\"", "output": "[\"EVOL\"]", "fn_name": "to_lover_case"}, {... | code_functional |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nJon Snow is on the lookout for some orbs required to defeat the white walkers. There are k different types of orbs and he needs at least one of each. One orb spawns daily at the base of a Weirwood tree north of the wall. ... | [{"type": "stdin_stdout", "input": "8 10\n100\n200\n300\n400\n500\n600\n700\n800\n900\n1000\n", "output": "11\n13\n14\n15\n16\n16\n17\n18\n19\n20\n"}, {"type": "stdin_stdout", "input": "8 10\n100\n200\n300\n400\n500\n600\n700\n862\n900\n1000\n", "output": "11\n13\n14\n15\n16\n16\n17\n19\n19\n20\n"}, {"type": "stdin_std... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nYou have to create a method \"compoundArray\" which should take as input two int arrays of different length and return one int array with numbers of both arrays shuffled one by one. \n```Example: \nInput - {1,2,3,4,5,6} a... | [{"input": "[2147483647, 2147483646, 2147483645, 2147483644, 2147483643]\n[9]", "output": "[[2147483647, 9, 2147483646, 2147483645, 2147483644, 2147483643]]", "fn_name": "compound_array"}, {"input": "[0, 1, 2]\n[9, 8, 7, 6, 5, 4, 3, 2, 1, 0]", "output": "[[0, 9, 1, 8, 2, 7, 6, 5, 4, 3, 2, 1, 0]]", "fn_name": "compound_... | code_functional |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nGiven a sequence of integers a_1, ..., a_{n} and q queries x_1, ..., x_{q} on it. For each query x_{i} you have to count the number of pairs (l, r) such that 1 ≤ l ≤ r ≤ n and gcd(a_{l}, a_{l} + 1, ..., a_{r}) = x_{i}.\n\... | [{"type": "stdin_stdout", "input": "10\n2 2 4 3 2 4 4 2 4 2\n104\n3\n3\n1\n4\n1\n1\n4\n1\n1\n3\n1\n1\n4\n1\n1\n1\n4\n3\n1\n1\n4\n1\n1\n1\n1\n1\n4\n1\n1\n1\n4\n1\n1\n4\n1\n1\n1\n1\n1\n4\n4\n1\n3\n1\n4\n1\n1\n1\n4\n1\n2\n4\n1\n4\n1\n4\n1\n4\n3\n1\n2\n2\n4\n2\n1\n1\n2\n4\n4\n1\n2\n3\n1\n1\n4\n4\n4\n4\n4\n2\n2\n4\n1\n1\n1\... | 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\nAs every other little boy, Mike has a favorite toy to play with. Mike's favorite toy is a set of N disks. The boy likes to compose his disks in stacks,... | [{"type": "stdin_stdout", "input": "3\n6\n2 4 5 0 1 2\n10\n0 2 5 5 2 3 4 14 1 3\n8\n9 9 13 19 23 10 18 12", "output": "3 0 1 2\n6 0 1 2 3 3 14\n5 9 9 10 12 23\n"}, {"type": "stdin_stdout", "input": "3\n6\n3 4 5 1 1 2\n10\n3 2 9 5 2 3 4 14 7 10\n8\n9 5 13 19 23 10 18 12", "output": "3 1 1 2\n6 2 2 3 4 7 10\n4 5 10 12 23... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nProblem\n\nGiven the integer n, output the smallest m such that nCm (the number of combinations that choose m out of n different ones) is even.\n\nConstraints\n\nThe input satisfies the following conditions.\n\n* 1 ≤ n ≤ ... | [{"type": "stdin_stdout", "input": "127", "output": "128\n"}, {"type": "stdin_stdout", "input": "255", "output": "256\n"}, {"type": "stdin_stdout", "input": "175", "output": "16\n"}, {"type": "stdin_stdout", "input": "101", "output": "2\n"}, {"type": "stdin_stdout", "input": "15", "output": "16\n"}, {"type": "stdin_std... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nWrite a function that accepts two parameters (a and b) and says whether a is smaller than, bigger than, or equal to b.\n\nHere is an example code:\nvar noIfsNoButs = function (a,b) {\n if(a > b) return a + \" is greater ... | [{"input": "100\n80", "output": "[\"100 is greater than 80\"]", "fn_name": "no_ifs_no_buts"}, {"input": "45\n51", "output": "[\"45 is smaller than 51\"]", "fn_name": "no_ifs_no_buts"}, {"input": "100\n100", "output": "[\"100 is equal to 100\"]", "fn_name": "no_ifs_no_buts"}, {"input": "20\n19", "output": "[\"20 is grea... | code_functional |
[
{
"content": "Solve the following coding problem using the programming language python:\n\n# Task\n\nYou are a lonely frog. \n\nYou live on an integer array.\n\nThe meaning of your life is to jump and jump..\n\nNow, here comes your new task. \n\nYou are given an integer array `arr` and a positive integer `n`.\n... | [{"input": "[0, -1, -2, -3, -4]\n4", "output": "[2]", "fn_name": "jumping"}, {"input": "[0, -1, -2, -3, -4]\n3", "output": "[0]", "fn_name": "jumping"}, {"input": "[0, -1, -2, -3, -4]\n2", "output": "[3]", "fn_name": "jumping"}, {"input": "[0, -1, -2, -3, -4]\n1", "output": "[0]", "fn_name": "jumping"}, {"input": "[0, ... | code_functional |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nWe're giving away nice huge bags containing number tiles! A bag we want to present to you contains n tiles. Each of them has a single number written on it — either 1 or 2.\n\nHowever, there is one condition you must fulfi... | [{"type": "stdin_stdout", "input": "214\n1 2 2 1 1 1 2 2 2 2 1 1 1 2 2 2 2 2 2 1 2 1 1 2 2 1 1 2 2 2 2 1 2 2 2 1 1 2 2 2 1 1 2 2 1 2 2 2 1 1 2 1 1 2 1 1 1 2 2 2 2 1 2 2 2 1 2 1 2 1 1 2 2 1 1 2 1 2 2 2 2 2 2 2 1 2 1 2 2 1 2 2 2 1 2 2 1 2 2 1 2 2 2 2 1 2 2 2 1 1 2 2 2 2 2 2 1 2 2 2 2 1 1 1 2 2 2 1 2 1 2 1 1 2 1 1 1 2 2 2... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nIn the year 30XX, an expedition team reached a planet and found a warp machine suggesting the existence of a mysterious supercivilization. When you go through one of its entrance gates, you can instantaneously move to the... | [{"type": "stdin_stdout", "input": "25\nneihsokcpuziafoytisrevinu\nuniversityofaizupckoshhen", "output": "4\n"}, {"type": "stdin_stdout", "input": "25\nuniversityofaiztpckoshien\nuniversityofaizupbkoshhen", "output": "0\n"}, {"type": "stdin_stdout", "input": "25\nuniversityofaiztpckoshien\nnehhsokbpuziafoytisrevinu", "... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nNowadays all circuses in Berland have a round arena with diameter 13 meters, but in the past things were different.\n\nIn Ancient Berland arenas in circuses were shaped as a regular (equiangular) polygon, the size and the... | [{"type": "stdin_stdout", "input": "129.400249 -44.695226\n122.278798 -53.696996\n44.828427 -83.507917\n", "output": "26227.478504758346\n"}, {"type": "stdin_stdout", "input": "115.715093 141.583620\n136.158119 -23.780834\n173.673212 64.802787\n", "output": "24043.740341410277\n"}, {"type": "stdin_stdout", "input": "-4... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nYou are given $n$ numbers $a_1, a_2, \\dots, a_n$. With a cost of one coin you can perform the following operation:\n\nChoose one of these numbers and add or subtract $1$ from it.\n\nIn particular, we can apply this opera... | [{"type": "stdin_stdout", "input": "22\n99039804 -580368436 -694542422 231508622 -490965348 958087037 -570157955 560902976 -840005981 -1381720926 -708462966 639575552 119982241 -631099451 -154223559 102960509 -225552439 507250810 -712228569 989896753 1574991855 1\n", "output": "12773524192\n"}, {"type": "stdin_stdout",... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nThere are times you recall a good old friend and everything you've come through together. Luckily there are social networks — they store all your message history making it easy to know what you argued over 10 years ago.\n... | [{"type": "stdin_stdout", "input": "100 7\n0 1 1 1 0 5 6 6 8 8 9 11 12 11 8 0 0 14 6 16 7 21 15 23 15 24 0 0 0 28 0 29 26 27 19 1 0 21 37 32 40 30 37 34 39 38 34 38 0 0 41 24 45 47 0 33 46 26 31 0 21 57 57 18 63 63 20 59 65 56 68 0 30 55 55 0 70 43 59 49 59 79 66 74 0 11 65 0 80 63 0 84 73 49 73 81 0 86 76 20\n", "outp... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nVanya has a table consisting of 100 rows, each row contains 100 cells. The rows are numbered by integers from 1 to 100 from bottom to top, the columns are numbered from 1 to 100 from left to right. \n\nIn this table, Vany... | [{"type": "stdin_stdout", "input": "5\n4 11 20 20\n6 11 20 16\n5 1 33 15\n11 3 18 21\n3 2 14 21\n", "output": "1087\n"}, {"type": "stdin_stdout", "input": "5\n4 11 20 22\n6 11 20 16\n5 1 34 15\n11 3 18 21\n3 1 14 11\n", "output": "1028\n"}, {"type": "stdin_stdout", "input": "5\n4 11 20 38\n6 11 20 16\n5 2 19 15\n11 3 1... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nA string of length 6 consisting of lowercase English letters is said to be coffee-like if and only if its 3-rd and 4-th characters are equal and its 5-th and 6-th characters are also equal.\n\nGiven a string S, determine ... | [{"type": "stdin_stdout", "input": "sippuu\n", "output": "Yes\n"}, {"type": "stdin_stdout", "input": "coffee\n", "output": "Yes\n"}, {"type": "stdin_stdout", "input": "dceett\n", "output": "Yes\n"}, {"type": "stdin_stdout", "input": "otjjmm\n", "output": "Yes\n"}, {"type": "stdin_stdout", "input": "zkrrcc\n", "output":... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nThe Floral Clock has been standing by the side of Mirror Lake for years. Though unable to keep time, it reminds people of the passage of time and the good old days.\n\nOn the rim of the Floral Clock are 2n flowers, number... | [{"type": "stdin_stdout", "input": "23333\n", "output": "259575428\n"}, {"type": "stdin_stdout", "input": "49997\n", "output": "645043850\n"}, {"type": "stdin_stdout", "input": "10492\n", "output": "914991759\n"}, {"type": "stdin_stdout", "input": "30000\n", "output": "583465411\n"}, {"type": "stdin_stdout", "input": "... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nIn telecomunications we use information coding to detect and prevent errors while sending data. \n\nA parity bit is a bit added to a string of binary code that indicates whether the number of 1-bits in the string is even ... | [{"input": "\"10100011 00111001 11001100 01010100 10110110 00111111\"", "output": "[\"1010001 0011100 1100110 error error 0011111\"]", "fn_name": "parity_bit"}, {"input": "\"01101110 01100000 01010110 10001111 01100011\"", "output": "[\"error 0110000 0101011 error 0110001\"]", "fn_name": "parity_bit"}, {"input": "\"111... | code_functional |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nLittle Artem found a grasshopper. He brought it to his house and constructed a jumping area for him.\n\nThe area looks like a strip of cells 1 × n. Each cell contains the direction for the next jump and the length of that... | [{"type": "stdin_stdout", "input": "10\n>>>>>>>>><\n1 1 1 1 1 1 1 1 1 5\n", "output": "INFINITE\n"}, {"type": "stdin_stdout", "input": "10\n>>>>>>>>><\n1 1 1 1 1 1 1 1 1 1\n", "output": "INFINITE\n"}, {"type": "stdin_stdout", "input": "10\n>>>>>>>>>>\n1 1 1 1 1 1 1 1 1 100\n", "output": "FINITE\n"}, {"type": "stdin_std... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nGiven a positive number n > 1 find the prime factor decomposition of n.\nThe result will be a string with the following form :\n```\n \"(p1**n1)(p2**n2)...(pk**nk)\"\n```\nwhere ```a ** b``` means ```a``` to the power of ... | [{"input": "782611830", "output": "[\"(2)(3**2)(5)(7**2)(11)(13)(17)(73)\"]", "fn_name": "primeFactors"}, {"input": "7775460", "output": "[\"(2**2)(3**3)(5)(7)(11**2)(17)\"]", "fn_name": "primeFactors"}, {"input": "342217392", "output": "[\"(2**4)(3)(11)(43)(15073)\"]", "fn_name": "primeFactors"}, {"input": "775878912"... | code_functional |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nproblem\n\nAOR Ika made a set $ S = \\\\ {a_1, ..., a_N \\\\} $ and a map $ f: S → S $. $ f (a_i) = b_i $. For any element $ x $ in the set $ S $, all maps $ g, h: S → S $ satisfying $ g (f (x)) = h (f (x)) $ are $ g (x).... | [{"type": "stdin_stdout", "input": "5\n2 1 3 4 5\n3 4 2 5 1", "output": "Yes\n"}, {"type": "stdin_stdout", "input": "5\n1 2 3 4 5\n2 4 3 5 1", "output": "Yes\n"}, {"type": "stdin_stdout", "input": "5\n1 3 2 4 5\n3 4 2 5 1", "output": "Yes\n"}, {"type": "stdin_stdout", "input": "5\n2 1 3 4 5\n2 4 3 5 1", "output": "Yes\... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nGiven a string containing a list of integers separated by commas, write the function string_to_int_list(s) that takes said string and returns a new list containing all integers present in the string, preserving the order.... | [{"input": "\",,,,,1,2,3,,,4,,5,,,\"", "output": "[[1, 2, 3, 4, 5]]", "fn_name": "string_to_int_list"}, {"input": "\"21,12,23,34,45\"", "output": "[[21, 12, 23, 34, 45]]", "fn_name": "string_to_int_list"}, {"input": "\"-1,-2,3,-4,-5\"", "output": "[[-1, -2, 3, -4, -5]]", "fn_name": "string_to_int_list"}, {"input": "\"1... | code_functional |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nThere is a chain consisting of multiple circles on a plane. The first (last) circle of the chain only intersects with the next (previous) circle, and each intermediate circle intersects only with the two neighboring circl... | [{"type": "stdin_stdout", "input": "10\n802 0 10\n814 0 4\n820 1 4\n826 1 4\n832 3 5\n838 9 5\n845 7 3\n849 10 3\n853 14 4\n857 18 3\n3\n0 0 5\n8 0 5\n8 8 5\n3\n0 0 5\n7 3 6\n16 1 5\n9\n-1 3 5\n8 0 8\n19 2 11\n23 14 6\n23 21 6\n23 28 6\n19 40 8\n8 42 8\n0 39 5\n11\n0 0 5\n8 0 5\n18 8 10\n8 16 5\n0 16 5\n-1 24 5\n3 32 5... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nYou are given a sequence of $n$ integers $a_1$, $a_2$, ..., $a_n$. Let us call an index $j$ ($2 \\le j \\le {{n-1}}$) a hill if $a_j > a_{{j+1}}$ and $a_j > a_{{j-1}}$; and let us call it a valley if $a_j < a_{{j+1}}$ and... | [{"type": "stdin_stdout", "input": "4\n3\n3 14 1\n5\n3 3 2 2 4\n6\n1 6 2 2 2 10\n5\n1 12 1 4 2\n", "output": "0\n0\n0\n0\n"}, {"type": "stdin_stdout", "input": "4\n3\n3 14 1\n5\n3 3 2 1 4\n6\n1 6 2 2 2 10\n5\n1 12 1 4 2\n", "output": "0\n0\n0\n0\n"}, {"type": "stdin_stdout", "input": "4\n3\n1 5 0\n5\n5 4 2 2 -1\n6\n0 8... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nBandits appeared in the city! One of them is trying to catch as many citizens as he can.\n\nThe city consists of $n$ squares connected by $n-1$ roads in such a way that it is possible to reach any square from any other sq... | [{"type": "stdin_stdout", "input": "100\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 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\n0 0 63 70 92 75 4 96 52 33 86 57 53 85 91 62 23 0 28 37 41 69 26 64 7 100 41 19 ... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nStudent Andrey has been skipping physical education lessons for the whole term, and now he must somehow get a passing grade on this subject. Obviously, it is impossible to do this by legal means, but Andrey doesn't give u... | [{"type": "stdin_stdout", "input": "8 8\n.#.#.#.#\n#.#.#.#.\n.#.#.#.#\n#.#.#.#.\n.#.#.#.#\n#.#.#.#.\n.#.#.#.#\n#.#.#.#.\n", "output": "NO\n"}, {"type": "stdin_stdout", "input": "8 8\n.#.#.#.#\n.#.#.#.#\n.#.#.#.#\n#.#.#.#.\n.#.#.#.#\n#.#.#.#.\n.#.#.#.#\n#.#.#.#.\n", "output": "NO\n"}, {"type": "stdin_stdout", "input": "... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nDanny, the local Math Maniac, is fascinated by circles, Omkar's most recent creation. Help him solve this circle problem!\n\nYou are given $n$ nonnegative integers $a_1, a_2, \\dots, a_n$ arranged in a circle, where $n$ m... | [{"type": "stdin_stdout", "input": "41\n67695023 47580738 52676259 26530025 83455112 2392302 23011073 86422683 148437329 42852564 97383338 95729385 6219705 42027049 79082264 1205076 1191075 18025596 75651485 93690196 63851880 23817841 79285846 9296266 60979868 62770176 40911517 96687661 35967137 55930828 78662969 51939... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nRecently, Tokitsukaze found an interesting game. Tokitsukaze had $n$ items at the beginning of this game. However, she thought there were too many items, so now she wants to discard $m$ ($1 \\le m \\le n$) special items o... | [{"type": "stdin_stdout", "input": "1000000000000000000 20 365\n31881893160049984 103938857870698567 103962228223609431 140762820261865064 175962215264653912 239086305245565642 354522451098745823 383839975876242372 443471287955807705 478923027151493682 511195154588214957 619570919279066139 677571312513476877 7058647976... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nCreate a __moreZeros__ function which will __receive a string__ for input, and __return an array__ (or null terminated string in C) containing only the characters from that string whose __binary representation of its ASCI... | [{"input": "\"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890_\"", "output": "[[\"a\", \"b\", \"d\", \"h\", \"p\", \"A\", \"B\", \"C\", \"D\", \"E\", \"F\", \"H\", \"I\", \"J\", \"L\", \"P\", \"Q\", \"R\", \"T\", \"X\", \"0\"]]", "fn_name": "more_zeros"}, {"input": "\"THEQUICKBROWNFOXJUMPSOVERTHELAZYDOG\... | code_functional |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nYou are a secret agent from the Intelligence Center of Peacemaking Committee. You've just sneaked into a secret laboratory of an evil company, Automated Crime Machines.\n\nYour mission is to get a confidential document ke... | [{"type": "stdin_stdout", "input": "10 1\n3\n1", "output": "Yes\n"}, {"type": "stdin_stdout", "input": "7 1\n6\n-1", "output": "Yes\n"}, {"type": "stdin_stdout", "input": "11 1\n3\n1", "output": "Yes\n"}, {"type": "stdin_stdout", "input": "6 2\n10\n3", "output": "Yes\n"}, {"type": "stdin_stdout", "input": "7 1\n6\n-2",... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nNowadays, most of the internet advertisements are not statically linked to a web page. Instead, what will be shown to the person opening a web page is determined within 100 milliseconds after the web page is opened. Usual... | [{"type": "stdin_stdout", "input": "5\n3778 9170\n2657 6649\n4038 9722\n3392 7255\n4890 8961\n", "output": "6938.4627241726648\n"}, {"type": "stdin_stdout", "input": "5\n4787 9531\n3133 9597\n1754 9725\n4335 7124\n4269 7752\n", "output": "7046.2404831918329\n"}, {"type": "stdin_stdout", "input": "5\n2194 6947\n2062 824... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nValera loves his garden, where n fruit trees grow.\n\nThis year he will enjoy a great harvest! On the i-th tree b_{i} fruit grow, they will ripen on a day number a_{i}. Unfortunately, the fruit on the tree get withered, s... | [{"type": "stdin_stdout", "input": "24 1524\n16 934\n23 1940\n21 1447\n20 417\n24 1340\n22 1932\n13 775\n19 2918\n12 2355\n9 593\n11 2676\n3 1857\n16 868\n13 426\n18 1679\n22 991\n9 2728\n10 2497\n16 1221\n9 772\n23 2522\n24 982\n12 1431\n18 757\n", "output": "25893\n"}, {"type": "stdin_stdout", "input": "24 1524\n16 9... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nYou are given a complete undirected graph. For each pair of vertices you are given the length of the edge that connects them. Find the shortest paths between each pair of vertices in the graph and return the length of the... | [{"type": "stdin_stdout", "input": "10\n0 1 100 100 100 100 100 100 100 100\n1 0 1 100 100 100 100 100 100 100\n100 1 0 1 100 100 100 100 100 100\n100 100 1 0 1 100 100 100 100 100\n100 100 100 1 0 1 100 100 100 100\n100 100 100 100 1 0 1 100 100 100\n100 100 100 100 100 1 0 1 100 100\n100 100 100 100 100 100 1 0 1 100... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nOn a clear night, a boy, Campanella looked up at the sky, there were many stars which have different colors such as red, yellow, green, blue, purple, etc. He was watching the stars and just lost track of time. Presently, ... | [{"type": "stdin_stdout", "input": "8\n1 0 3 3 0 1 14 5\n7\n1 2 -1 8 12 1 5\n0", "output": "NO COLOR\nNO COLOR\n"}, {"type": "stdin_stdout", "input": "8\n1 0 3 3 0 1 14 5\n7\n1 2 -1 8 22 1 5\n0", "output": "NO COLOR\nNO COLOR\n"}, {"type": "stdin_stdout", "input": "8\n1 0 3 3 0 1 14 5\n7\n1 2 -1 8 13 1 5\n0", "output":... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nSanta has to send presents to the kids. He has a large stack of $n$ presents, numbered from $1$ to $n$; the topmost present has number $a_1$, the next present is $a_2$, and so on; the bottom present has number $a_n$. All ... | [{"type": "stdin_stdout", "input": "2\n3 3\n3 1 2\n3 2 1\n7 2\n2 1 7 3 4 5 6\n6 1\n", "output": "5\n14\n"}, {"type": "stdin_stdout", "input": "2\n3 3\n3 1 2\n3 2 1\n7 2\n2 1 7 3 4 5 6\n4 1\n", "output": "5\n10\n"}, {"type": "stdin_stdout", "input": "2\n3 3\n3 1 2\n3 2 1\n7 2\n4 1 7 3 2 5 4\n5 1\n", "output": "5\n12\n"}... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nToday is the ticket release date for Aizu Entertainment's recommended idol group \"Akabeko & Koboushi\". There are four types of tickets:\n\nS seat 6000 yen\nA seat 4000 yen\nB seat 3000 yen\nC seat 2000 yen\n\nYou, the s... | [{"type": "stdin_stdout", "input": "3 57\n1 4\n1 -2\n1 2", "output": "171000\n24000\n-12000\n12000\n"}, {"type": "stdin_stdout", "input": "3 57\n1 3\n1 -2\n1 2", "output": "171000\n18000\n-12000\n12000\n"}, {"type": "stdin_stdout", "input": "3 16\n1 4\n1 -2\n1 5", "output": "48000\n24000\n-12000\n30000\n"}, {"type": "s... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nIn the speed skating badge test, grades are awarded when the time specified for two distances is exceeded. For example, to reach Class A, 500 M requires less than 40.0 seconds and 1000 M requires less than 1 minute and 23... | [{"type": "stdin_stdout", "input": "70.02963720383003 94.72312922368101\n103.91489947609344 168.84078141503855", "output": "NA\nNA\n"}, {"type": "stdin_stdout", "input": "50.825010742906116 75.69989732783311\n82.26479437960049 146.33206365267094", "output": "D\nNA\n"}, {"type": "stdin_stdout", "input": "40.991466890252... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nImp is in a magic forest, where xorangles grow (wut?)\n\n [Image] \n\nA xorangle of order n is such a non-degenerate triangle, that lengths of its sides are integers not exceeding n, and the xor-sum of the lengths is equa... | [{"type": "stdin_stdout", "input": "2500\n", "output": "700393\n"}, {"type": "stdin_stdout", "input": "1216\n", "output": "160822\n"}, {"type": "stdin_stdout", "input": "2140\n", "output": "614785\n"}, {"type": "stdin_stdout", "input": "1488\n", "output": "239580\n"}, {"type": "stdin_stdout", "input": "1040\n", "output... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nYou are given array $a_1, a_2, \\ldots, a_n$, consisting of non-negative integers.\n\nLet's define operation of \"elimination\" with integer parameter $k$ ($1 \\leq k \\leq n$) as follows:\n\nChoose $k$ distinct array ind... | [{"type": "stdin_stdout", "input": "5\n4\n4 4 4 4\n4\n13 7 25 19\n6\n3 5 3 1 7 1\n1\n1\n5\n0 0 0 0 0\n", "output": "1 2 4 \n1 2 \n1 \n1 \n1 2 3 4 5 \n"}, {"type": "stdin_stdout", "input": "5\n4\n4 4 4 4\n4\n13 7 25 19\n6\n3 7 3 1 7 1\n1\n1\n5\n0 0 0 0 0\n", "output": "1 2 4\n1 2\n1 2\n1\n1 2 3 4 5\n"}, {"type": "stdin_... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nThe only difference between the easy and the hard versions is the maximum value of $k$.\n\nYou are given an infinite sequence of form \"112123123412345$\\dots$\" which consist of blocks of all consecutive positive integer... | [{"type": "stdin_stdout", "input": "19\n1\n10\n100\n1000\n10000\n100000\n1000000\n10000000\n100000000\n1000000000\n10000000000\n100000000000\n1000000000000\n10000000000000\n100000000000000\n1000000000000000\n10000000000000000\n100000000000000000\n1000000000000000000\n", "output": "1\n4\n1\n4\n9\n2\n6\n2\n6\n8\n1\n1\n9\... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nCreate a program of the square picking method, which is one of the classical random number generation methods. The square harvesting method was proposed by von Neumann in the mid-1940s.\n\nIn the square picking method, wh... | [{"type": "stdin_stdout", "input": "2\n387\n615", "output": "Case 1:\n1497\n2410\n8081\n3025\n1506\n2680\n1824\n3269\n6863\n1007\nCase 2:\n3782\n3035\n2112\n4605\n2060\n2436\n9340\n2356\n5507\n3270\n"}, {"type": "stdin_stdout", "input": "2\n210\n567", "output": "Case 1:\n441\n1944\n7791\n6996\n9440\n1136\n2904\n4332\n7... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nInaka has a disc, the circumference of which is n units. The circumference is equally divided by n points numbered clockwise from 1 to n, such that points i and i + 1 (1 ≤ i < n) are adjacent, and so are points n and 1.\n... | [{"type": "stdin_stdout", "input": "30000 28\n10601 1119\n11119 20601\n9493 25771\n14351 4869\n13101 3619\n23101 13619\n29869 9351\n6119 15601\n3101 23619\n1851 22369\n11851 2369\n8619 18101\n19579 12933\n18619 28101\n16851 7369\n8101 28619\n24869 4351\n24351 14869\n2690 6851\n9869 19351\n5601 26119\n3976 21301\n21851 ... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nVova has taken his summer practice this year and now he should write a report on how it went.\n\nVova has already drawn all the tables and wrote down all the formulas. Moreover, he has already decided that the report will... | [{"type": "stdin_stdout", "input": "94 3\n4 2 1 6 1 1 1 5 1 3 3 3 6 1 6 6 3 5 3 1 4 1 3 6 4 5 3 4 6 5 5 2 1 5 4 5 6 5 2 2 6 5 4 6 1 3 5 1 2 5 5 2 1 3 4 5 6 4 3 1 4 4 1 5 4 4 2 2 2 4 4 3 6 2 6 1 5 6 1 3 5 5 1 3 5 3 5 2 6 1 3 6 1 5\n5 6 3 5 4 1 4 6 3 1 4 4 3 3 6 2 1 1 4 6 4 2 4 1 3 1 5 3 6 2 5 6 1 6 6 2 2 2 2 5 2 6 1 4 1... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nIn this kata, your task is to identify the pattern underlying a sequence of numbers. For example, if the sequence is [1, 2, 3, 4, 5], then the pattern is [1], since each number in the sequence is equal to the number prece... | [{"input": "[-67, -66, -64, -61, -57, -52, -46, -39, -31, -22, -12, -2, 7, 15, 22, 28, 33, 37, 40, 42, 43]", "output": "[[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1]]", "fn_name": "find_pattern"}, {"input": "[4, 5, 7, 6, 4, 2, 3, 5, 4, 2, 3, 5, 4, 2, 0, 1, 3, 2, 0, 1, 3, 2, 0, -2, -1, 1, 0, -2]", "out... | code_functional |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nIt seems that Borya is seriously sick. He is going visit n doctors to find out the exact diagnosis. Each of the doctors needs the information about all previous visits, so Borya has to visit them in the prescribed order (... | [{"type": "stdin_stdout", "input": "42\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n", "output": "83\n"}, {"type": "stdin_stdout", "input": "42\n1 2\n1 2\... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nConverting a normal (12-hour) time like \"8:30 am\" or \"8:30 pm\" to 24-hour time (like \"0830\" or \"2030\") sounds easy enough, right? Well, let's see if you can do it!\n\nYou will have to define a function named \"to... | [{"input": "12\n10\n\"am\"", "output": "[\"0010\"]", "fn_name": "to24hourtime"}, {"input": "12\n11\n\"am\"", "output": "[\"0011\"]", "fn_name": "to24hourtime"}, {"input": "12\n12\n\"am\"", "output": "[\"0012\"]", "fn_name": "to24hourtime"}, {"input": "12\n13\n\"am\"", "output": "[\"0013\"]", "fn_name": "to24hourtime"},... | code_functional |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nDima has a birthday soon! It's a big day! Saryozha's present to Dima is that Seryozha won't be in the room and won't disturb Dima and Inna as they celebrate the birthday. Inna's present to Dima is a stack, a queue and a d... | [{"type": "stdin_stdout", "input": "55\n73792\n39309\n73808\n47389\n34803\n87947\n32460\n14649\n70151\n35816\n8272\n78886\n71345\n61907\n16977\n85362\n0\n43792\n8118\n83254\n89459\n32230\n87068\n82617\n94847\n83528\n37629\n31438\n97413\n62260\n13651\n47564\n43543\n61292\n51025\n64106\n0\n19282\n35422\n19657\n95170\n102... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\n\"Night gathers, and now my watch begins. It shall not end until my death. I shall take no wife, hold no lands, father no children. I shall wear no crowns and win no glory. I shall live and die at my post. I am the sword ... | [{"type": "stdin_stdout", "input": "205\n5 5 3 3 6 2 9 3 8 9 6 6 10 8 1 5 3 3 1 2 9 9 9 3 9 10 3 9 8 3 5 6 6 4 6 9 2 9 10 9 5 6 6 7 4 2 6 3 4 1 10 1 7 2 7 7 3 2 6 5 5 2 9 3 8 8 7 6 6 4 2 2 6 2 3 5 7 2 2 10 1 4 6 9 2 3 7 2 2 7 4 4 9 10 7 5 8 6 5 3 6 10 2 7 5 6 6 8 3 3 9 4 3 5 7 9 3 2 1 1 3 2 1 9 3 1 4 4 10 2 5 5 8 1 4 8... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nYou can obtain profits from foreign exchange margin transactions. For example, if you buy 1000 dollar at a rate of 100 yen per dollar, and sell them at a rate of 108 yen per dollar, you can obtain (108 - 100) × 1000 = 800... | [{"type": "stdin_stdout", "input": "6\n-10\n38\n2\n4\n-2\n8", "output": "48\n"}, {"type": "stdin_stdout", "input": "6\n-17\n38\n2\n4\n-2\n8", "output": "55\n"}, {"type": "stdin_stdout", "input": "6\n-17\n33\n2\n1\n-3\n8", "output": "50\n"}, {"type": "stdin_stdout", "input": "6\n-17\n61\n2\n1\n-3\n8", "output": "78\n"},... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nSonya was unable to think of a story for this problem, so here comes the formal description.\n\nYou are given the array containing n positive integers. At one turn you can pick any element and increase or decrease it by 1... | [{"type": "stdin_stdout", "input": "75\n392 593 98 1017 515 448 220 310 475 79 539 294 208 828 75 534 875 493 94 205 656 105 546 493 60 188 222 108 788 504 809 621 934 455 307 236 630 298 938 62 850 421 839 134 950 256 934 817 209 559 866 67 990 835 534 672 733 768 757 516 959 893 275 315 692 927 321 554 801 805 885 12... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nConsider the following arithmetic progression with n terms:\n\n* x, x + d, x + 2d, \\ldots, x + (n-1)d\n\n\n\nWhat is the product of all terms in this sequence? Compute the answer modulo 1\\ 000\\ 003.\n\nYou are given Q ... | [{"type": "stdin_stdout", "input": "2\n12 1 5\n42764 449743 2019", "output": "524160\n165266\n"}, {"type": "stdin_stdout", "input": "2\n12 1 5\n42764 376063 2019", "output": "524160\n455865\n"}, {"type": "stdin_stdout", "input": "2\n12 1 5\n23772 376063 2019", "output": "524160\n755257\n"}, {"type": "stdin_stdout", "in... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nYou will be given a vector of strings. You must sort it alphabetically (case-sensitive, and based on the ASCII values of the chars) and then return the first value.\n\nThe returned value must be a string, and have `\"***\... | [{"input": "[\"turns\", \"out\", \"random\", \"test\", \"cases\", \"are\", \"easier\", \"than\", \"writing\", \"out\", \"basic\", \"ones\"]", "output": "[\"a***r***e\"]", "fn_name": "two_sort"}, {"input": "[\"bitcoin\", \"take\", \"over\", \"the\", \"world\", \"maybe\", \"who\", \"knows\", \"perhaps\"]", "output": "[\"... | code_functional |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nA revolution took place on the Buka Island. New government replaced the old one. The new government includes n parties and each of them is entitled to some part of the island according to their contribution to the revolut... | [{"type": "stdin_stdout", "input": "50 50 50 49 26\n205 221 199 178 191 202 180 192 185 204 183 194 215 216 185 200 182 170 190 180 176 204 166 164 194 174\n", "output": "YES\naaaaabbbbccccddddeeffffgggghhhhiiiijjjjkkkkllllmmmmnnnnooooppppqqqqrrrrsssstttuuuvvvvwwwwxxxxyyyyzzz\naaaaabbbbccccddddeeffffgggghhhhiiiijjjjkkk... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nVova's family is building the Great Vova Wall (named by Vova himself). Vova's parents, grandparents, grand-grandparents contributed to it. Now it's totally up to Vova to put the finishing touches.\n\nThe current state of ... | [{"type": "stdin_stdout", "input": "20\n10 5 2 3 5 7 7 9 4 9 9 4 9 7 7 5 3 2 5 10\n", "output": "YES\n"}, {"type": "stdin_stdout", "input": "14\n7 7 7 4 3 3 4 5 4 4 5 7 7 7\n", "output": "YES\n"}, {"type": "stdin_stdout", "input": "14\n7 7 7 4 3 3 4 5 4 8 5 7 7 7\n", "output": "YES\n"}, {"type": "stdin_stdout", "input"... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nDenis, after buying flowers and sweets (you will learn about this story in the next task), went to a date with Nastya to ask her to become a couple. Now, they are sitting in the cafe and finally... Denis asks her to be to... | [{"type": "stdin_stdout", "input": "10 10\n1101001\n0110000\n0111010\n0010000\n1010000\n0111000\n1011011\n1010010\n1101011\n1111110\n", "output": "9941743758\n"}, {"type": "stdin_stdout", "input": "10 10\n0101111\n0000000\n1111011\n1011011\n1011011\n1111011\n0010010\n1010010\n1101111\n0000000\n", "output": "8993391761\... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nThere is a programing contest named SnakeUp, 2n people want to compete for it. In order to attend this contest, people need to form teams of exactly two people. You are given the strength of each possible combination of t... | [{"type": "stdin_stdout", "input": "3\n1000000\n999999 999998\n999997 999996 999995\n999994 999993 999992 999991\n999990 999989 999988 999987 999986\n", "output": "2 1 4 3 6 5\n"}, {"type": "stdin_stdout", "input": "3\n1000000\n999999 999998\n999997 999996 999995\n999994 999993 999992 999991\n999990 999989 999988 99998... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nAlex, Bob and Carl will soon participate in a team chess tournament. Since they are all in the same team, they have decided to practise really hard before the tournament. But it's a bit difficult for them because chess is... | [{"type": "stdin_stdout", "input": "100\n2\n3\n1\n2\n3\n3\n3\n1\n1\n1\n1\n3\n3\n3\n3\n1\n2\n3\n3\n3\n3\n3\n3\n3\n1\n2\n2\n2\n3\n1\n1\n3\n3\n3\n3\n3\n3\n3\n3\n1\n2\n3\n3\n3\n1\n1\n1\n1\n3\n3\n3\n3\n1\n2\n3\n1\n2\n2\n2\n3\n3\n2\n1\n3\n3\n1\n2\n3\n1\n1\n1\n2\n2\n2\n3\n1\n1\n1\n1\n1\n1\n3\n2\n2\n2\n2\n2\n2\n3\n1\n2\n2\n2\n... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nGiven an integer $x$. Your task is to find out how many positive integers $n$ ($1 \\leq n \\leq x$) satisfy $$n \\cdot a^n \\equiv b \\quad (\\textrm{mod}\\;p),$$ where $a, b, p$ are all known constants.\n\n\n-----Input--... | [{"type": "stdin_stdout", "input": "1000002 1000002 1000003 1000000000000\n", "output": "999998\n"}, {"type": "stdin_stdout", "input": "1000002 1000002 1000003 1000000000000\n", "output": "999998\n"}, {"type": "stdin_stdout", "input": "693528 398514 1000003 1000000000000\n", "output": "999995\n"}, {"type": "stdin_stdou... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nImplement `String#ipv4_address?`, which should return true if given object is an IPv4 address - four numbers (0-255) separated by dots.\n\nIt should only accept addresses in canonical representation, so no leading `0`s, s... | [{"input": "\"255.255.255.255\"", "output": "[true]", "fn_name": "ipv4_address"}, {"input": "\"10.256.30.40\"", "output": "[false]", "fn_name": "ipv4_address"}, {"input": "\"10.20.030.40\"", "output": "[false]", "fn_name": "ipv4_address"}, {"input": "\"127.0.0.0.1\"", "output": "[false]", "fn_name": "ipv4_address"}, {"... | code_functional |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nAfter rejecting 10^{100} data structure problems, Errorgorn is very angry at Anton and decided to kill him.\n\nAnton's DNA can be represented as a string a which only contains the characters \"ANTON\" (there are only 4 di... | [{"type": "stdin_stdout", "input": "1\nAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n", "output": "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n"}, {"type": "stdin_stdout", "input": "4\nANTON\nNAAN\nAAAAAA\nOAANTTON\n", "output": "\nNNOTA\nAANN\nAAAAAA\nTNNTAOOA\n"}, {... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nAs a token of his gratitude, Takahashi has decided to give his mother an integer sequence.\nThe sequence A needs to satisfy the conditions below:\n - A consists of integers between X and Y (inclusive).\n - For each 1\\leq... | [{"type": "stdin_stdout", "input": "1000000000000000000 1000000000000000000\n", "output": "1\n"}, {"type": "stdin_stdout", "input": "314159265 358979323846264338\n", "output": "31\n"}, {"type": "stdin_stdout", "input": "275278675 992237867823568722\n", "output": "32\n"}, {"type": "stdin_stdout", "input": "10000 1099511... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nMr. Frugal bought a new house. He feels deeply in love with his new house because it has a comfortable living room in which he can put himself completely at ease. He thinks his new house is a really good buy.\n\nBut, to h... | [{"type": "stdin_stdout", "input": "4 3\n0 1 1 1\n1 1 1 1\n1 1 1 1\n8 5\n0 1 1 1 1 1 1 1\n1 1 1 1 1 1 1 1\n1 0 1 1 1 1 1 1\n1 1 0 0 1 1 1 1\n0 1 1 1 0 1 1 1\n8 8\n0 1 1 0 0 1 1 0\n1 1 1 1 1 1 1 1\n1 1 1 1 1 1 1 1\n0 1 1 0 0 1 1 0\n0 1 1 0 0 1 1 0\n1 1 1 1 1 1 1 1\n1 1 1 1 1 1 1 1\n0 1 1 0 0 1 1 0\n10 10\n1 1 1 1 1 1 1 ... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nThe purpose of this series is developing understanding of stastical problems in AS and A level maths. Let's get started with a simple concept in statistics: Mutually exclusive events.\n\nThe probability of an OR event is ... | [{"input": "[[1, 0.6], [2, 0.1001], [3, 0.0999], [4, 0.1], [5, 0.05], [6, 0.05]]\n3\n4", "output": "[\"0.20\"]", "fn_name": "mutually_exclusive"}, {"input": "[[1, 0.1], [2, 0.14], [3, 0.16], [4, 0.2], [5, 0.15], [6, 0.25]]\n1\n4", "output": "[\"0.30\"]", "fn_name": "mutually_exclusive"}, {"input": "[[6, 0.25], [1, 0.1]... | code_functional |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nA Narcissistic Number is a number of length n in which the sum of its digits to the power of n is equal to the original number. If this seems confusing, refer to the example below.\n\nEx: 153, where n = 3 (number of digit... | [{"input": "115132219018763992565095597973971522401", "output": "[true]", "fn_name": "is_narcissistic"}, {"input": "4679307774", "output": "[true]", "fn_name": "is_narcissistic"}, {"input": "146511208", "output": "[true]", "fn_name": "is_narcissistic"}, {"input": "472335975", "output": "[true]", "fn_name": "is_narcissi... | code_functional |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nDima and his friends have been playing hide and seek at Dima's place all night. As a result, Dima's place got messy. In the morning they decided that they need to clean the place.\n\nTo decide who exactly would clean the ... | [{"type": "stdin_stdout", "input": "100\n3 3 1 4 2 4 4 3 1 5 1 1 4 4 3 4 4 3 5 4 5 2 4 3 4 1 2 4 5 4 2 1 5 4 1 1 4 3 2 4 1 2 1 4 4 5 5 4 4 5 3 2 5 1 4 2 2 1 1 2 5 2 5 1 5 3 1 4 3 2 4 3 2 2 4 5 5 1 2 3 1 4 1 2 2 2 5 5 2 3 2 4 3 1 1 2 1 2 1 2\n", "output": "5\n"}, {"type": "stdin_stdout", "input": "100\n2 1 1 3 5 4 4 2 3... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nWe all know the impressive story of Robin Hood. Robin Hood uses his archery skills and his wits to steal the money from rich, and return it to the poor.\n\nThere are n citizens in Kekoland, each person has ci coins. Each ... | [{"type": "stdin_stdout", "input": "123 54564\n38 44 41 42 59 3 95 15 45 32 44 69 35 83 94 57 65 85 64 47 24 20 34 86 26 91 98 12 36 96 80 4 70 40 95 38 70 22 58 50 34 84 80 45 14 60 61 43 11 56 19 59 50 63 35 15 97 98 27 13 9 71 32 18 90 10 2 99 75 87 74 83 79 37 89 3 49 27 92 95 49 1 26 82 72 75 81 37 60 98 28 28 10 ... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nYou are given two positive integers `a` and `b` (`a < b <= 20000`). Complete the function which returns a list of all those numbers in the interval `[a, b)` whose digits are made up of prime numbers (`2, 3, 5, 7`) but whi... | [{"input": "999\n2500", "output": "[[2222, 2223, 2225, 2227, 2232, 2233, 2235, 2252, 2253, 2255, 2257, 2272, 2275, 2277, 2322, 2323, 2325, 2327, 2332, 2335, 2337, 2352, 2353, 2355, 2372, 2373, 2375]]", "fn_name": "not_primes"}, {"input": "500\n999", "output": "[[522, 525, 527, 532, 533, 535, 537, 552, 553, 555, 572, 57... | code_functional |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nIn Berland each high school student is characterized by academic performance — integer value between 1 and 5.\n\nIn high school 0xFF there are two groups of pupils: the group A and the group B. Each group consists of exac... | [{"type": "stdin_stdout", "input": "100\n5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5\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 ... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nA star is a figure of the following type: an asterisk character '*' in the center of the figure and four rays (to the left, right, top, bottom) of the same positive length. The size of a star is the length of its rays. Th... | [{"type": "stdin_stdout", "input": "100 3\n.*.\n***\n***\n***\n***\n***\n***\n***\n***\n***\n***\n***\n***\n***\n***\n***\n***\n***\n***\n***\n***\n***\n***\n***\n***\n***\n***\n***\n***\n***\n***\n***\n***\n***\n***\n***\n***\n***\n***\n***\n***\n***\n***\n***\n***\n***\n***\n***\n***\n***\n***\n***\n***\n***\n***\n**... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nMothers arranged a dance party for the children in school. At that party, there are only mothers and their children. All are having great fun on the dance floor when suddenly all the lights went out. It's a dark night and... | [{"input": "\"AaaaaZazzz\"", "output": "[\"AaaaaaZzzz\"]", "fn_name": "find_children"}, {"input": "\"CbcBcbaA\"", "output": "[\"AaBbbCcc\"]", "fn_name": "find_children"}, {"input": "\"xXfuUuuF\"", "output": "[\"FfUuuuXx\"]", "fn_name": "find_children"}, {"input": "\"abBA\"", "output": "[\"AaBb\"]", "fn_name": "find_chi... | code_functional |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nDo you know the story about the three musketeers? Anyway, you must help them now.\n\nRichelimakieu is a cardinal in the city of Bearis. He found three brave warriors and called them the three musketeers. Athos has strengt... | [{"type": "stdin_stdout", "input": "30\n34938093 71279712 25853338\n29827587 21741565 52179990 30235076 83272806 10815432 98887688 94542207 99870240 97586453 21739186 30460781 75347784 50711354 12162179 74306503 97398492 88466481 52489587 67579359 53177356 75077523 86044366 14405531 73916272 78242091 49321886 41937821 ... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nConsider the following series:\n\n`0,1,2,3,4,5,6,7,8,9,10,22,11,20,13,24...`There is nothing special between numbers `0` and `10`. \n\nLet's start with the number `10` and derive the sequence. `10` has digits `1` and `0`.... | [{"input": "100", "output": "[103]", "fn_name": "find_num"}, {"input": "500", "output": "[476]", "fn_name": "find_num"}, {"input": "11", "output": "[22]", "fn_name": "find_num"}, {"input": "1", "output": "[1]", "fn_name": "find_num"}, {"input": "5", "output": "[5]", "fn_name": "find_num"}] | code_functional |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nKostya likes Codeforces contests very much. However, he is very disappointed that his solutions are frequently hacked. That's why he decided to obfuscate (intentionally make less readable) his code before upcoming contest... | [{"type": "stdin_stdout", "input": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nPolycarpus got an internship in one well-known social network. His test task is to count the number of unique users who have visited a social network during the day. Polycarpus was provided with information on all user re... | [{"type": "stdin_stdout", "input": "10 3 30000\n00:06:54\n00:42:06\n03:49:45\n04:38:35\n05:33:30\n05:51:46\n10:46:34\n14:34:59\n14:40:06\n14:53:13\n", "output": "6\n1\n2\n3\n3\n3\n3\n4\n5\n6\n6\n"}, {"type": "stdin_stdout", "input": "10 3 30000\n00:06:54\n00:42:06\n03:49:45\n04:38:35\n05:33:30\n05:51:46\n10:46:34\n14:3... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nYou are given four digits N_1, N_2, N_3 and N_4. Determine if these can be arranged into the sequence of digits \"1974\".\n\nConstraints\n\n* 0 \\leq N_1, N_2, N_3, N_4 \\leq 9\n* N_1, N_2, N_3 and N_4 are integers.\n\nIn... | [{"type": "stdin_stdout", "input": "-1 3 13 -1", "output": "NO\n"}, {"type": "stdin_stdout", "input": "-1 2 13 -1", "output": "NO\n"}, {"type": "stdin_stdout", "input": "-1 2 17 -1", "output": "NO\n"}, {"type": "stdin_stdout", "input": "-1 2 -1 24", "output": "NO\n"}, {"type": "stdin_stdout", "input": "-1 2 17 -2", "ou... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nYou are given two strings $s$ and $t$, both consisting only of lowercase Latin letters.\n\nThe substring $s[l..r]$ is the string which is obtained by taking characters $s_l, s_{l + 1}, \\dots, s_r$ without changing the or... | [{"type": "stdin_stdout", "input": "11 3 66\nssszzzzsssz\nsss\n1 1\n1 2\n2 2\n1 3\n2 3\n3 3\n1 4\n2 4\n3 4\n4 4\n1 5\n2 5\n3 5\n4 5\n5 5\n1 6\n2 6\n3 6\n4 6\n5 10\n6 6\n1 7\n2 7\n3 7\n4 7\n5 7\n6 7\n7 7\n1 8\n2 8\n3 8\n4 8\n5 8\n6 8\n7 8\n8 8\n1 9\n2 9\n3 9\n4 9\n5 9\n6 9\n7 9\n8 9\n9 9\n1 10\n2 10\n3 10\n4 10\n5 10\n6... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nWhile Vasya finished eating his piece of pizza, the lesson has already started. For being late for the lesson, the teacher suggested Vasya to solve one interesting problem. Vasya has an array a and integer x. He should fi... | [{"type": "stdin_stdout", "input": "100 2 1\n1 2 2 2 1 2 1 2 2 2 2 1 2 1 1 2 1 2 2 1 1 2 1 1 2 2 1 1 2 1 2 2 2 2 2 1 1 1 2 1 2 1 2 1 2 1 2 2 1 2 2 2 1 1 1 2 2 1 1 2 2 1 1 1 1 1 1 2 2 1 1 2 2 1 2 2 1 2 1 2 2 1 2 1 1 1 2 2 1 1 2 1 2 2 1 1 2 2 2 1\n", "output": "5200\n"}, {"type": "stdin_stdout", "input": "100 2 1\n1 2 2 ... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nLittle Petya very much likes gifts. Recently he has received a new laptop as a New Year gift from his mother. He immediately decided to give it to somebody else as what can be more pleasant than giving somebody gifts. And... | [{"type": "stdin_stdout", "input": "100\n42 23 48 88 36 6 18 70 96 1 34 40 46 22 39 55 85 93 45 67 71 75 59 9 21 3 86 63 65 68 20 38 73 31 84 90 50 51 56 95 72 33 49 19 83 76 54 74 100 30 17 98 15 94 4 97 5 99 81 27 92 32 89 12 13 91 87 29 60 11 52 43 35 58 10 25 16 80 28 2 44 61 8 82 66 69 41 24 57 62 78 37 79 77 53 7... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nE869120 found a chest which is likely to contain treasure.\n\nHowever, the chest is locked. In order to open it, he needs to enter a string S consisting of lowercase English letters.\n\nHe also found a string S', which tu... | [{"type": "stdin_stdout", "input": "??p??d??\nabc\n", "output": "UNRESTORABLE\n"}, {"type": "stdin_stdout", "input": "?tc??@?\ncoder", "output": "UNRESTORABLE\n"}, {"type": "stdin_stdout", "input": "?tc??@?\ncnder", "output": "UNRESTORABLE\n"}, {"type": "stdin_stdout", "input": "?tc??@?\nendcr", "output": "UNRESTORABLE... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\n## Introduction\n\n\nEach chemical element in its neutral state has a specific number of electrons associated with it. This is represented by the **atomic number** which is noted by an integer number next to or above each... | [{"input": "\"Br\"", "output": "[\"Br -> 1s2 2s2 2p6 3s2 3p6 3d10 4s2 4p5\"]", "fn_name": "get_electron_configuration"}, {"input": "\"Cr\"", "output": "[\"Cr -> 1s2 2s2 2p6 3s2 3p6 3d5 4s1\"]", "fn_name": "get_electron_configuration"}, {"input": "\"V\"", "output": "[\"V -> 1s2 2s2 2p6 3s2 3p6 3d3 4s2\"]", "fn_name": "g... | code_functional |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nToday we will be playing a red and white colouring game (no, this is not the Russian Civil War; these are just the colours of the Canadian flag).\n\nYou are given an $n \\times m$ grid of \"R\", \"W\", and \".\" character... | [{"type": "stdin_stdout", "input": "3\n4 6\n.R....\n......\n......\n.W....\n4 4\nR..W\n....\n....\n....\n5 1\nR\nW\nR\nW\nR\n", "output": "YES\nWRWRWR\nRWRWRW\nWRWRWR\nRWRWRW\nYES\nRWRW\nWRWR\nRWRW\nWRWR\nYES\nR\nW\nR\nW\nR\n"}, {"type": "stdin_stdout", "input": "3\n4 6\n.R....\n......\n......\n.W....\n4 4\n.R.W\n....\... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nGood evening, contestants.\n\nIf a and d are relatively prime positive integers, the arithmetic sequence beginning with a and increasing by d, i.e., a, a + d, a + 2d, a + 3d, a + 4d, ..., contains infinitely many prime nu... | [{"type": "stdin_stdout", "input": "367 186 151\n179 10 203\n271 37 39\n103 230 1\n27 104 285\n253 50 85\n1 1 1\n9075 337 210\n307 40 79\n331 221 177\n259 170 40\n269 75 102\n0 0 0", "output": "92809\n6709\n12037\n103\n153739\n14503\n2\n899429\n10667\n412717\n22699\n38669\n"}, {"type": "stdin_stdout", "input": "367 186... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nProblem\n\nThere are $ N $ Amidakuji with 3 vertical lines.\nNo matter which line you start from, the Amidakuji that ends at the starting line is considered a good Amidakuji.\nYou can select one or more Amidakuji and conn... | [{"type": "stdin_stdout", "input": "3\n3 -1 0\n0 1\n1 2 -1 1 2 0", "output": "yes\n"}, {"type": "stdin_stdout", "input": "3\n3 -1 0\n0 1\n1 2 -1 1 2 1", "output": "yes\n"}, {"type": "stdin_stdout", "input": "3\n3 -1 0\n0 1\n1 2 -1 1 3 1", "output": "yes\n"}, {"type": "stdin_stdout", "input": "3\n3 -1 0\n0 1\n1 2 -1 2 3... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nArray inversion indicates how far the array is from being sorted.\n\nInversions are pairs of elements in array that are out of order.\n\n## Examples\n\n```\n[1, 2, 3, 4] => 0 inversions\n[1, 3, 2, 4] => 1 inversion: 2... | [{"input": "[6, 5, 4, 3, 3, 3, 3, 2, 1]", "output": "[30]", "fn_name": "count_inversions"}, {"input": "[6, 5, 4, 3, 2, 1]", "output": "[15]", "fn_name": "count_inversions"}, {"input": "[1, 2, 3]", "output": "[0]", "fn_name": "count_inversions"}, {"input": "[2, 1, 3]", "output": "[1]", "fn_name": "count_inversions"}, {"... | code_functional |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nProblem statement\n\nN first-year students of the Faculty of Information Science and Technology of R University take the final exam of the lecture called Programming Exercise 1. The test is a perfect score of m. In other ... | [{"type": "stdin_stdout", "input": "89 111", "output": "0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 11... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nA palindrome is a string $t$ which reads the same backward as forward (formally, $t[i] = t[|t| + 1 - i]$ for all $i \\in [1, |t|]$). Here $|t|$ denotes the length of a string $t$. For example, the strings 010, 1001 and 0 ... | [{"type": "stdin_stdout", "input": "11\n4\n0\n1\n1\n0\n2\n0001000\n0000000000000\n2\n1\n0\n1\n1\n1\n0\n2\n11\n00\n2\n111\n000\n2\n111\n00\n2\n00\n111\n2\n11111\n00\n2\n00000100000\n000\n", "output": "4\n2\n2\n1\n1\n2\n2\n2\n2\n2\n2\n"}, {"type": "stdin_stdout", "input": "11\n4\n0\n1\n1\n0\n2\n0001000\n0000000000000\n2\... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nSearch trees are data structures that support dynamic set operations including insert, search, delete and so on. Thus a search tree can be used both as a dictionary and as a priority queue.\n\nBinary search tree is one of... | [{"type": "stdin_stdout", "input": "8\ninsert 30\ninsert 113\ninsert 18\ninsert 1\ninsert 20\ninsert 17\ninsert 25\nprint", "output": " 1 17 18 20 25 30 113\n 30 18 1 17 20 25 113\n"}, {"type": "stdin_stdout", "input": "8\ninsert 30\ninsert 166\ninsert 12\ninsert 1\ninsert 20\ninsert 17\ninsert 19\nprint", "output": " ... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nTaro is going to play a card game. However, now he has only n cards, even though there should be 52 cards (he has no Jokers).\n\nThe 52 cards include 13 ranks of each of the four suits: spade, heart, club and diamond.\n\n... | [{"type": "stdin_stdout", "input": "47\nS 10\nS 11\nS 12\nS 13\nH 1\nH 2\nS 6\nS 7\nS 8\nS 9\nH 6\nH 8\nH 9\nH 10\nH 11\nH 4\nH 7\nS 2\nS 3\nS 4\nS 5\nH 12\nH 13\nC 1\nC 2\nD 1\nD 2\nD 3\nD 4\nD 5\nD 6\nD 7\nC 3\nC 4\nC 5\nC 6\nC 7\nC 8\nC 9\nC 10\nC 11\nC 13\nD 9\nD 10\nD 11\nD 12\nD 13", "output": "S 1\nH 3\nH 5\nC 1... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nChaneka has a hobby of playing with animal toys. Every toy has a different fun value, a real number. Chaneka has four boxes to store the toys with specification: The first box stores toys with fun values in range of $(-... | [{"type": "stdin_stdout", "input": "2\n4 0 0 1\n0 0 1 0\n", "output": "Tidak Tidak Tidak Ya\nTidak Tidak Ya Tidak\n"}, {"type": "stdin_stdout", "input": "2\n4 0 0 1\n0 1 1 0\n", "output": "Tidak Tidak Tidak Ya\nTidak Ya Tidak Tidak\n"}, {"type": "stdin_stdout", "input": "2\n2 0 0 1\n0 1 0 0\n", "output": "Tidak Tidak T... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nJust in case somebody missed it: this winter is totally cold in Nvodsk! It is so cold that one gets funny thoughts. For example, let's say there are strings with the length exactly n, based on the alphabet of size m. Any ... | [{"type": "stdin_stdout", "input": "1984 1110 1992\n", "output": "102579360\n"}, {"type": "stdin_stdout", "input": "1984 1847 1992\n", "output": "345702953"}, {"type": "stdin_stdout", "input": "1000 1000 1000\n", "output": "850431726"}, {"type": "stdin_stdout", "input": "1999 2000 2000\n", "output": "675798323"}, {"typ... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nWrite a function that takes a string and returns an array of the repeated characters (letters, numbers, whitespace) in the string.\n\nIf a charater is repeated more than once, only show it once in the result array.\n\nCha... | [{"input": "\"limbojackassin the garden\"", "output": "[[\"a\", \"s\", \"i\", \" \", \"e\", \"n\"]]", "fn_name": "remember"}, {"input": "\"kamehameha\"", "output": "[[\"a\", \"m\", \"e\", \"h\"]]", "fn_name": "remember"}, {"input": "\"11 pinguin\"", "output": "[[\"1\", \"i\", \"n\"]]", "fn_name": "remember"}, {"input":... | code_functional |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nZS the Coder has drawn an undirected graph of n vertices numbered from 0 to n - 1 and m edges between them. Each edge of the graph is weighted, each weight is a positive integer.\n\nThe next day, ZS the Coder realized tha... | [{"type": "stdin_stdout", "input": "7 9 999999999 0 3\n0 1 0\n1 2 0\n2 3 0\n0 4 1\n4 1 1\n1 5 499999999\n5 2 499999999\n2 6 1\n6 3 1\n", "output": "YES\n0 1 1\n1 2 999999996\n2 3 999999997\n0 4 1\n4 1 1\n1 5 499999999\n5 2 499999999\n2 6 1\n6 3 1\n"}, {"type": "stdin_stdout", "input": "7 9 999999999 0 3\n0 1 0\n1 2 0\n... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nSchool holidays come in Berland. The holidays are going to continue for n days. The students of school №N are having the time of their lives and the IT teacher Marina Sergeyevna, who has spent all the summer busy checking... | [{"type": "stdin_stdout", "input": "100 50\n1 8\n9 12\n13 19\n20 22\n23 27\n28 31\n32 36\n36 40\n40 43\n47 47\n48 51\n51 55\n62 63\n69 77\n77 84\n85 90\n98 99\n100 100\n100 100\n100 100\n100 100\n100 100\n100 100\n100 100\n100 100\n100 100\n100 100\n100 100\n100 100\n100 100\n100 100\n100 100\n100 100\n100 100\n100 100... | code_stdio |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.