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\nValery is very interested in magic. Magic attracts him so much that he sees it everywhere. He explains any strange and weird phenomenon through intervention of supernatural forces. But who would have thought that even in ... | [{"type": "stdin_stdout", "input": "150\n0 -2 1 -2 0 0 0 0 -2 0 -2 -1 0 0 2 0 1 -2 1 -1 0 0 0 2 -2 2 -1 0 0 -1 -2 0 2 0 1 0 -2 0 -2 -1 0 -2 -2 2 0 0 1 -2 -2 -1 -2 0 2 1 1 -1 1 0 -2 2 0 0 0 1 -1 0 -2 -1 0 -2 1 1 1 0 0 2 0 0 2 -1 0 0 2 0 2 0 -2 -1 1 -2 1 0 0 -2 -1 -1 0 0 2 -1 -1 -1 -1 -2 0 0 2 -1 -1 1 0 0 1 -1 0 0 -1 2 2... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nJabber ID on the national Berland service «Babber» has a form <username>@<hostname>[/resource], where \n\n * <username> — is a sequence of Latin letters (lowercase or uppercase), digits or underscores characters «_», the... | [{"type": "stdin_stdout", "input": "IGsma3L6YTJRrXS@1g.yR3mC.c.xoCns7Wo1.9C.Oe.5ebkR/_97Ltj3\n", "output": "YES\n"}, {"type": "stdin_stdout", "input": "IGsma3K6YTJRrXS@1g.yR3mC.c.xoCns7Wo1.9C.Oe.5ebkR/_97Ltj3\n", "output": "YES\n"}, {"type": "stdin_stdout", "input": "POTjlYcxAZsbyZPDh@sPm.z6aVaO.H1wEUhD9YvROQFUk/M_jTHS... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nSnuke has a fair N-sided die that shows the integers from 1 to N with equal probability and a fair coin. He will play the following game with them:\n - Throw the die. The current score is the result of the die.\n - As lon... | [{"type": "stdin_stdout", "input": "10000 100000\n", "output": "0.036463721466\n"}, {"type": "stdin_stdout", "input": "3904 16384\n", "output": "0.081316166237\n"}, {"type": "stdin_stdout", "input": "100000 5\n", "output": "0.999973749998\n"}, {"type": "stdin_stdout", "input": "97392 33\n", "output": "0.999781007423\n"... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nOh, New Year. The time to gather all your friends and reflect on the heartwarming events of the past year...\n\n$n$ friends live in a city which can be represented as a number line. The $i$-th friend lives in a house with... | [{"type": "stdin_stdout", "input": "10\n10 7 10 10 7 10 7 7 10 10\n", "output": "2 6\n"}, {"type": "stdin_stdout", "input": "10\n10 7 10 10 7 10 7 7 10 10\n", "output": "2 6\n"}, {"type": "stdin_stdout", "input": "10\n10 7 10 10 7 10 7 5 10 10\n", "output": "2 7\n"}, {"type": "stdin_stdout", "input": "10\n1 2 3 4 5 6 7... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\n# Rock Paper Scissors\n\nLet's play! You have to return which player won! In case of a draw return `Draw!`.\n\nExamples:\n\n\n\nWrite your solution by modifying this cod... | [{"input": "\"scissors\"\n\"paper\"", "output": "[\"Player 1 won!\"]", "fn_name": "rps"}, {"input": "\"paper\"\n\"scissors\"", "output": "[\"Player 2 won!\"]", "fn_name": "rps"}, {"input": "\"rock\"\n\"scissors\"", "output": "[\"Player 1 won!\"]", "fn_name": "rps"}, {"input": "\"scissors\"\n\"rock\"", "output": "[\"Pla... | code_functional |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nGiven a string (`str`) containing a base-10 integer between `0` and `10000`, convert the integer to its binary representation. At that point, obtain a count of the maximum amount of consecutive 0s. From there, return the ... | [{"input": "\"8192\"", "output": "[\"Thirteen\"]", "fn_name": "max_consec_zeros"}, {"input": "\"2048\"", "output": "[\"Eleven\"]", "fn_name": "max_consec_zeros"}, {"input": "\"4096\"", "output": "[\"Twelve\"]", "fn_name": "max_consec_zeros"}, {"input": "\"6144\"", "output": "[\"Eleven\"]", "fn_name": "max_consec_zeros"... | code_functional |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nYou are given a text that consists of lowercase Latin letters, spaces and punctuation marks (dot, comma, exclamation mark and question mark). A word is defined as a sequence of consecutive Latin letters.\n\nYour task is t... | [{"type": "stdin_stdout", "input": "ajdwlf ibvlfqadt sqdn aoj nsjtivfrsp !mquqfgzrbp w ow aydap ry s . jwlvg ? ocf segwvfauqt kicxdzjsxhi xorefcdtqc v zhvjjwhl bczcvve ayhkkl ujtdzbxg nggh fnuk xsspgvyz aze zjubgkwff?hgj spteldqbdo vkxtgnl uxckibqs vpzeaq roj ... | code_stdio |
[
{
"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 develop physical strength and judgment by running on a straight... | [{"type": "stdin_stdout", "input": "3 1 1 2 3 110\n49\n50\n51", "output": "53.6666666667\n"}, {"type": "stdin_stdout", "input": "3 0 1 2 3 100\n49\n50\n74", "output": "48.8333333333\n"}, {"type": "stdin_stdout", "input": "3 1 2 2 3 100\n49\n50\n51", "output": "47.6666666667\n"}, {"type": "stdin_stdout", "input": "3 1 1... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nYou are planning to buy an apartment in a $n$-floor building. The floors are numbered from $1$ to $n$ from the bottom to the top. At first for each floor you want to know the minimum total time to reach it from the first ... | [{"type": "stdin_stdout", "input": "10 2\n7 6 15 6 16 18 2 17 17\n12 11 3 10 9 1 10 1 5\n", "output": "0 7 13 18 24 35 36 38 41 46\n"}, {"type": "stdin_stdout", "input": "10 2\n7 6 18 6 16 18 1 17 17\n6 9 3 10 9 1 10 1 5\n", "output": "0 7 13 18 24 35 36 37 40 45 \n"}, {"type": "stdin_stdout", "input": "10 2\n7 6 18 6 ... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nHow many ways are there to choose two distinct positive integers totaling N, disregarding the order?\n\nConstraints\n\n* 1 \\leq N \\leq 10^6\n* N is an integer.\n\nInput\n\nInput is given from Standard Input in the follo... | [{"type": "stdin_stdout", "input": "3256265", "output": "1628132\n"}, {"type": "stdin_stdout", "input": "1527191", "output": "763595\n"}, {"type": "stdin_stdout", "input": "1743342", "output": "871670\n"}, {"type": "stdin_stdout", "input": "1412384", "output": "706191\n"}, {"type": "stdin_stdout", "input": "1339977", "... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nBerland is going through tough times — the dirt price has dropped and that is a blow to the country's economy. Everybody knows that Berland is the top world dirt exporter!\n\nThe President of Berland was forced to leave o... | [{"type": "stdin_stdout", "input": "100\n-683 303 245 -975 345 -159 529 -752 -349 -318 -275 -62 -449 -601 -687 691 491 -261 -576 425 -468 -235 446 536 143 152 -402 -491 363 -842 676 360 -461 -170 727 53 10 823 665 716 110 450 -154 -265 -926 636 -577 99 -719 -786 373 -286 994 -756 644 -800 220 -771 860 610 -613 -51 -398... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nTwo players are playing a game. First each of them writes an integer from 1 to 6, and then a dice is thrown. The player whose written number got closer to the number on the dice wins. If both payers have the same differen... | [{"type": "stdin_stdout", "input": "2 5\n", "output": "3 0 3\n"}, {"type": "stdin_stdout", "input": "2 4\n", "output": "2 1 3\n"}, {"type": "stdin_stdout", "input": "5 3\n", "output": "2 1 3\n"}, {"type": "stdin_stdout", "input": "1 6\n", "output": "3 0 3\n"}, {"type": "stdin_stdout", "input": "5 1\n", "output": "3 1 2... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nIn number world, two different numbers are friends if they have a lot in common, but also each one has unique perks.\n\nMore precisely, two different numbers $a$ and $b$ are friends if $gcd(a,b)$, $\\frac{a}{gcd(a,b)}$, $... | [{"type": "stdin_stdout", "input": "100\n42 486 341 527 189 740 490 388 989 489 711 174 305 844 971 492 998 954 832 442 424 619 906 154 293 395 439 735 738 915 453 748 786 550 871 932 693 326 53 904 732 835 354 364 691 669 203 719 282 875 573 672 695 640 58 872 732 751 557 779 102 39 213 844 289 137 50 951 284 671 474 ... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nThe best night ever in the world has come! It's 8 p.m. of December 24th, yes, the night of Cristmas Eve. Santa Clause comes to a silent city with ringing bells. Overtaking north wind, from a sleigh a reindeer pulls she sh... | [{"type": "stdin_stdout", "input": "3 2 1\n0 1 1\n1 2 3\n1\n4 5 2\n0 1 1\n0 2 1\n1 2 1\n1 3 1\n2 3 2\n1\n2\n0 -1 0", "output": "1.000000000\n\n1.000000000\n0.000000000\n\n"}, {"type": "stdin_stdout", "input": "3 2 1\n0 1 2\n1 2 3\n1\n4 5 2\n0 1 1\n0 2 1\n1 2 1\n1 3 1\n2 3 1\n1\n2\n0 0 1", "output": "1.000000000\n\n0.50... | 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\nPhantasialand boasts of its famous theme park. The park is frequently visited. It is quite large park that some tourists visit it more than... | [{"type": "stdin_stdout", "input": "4\n1 -1 12 11", "output": "12\n"}, {"type": "stdin_stdout", "input": "4\n1 -2 12 11", "output": "11\n"}, {"type": "stdin_stdout", "input": "4\n-1 -1 0 36", "output": "17\n"}, {"type": "stdin_stdout", "input": "4\n-2 -2 0 36", "output": "16\n"}, {"type": "stdin_stdout", "input": "4\n-... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nYou are given an array $a$ consisting of $n$ integers.\n\nYour task is to say the number of such positive integers $x$ such that $x$ divides each number from the array. In other words, you have to find the number of commo... | [{"type": "stdin_stdout", "input": "6\n10000100623 10000100623 10000100623 10000100623 10000100623 10000100623\n", "output": "2\n"}, {"type": "stdin_stdout", "input": "6\n10000100623 10000100623 10000100623 10000100623 10000100623 10000100623\n", "output": "2\n"}, {"type": "stdin_stdout", "input": "5\n153965681607 9999... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nCount the number of distinct sequences a_1, a_2, ..., a_{n} (1 ≤ a_{i}) consisting of positive integers such that gcd(a_1, a_2, ..., a_{n}) = x and $\\sum_{i = 1}^{n} a_{i} = y$. As this number could be large, print the a... | [{"type": "stdin_stdout", "input": "495219 444706662\n", "output": "115165527\n"}, {"type": "stdin_stdout", "input": "495219 444706662\n", "output": "115165527\n"}, {"type": "stdin_stdout", "input": "1000000000 1000000000\n", "output": "1\n"}, {"type": "stdin_stdout", "input": "9357 18255507\n", "output": "745979764\n"... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nThere is a grid with N rows and N columns of squares. Let (i, j) be the square at the i-th row from the top and the j-th column from the left.\nEach of the central (N-2) \\times (N-2) squares in the grid has a black stone... | [{"type": "stdin_stdout", "input": "176527 15\n1 81279\n2 22308\n2 133061\n1 80744\n2 44603\n1 170938\n2 139754\n2 15220\n1 172794\n1 159290\n2 156968\n1 56426\n2 77429\n1 97459\n2 71282\n", "output": "31159505795\n"}, {"type": "stdin_stdout", "input": "176527 15\n2 81279\n2 22308\n2 145342\n1 106634\n2 60988\n1 170938... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nWorking from left-to-right if no digit is exceeded by the digit to its left it is called an increasing number; for example, 134468.\n\nSimilarly if no digit is exceeded by the digit to its right it is called a decreasing ... | [{"input": "0.75", "output": "[3088]", "fn_name": "bouncy_ratio"}, {"input": "0.9", "output": "[21780]", "fn_name": "bouncy_ratio"}, {"input": "0.15", "output": "[160]", "fn_name": "bouncy_ratio"}, {"input": "0.1", "output": "[132]", "fn_name": "bouncy_ratio"}, {"input": "0.5", "output": "[538]", "fn_name": "bouncy_rat... | code_functional |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nThere is an apple tree that bears apples of N colors. The N colors of these apples are numbered 1 to N, and there are a_i apples of Color i.\n\nYou and Lunlun the dachshund alternately perform the following operation (sta... | [{"type": "stdin_stdout", "input": "3\n000000\n24912\n20652", "output": "second\n"}, {"type": "stdin_stdout", "input": "3\n100000\n30000\n29639", "output": "first\n"}, {"type": "stdin_stdout", "input": "3\n000000\n30000\n29639", "output": "first\n"}, {"type": "stdin_stdout", "input": "3\n000001\n30000\n29639", "output"... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nYou will be given a contest schedule for D days and M queries of schedule modification. In the i-th query, given integers d_i and q_i, change the type of contest to be held on day d_i to q_i, and then output the final sat... | [{"type": "stdin_stdout", "input": "5\n86 90 69 51 2 96 71 47 88 34 45 46 89 34 31 38 97 84 41 80 14 4 50 83 7 82\n19771 12979 18912 10432 10544 12928 13403 3047 10527 9740 8100 92 2856 14730 1396 15905 6534 4650 11469 3628 8433 2994 10899 16396 18355 11424\n6674 17707 13855 16407 12232 2886 11908 1705 5000 1537 10440 ... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nThese days Arkady works as an air traffic controller at a large airport. He controls a runway which is usually used for landings only. Thus, he has a schedule of planes that are landing in the nearest future, each landing... | [{"type": "stdin_stdout", "input": "66 20\n0 16\n0 45\n0 58\n1 6\n1 19\n2 7\n2 9\n3 9\n3 25\n3 57\n4 38\n4 58\n5 21\n5 40\n6 16\n6 19\n6 58\n7 6\n7 26\n7 51\n8 13\n8 36\n8 55\n9 1\n9 15\n9 33\n10 12\n10 37\n11 15\n11 34\n12 8\n12 37\n12 55\n13 26\n14 0\n14 34\n14 36\n14 48\n15 23\n15 29\n15 43\n16 8\n16 41\n16 45\n17 5... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\n# Definition\n\n**_Disarium number_** is the number that *The sum of its digits powered with their respective positions is equal to the number itself*.\n\n____\n\n# Task\n\n**_Given_** a number, **_Find if it is Disarium ... | [{"input": "2646798", "output": "[\"Disarium !!\"]", "fn_name": "disarium_number"}, {"input": "1306", "output": "[\"Disarium !!\"]", "fn_name": "disarium_number"}, {"input": "2427", "output": "[\"Disarium !!\"]", "fn_name": "disarium_number"}, {"input": "1048576", "output": "[\"Not !!\"]", "fn_name": "disarium_number"}... | code_functional |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nLet’s get to know our hero: Agent #134 - Mr. Slayer.\n\nHe was sent by his CSV agency to Ancient Rome in order to resolve some important national issues. However, something incredible has happened - the enemies have taken... | [{"input": "\"ksdjai8983hdk?}{\"\n15", "output": "[\"zHsypx8983wsz?}{\"]", "fn_name": "caesar_crypto_encode"}, {"input": "\"eBIIL TLOIA!\"\n-127", "output": "[\"Hello world!\"]", "fn_name": "caesar_crypto_encode"}, {"input": "\"Hello world!\"\n127", "output": "[\"eBIIL TLOIA!\"]", "fn_name": "caesar_crypto_encode"}, {"... | code_functional |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nFor long time scientists study the behavior of sharks. Sharks, as many other species, alternate short movements in a certain location and long movements between locations.\n\nMax is a young biologist. For $n$ days he watc... | [{"type": "stdin_stdout", "input": "127\n64 96 63 112 62 95 61 120 60 94 59 111 58 93 57 124 56 92 55 110 54 91 53 119 52 90 51 109 50 89 49 126 48 88 47 108 46 87 45 118 44 86 43 107 42 85 41 123 40 84 39 106 38 83 37 117 36 82 35 105 34 81 33 127 32 80 31 104 30 79 29 116 28 78 27 103 26 77 25 122 24 76 23 102 22 75 ... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nA linear congruential generator produces a series R(⋅) of pseudo-random numbers by the following for- mulas:\n\n<image>\n\nwhere S, A, C, and M are all parameters. In this problem, 0 ≤ S, A, C ≤ 15 and M = 256.\n\nNow sup... | [{"type": "stdin_stdout", "input": "5\n0 1 3 11 0\n5\n-1 12 2 0 7\n10\n46 2 28 27 203 31 14 81 122 141\n0", "output": "9 15 10\n6 11 13\n6 13 6\n"}, {"type": "stdin_stdout", "input": "5\n10 4 3 3 1\n5\n7 12 2 0 7\n10\n372 8 42 18 176 40 12 56 169 141\n0", "output": "0 1 1\n6 11 13\n0 15 15\n"}, {"type": "stdin_stdout",... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nMany internet protocols these days include the option of associating a\nmedia type with the content being sent.\nThe type is usually inferred from the file extension.\nYou are to write a program that facilitates the looku... | [{"type": "stdin_stdout", "input": "3 7\nhtml lmth/txft\nlht text/itml\ngnp image/png\nsug lmx+gvt/ehami\ntxt text/plajn\nindex.html\nthis.file.has.lots.of.dots.txt\nnoaotsdsall\nvires.uxe\ndont.let.the.png.fool.you\ncXT.trettam.esaT", "output": "unknown\nunknown\nlmth/txft\nunknown\nunknown\nunknown\nunknown\n"}, {"ty... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nOur brave travelers reached an island where pirates had buried treasure. However as the ship was about to moor, the captain found out that some rat ate a piece of the treasure map.\n\nThe treasure map can be represented a... | [{"type": "stdin_stdout", "input": "20 20\n####################\n############.####.##\n#######..####..#####\n######............##\n######.....#...###.#\n#####E..........##.#\n#.##.#.........#####\n##NR....KO.....#####\n##B........#...#####\n#Y.W...H.......#####\n#####Z.....#...#####\n######...#.#...#####\n#A.......#.#.... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nSince the giant heads have appeared in the sky all humanity is in danger, so all Ricks and Mortys from all parallel universes are gathering in groups to find a solution to get rid of them. \n\nThere are n parallel univers... | [{"type": "stdin_stdout", "input": "100 50\n2 62 -62\n2 19 -19\n2 38 -38\n2 -84 84\n2 -16 16\n2 67 -67\n2 41 -41\n2 -32 32\n2 32 -32\n2 -62 62\n2 89 -89\n2 -84 84\n2 96 -96\n2 -11 11\n2 59 -59\n2 -13 13\n2 -70 70\n2 -3 3\n2 -41 41\n2 -74 74\n2 47 -47\n2 87 -87\n2 17 -17\n2 20 -20\n2 -14 14\n2 -67 67\n2 -95 95\n2 -15 15... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nEvery Turkish citizen has an identity number whose validity can be checked by these set of rules:\n\n- It is an 11 digit number\n- First digit can't be zero\n- Take the sum of 1st, 3rd, 5th, 7th and 9th digit and multiply... | [{"input": "\"x5810a78432\"", "output": "[false]", "fn_name": "check_valid_tr_number"}, {"input": "\"03868894286\"", "output": "[false]", "fn_name": "check_valid_tr_number"}, {"input": "692352217312", "output": "[false]", "fn_name": "check_valid_tr_number"}, {"input": "12762438338", "output": "[false]", "fn_name": "che... | code_functional |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nMakoto has a big blackboard with a positive integer $n$ written on it. He will perform the following action exactly $k$ times:\n\nSuppose the number currently written on the blackboard is $v$. He will randomly pick one of... | [{"type": "stdin_stdout", "input": "1000000000000000 10000\n", "output": "215514159\n"}, {"type": "stdin_stdout", "input": "1000000000000000 10000\n", "output": "215514159\n"}, {"type": "stdin_stdout", "input": "1000000000001000 10000\n", "output": "150774797\n"}, {"type": "stdin_stdout", "input": "1172768550854780 899... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nLife is not easy. Sometimes it is beyond your control. Now, as contestants of ACM ICPC, you might be just tasting the bitter of life. But don't worry! Do not look only on the dark side of life, but look also on the bright... | [{"type": "stdin_stdout", "input": "1\nnorth\n3\nnorth\neasu\nsouth\n0", "output": "5\n1\n"}, {"type": "stdin_stdout", "input": "1\nnorth\n0\nnorth\ntsae\nosuth\n-1", "output": "5\n"}, {"type": "stdin_stdout", "input": "1\nnorth\n0\nmorth\ntsae\nosuth\n-1", "output": "5\n"}, {"type": "stdin_stdout", "input": "1\nnorth\... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nNikolay has only recently started in competitive programming, but already qualified to the finals of one prestigious olympiad. There going to be $n$ participants, one of whom is Nikolay. Like any good olympiad, it consist... | [{"type": "stdin_stdout", "input": "25\n5 1 1\n5 2 3\n5 5 5\n5 5 1\n5 4 4\n10 1 2\n10 3 7\n10 10 10\n10 3 1\n10 7 6\n1000000 21232 1234\n999999 999999 999999\n1000000 300001 966605\n1000000 290001 679121\n500000 111099 123456\n100 1 1\n1000000000 1 1000000000\n1000000000 1 500000000\n100000000 1 12345678\n1000000000 1 ... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nIt's the fourth quater of the Super Bowl and your team is down by 4 points. You're 10 yards away from the endzone, if your team doesn't score a touchdown in the next four plays you lose. On a previous play, you were injur... | [{"input": "[[3, \"run\"], [3, \"run\"], [3, \"run\"], [10, \"turnover\"]]", "output": "[false]", "fn_name": "did_we_win"}, {"input": "[[10, \"run\"], [10, \"sack\"], [10, \"pass\"], [1, \"sack\"]]", "output": "[false]", "fn_name": "did_we_win"}, {"input": "[[5, \"pass\"], [5, \"pass\"], [10, \"sack\"], [10, \"run\"]]"... | code_functional |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nProblem C: Earn Big\n\nA group of N people is trying to challenge the following game to earn big money.\n\nFirst, N participants are isolated from each other. From this point, they are not allowed to contact each other, o... | [{"type": "stdin_stdout", "input": "110 50", "output": "0.224802593637\n"}, {"type": "stdin_stdout", "input": "010 50", "output": "1.000000000000\n"}, {"type": "stdin_stdout", "input": "110 89", "output": "0.789224893493\n"}, {"type": "stdin_stdout", "input": "110 12", "output": "0.000000001745\n"}, {"type": "stdin_std... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nSince Grisha behaved well last year, at New Year's Eve he was visited by Ded Moroz who brought an enormous bag of gifts with him! The bag contains n sweet candies from the good ol' bakery, each labeled from 1 to n corresp... | [{"type": "stdin_stdout", "input": "1000000000000000000 1000000000000000000\n", "output": "1152921504606846975\n"}, {"type": "stdin_stdout", "input": "1100000000000000000 1000000000000000000\n", "output": "1152921504606846975\n"}, {"type": "stdin_stdout", "input": "1100000000010000000 1000000000000000000\n", "output": ... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nYou are given an undirected graph consisting of N vertices and M edges. The vertices are numbered 1 to N, and the edges are numbered 1 to M. In addition, each vertex has a label, `A` or `B`. The label of Vertex i is s_i. ... | [{"type": "stdin_stdout", "input": "13 23\nABAAAABBBBAAB\n7 1\n10 6\n1 11\n2 10\n2 8\n2 11\n11 12\n8 3\n7 11\n11 2\n13 13\n11 9\n4 1\n9 7\n9 6\n8 13\n8 6\n4 10\n8 7\n4 3\n2 1\n8 12\n6 9", "output": "Yes\n"}, {"type": "stdin_stdout", "input": "13 23\nABAAAABBBBAAB\n7 1\n10 6\n1 11\n2 10\n2 8\n2 11\n11 12\n8 3\n7 12\n11 ... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nCreate a function that takes a number and finds the factors of it, listing them in **descending** order in an **array**.\n\nIf the parameter is not an integer or less than 1, return `-1`. In C# return an empty array.\n\nF... | [{"input": "54", "output": "[[54, 27, 18, 9, 6, 3, 2, 1]]", "fn_name": "factors"}, {"input": "\"hello world\"", "output": "[-1]", "fn_name": "factors"}, {"input": "49", "output": "[[49, 7, 1]]", "fn_name": "factors"}, {"input": "-12", "output": "[-1]", "fn_name": "factors"}, {"input": "\"a\"", "output": "[-1]", "fn_nam... | code_functional |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nAtCoDeer has three cards, one red, one green and one blue.\n\nAn integer between 1 and 9 (inclusive) is written on each card: r on the red card, g on the green card and b on the blue card.\n\nWe will arrange the cards in ... | [{"type": "stdin_stdout", "input": "4 3 2\n", "output": "YES\n"}, {"type": "stdin_stdout", "input": "2 3 4\n", "output": "NO\n"}, {"type": "stdin_stdout", "input": "7 3 2", "output": "YES\n"}, {"type": "stdin_stdout", "input": "7 6 0", "output": "YES\n"}, {"type": "stdin_stdout", "input": "2 6 0", "output": "YES\n"}, {... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nIn some village, there are 999 towers that are 1,(1+2),(1+2+3),...,(1+2+3+...+999) meters high from west to east, at intervals of 1 meter.\nIt had been snowing for a while before it finally stopped. For some two adjacent ... | [{"type": "stdin_stdout", "input": "290178 291177\n", "output": "208323\n"}, {"type": "stdin_stdout", "input": "336594 337545\n", "output": "115131\n"}, {"type": "stdin_stdout", "input": "124075 124692\n", "output": "65961\n"}, {"type": "stdin_stdout", "input": "82747 83560\n", "output": "247331\n"}, {"type": "stdin_st... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nIn the popular spreadsheets systems (for example, in Excel) the following numeration of columns is used. The first column has number A, the second — number B, etc. till column 26 that is marked by Z. Then there are two-le... | [{"type": "stdin_stdout", "input": "10\nR50C12\nR23C47\nY96\nR44C13\nR19C21\nR95C73\nBK12\nR51C74\nAY34\nR63C25\n", "output": "L50\nAU23\nR96C25\nM44\nU19\nBU95\nR12C63\nBV51\nR34C51\nY63\n"}, {"type": "stdin_stdout", "input": "10\nR50C12\nR23C47\nY96\nR44C13\nR19C21\nR95C73\nBK12\nR51C74\nAY34\nR62C25\n", "output": "L... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nYou're given Q queries of the form (L, R). \n\nFor each query you have to find the number of such x that L ≤ x ≤ R and there exist integer numbers a > 0, p > 1 such that x = a^{p}.\n\n\n-----Input-----\n\nThe first line c... | [{"type": "stdin_stdout", "input": "20\n862 928\n758 964\n541 789\n622 943\n328 900\n14 764\n217 1554\n461 847\n442 468\n544 1157\n518 529\n938 993\n620 851\n690 944\n484 601\n320 910\n98 1355\n816 794\n765 880\n551 1280\n", "output": "1\n4\n5\n6\n14\n32\n30\n9\n0\n12\n1\n1\n5\n4\n4\n15\n35\n0\n2\n13\n"}, {"type": "std... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nproblem\n\nPlay by arranging white and black stones on the table. First, place the stones on the left edge of the table. Then place the stones in the second place from the left. Repeat this n times to arrange n stones in ... | [{"type": "stdin_stdout", "input": "8\n1\n0\n0\n0\n1\n0\n0\n0\n4\n1\n-1\n0\n1\n1\n1\n1\n1\n0", "output": "8\n0\n0\n0\n"}, {"type": "stdin_stdout", "input": "8\n1\n1\n0\n1\n0\n0\n0\n1\n4\n1\n0\n0\n1\n1\n0\n1\n1\n0", "output": "0\n0\n1\n0\n"}, {"type": "stdin_stdout", "input": "8\n1\n1\n1\n1\n0\n-1\n0\n1\n3\n1\n0\n1\n1\n... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nAfter the contest in comparing numbers, Shapur's teacher found out that he is a real genius and that no one could possibly do the calculations faster than him even using a super computer!\n\nSome days before the contest, ... | [{"type": "stdin_stdout", "input": "Iran_\nPersian;\nW_o;n;d;e;r;f;u;l;\n7\nWonderfulPersianIran\nwonderful_PersIAN_IRAN;;_\nWONDERFUL___IRAN__PERSIAN__;;\nIra__Persiann__Wonderful\nWonder;;fulPersian___;I;r;a;n;\n__________IranPersianWonderful__________\nPersianIran_is_Wonderful\n", "output": "ACC\nACC\nACC\nWA\nACC\n... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nBased on the information of the time when study started and the time when study ended, check whether the total time studied in one day is t or more, and if not, create a program to find the shortage time. Time is one unit... | [{"type": "stdin_stdout", "input": "10\n3\n6 11\n12 15\n18 22\n14\n2\n6 14\n13 20\n0", "output": "OK\nOK\n"}, {"type": "stdin_stdout", "input": "10\n3\n6 11\n12 15\n34 22\n14\n2\n6 14\n13 20\n0", "output": "14\nOK\n"}, {"type": "stdin_stdout", "input": "10\n3\n20 11\n2 15\n34 22\n13\n2\n4 14\n13 33\n0", "output": "18\n... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nBerland has n cities connected by m bidirectional roads. No road connects a city to itself, and each pair of cities is connected by no more than one road. It is not guaranteed that you can get from any city to any other o... | [{"type": "stdin_stdout", "input": "10 45\n3 5\n2 3\n4 8\n2 5\n6 8\n10 7\n2 1\n3 7\n5 10\n6 1\n9 8\n3 1\n2 10\n6 7\n1 7\n7 9\n6 9\n9 3\n4 2\n2 6\n5 6\n5 8\n3 4\n10 8\n7 8\n4 6\n9 1\n5 5\n7 4\n1 10\n9 2\n2 8\n6 10\n9 8\n1 5\n7 2\n10 3\n3 8\n2 10\n1 1\n10 7\n1 3\n1 8\n10 2\n4 10\n", "output": "0\n"}, {"type": "stdin_stdo... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nOpen Binary and Object Group organizes a programming contest every year. Mr. Hex belongs to this group and joins the judge team of the contest. This year, he created a geometric problem with its solution for the contest. ... | [{"type": "stdin_stdout", "input": "9\n-1 1\n0 1\n1 1\n-1 0\n0 0\n1 0\n-1 -1\n0 -2\n1 -1", "output": "No\n"}, {"type": "stdin_stdout", "input": "9\n-1 1\n0 1\n1 1\n-1 0\n0 0\n1 0\n-1 -1\n0 -1\n1 -1", "output": "No"}, {"type": "stdin_stdout", "input": "4\n0 1\n1 -1\n0 -1\n1 1", "output": "Yes\n"}, {"type": "stdin_stdout... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nAs you could know there are no male planes nor female planes. However, each plane on Earth likes some other plane. There are n planes on Earth, numbered from 1 to n, and the plane with number i likes the plane with number... | [{"type": "stdin_stdout", "input": "100\n25 6 46 37 87 99 70 31 46 12 94 40 87 56 28 14 94 39 13 12 67 13 71 39 83 48 40 14 62 41 16 71 20 41 83 41 68 98 23 82 62 83 62 35 49 22 31 21 66 98 54 39 34 52 11 28 47 89 25 44 68 36 91 46 82 86 88 48 27 93 7 9 53 36 16 100 84 84 44 25 58 66 16 46 72 21 91 78 4 17 44 17 47 67 ... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nThree swimmers decided to organize a party in the swimming pool! At noon, they started to swim from the left side of the pool.\n\nIt takes the first swimmer exactly $a$ minutes to swim across the entire pool and come back... | [{"type": "stdin_stdout", "input": "10\n992222955174044630 49635415 8474 173727148\n618311281854681640 657834994 40173216 75996939\n710602478618400425 332897175 71490165 534449640\n768753872531302819 113476460 449 799174641\n633188994852953277 834175592 3132 788542124\n964246686346975322 539872840 295075 782348226\n683... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nThere will be a launch of a new, powerful and unusual collider very soon, which located along a straight line. n particles will be launched inside it. All of them are located in a straight line and there can not be two or... | [{"type": "stdin_stdout", "input": "30\nRLLRLRLLRRRLRRRLLLLLLRRRLRRLRL\n128 610 1680 2436 2896 2994 3008 3358 3392 4020 4298 4582 4712 4728 5136 5900 6088 6232 6282 6858 6934 7186 7224 7256 7614 8802 8872 9170 9384 9794\n", "output": "7\n"}, {"type": "stdin_stdout", "input": "30\nRLLRLRLLRRRLRRRLLLLLLRRRLRRLRL\n128 610... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nYou are given an array $a$ of $n$ integers, and another integer $k$ such that $2k \\le n$.\n\nYou have to perform exactly $k$ operations with this array. In one operation, you have to choose two elements of the array (let... | [{"type": "stdin_stdout", "input": "1\n88 38\n9 143 135 72 74 12 120 27 108 183 18 24 163 122 140 155 166 188 197 14 134 66 188 161 79 100 40 55 161 118 121 18 72 141 136 31 39 187 2 98 16 118 120 196 127 66 135 186 49 16 17 50 107 192 50 23 62 110 83 124 197 127 185 129 131 182 45 147 174 115 89 109 177 7 70 43 75 5 1... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nHeiankyo is known as a town with a grid of roads.\n\nHokusai, a cat who lives in Heiankyo, has to go from his home to a secret place on the outskirts of town every day for patrol. However, I get tired of following the sam... | [{"type": "stdin_stdout", "input": "4\n0 2\n0\n1 2\n2\n0 0 0 1\n0 0 1 0\n4 0\n4\n1 0 0 0\n3 5 2 3\n4 0 4 0\n0 2 0 4\n15 5\n0", "output": "1\nMiserable Hokusai!\nMiserable Hokusai!\n15504\n"}, {"type": "stdin_stdout", "input": "4\n2 2\n0\n1 2\n2\n0 0 0 1\n0 0 1 0\n4 0\n4\n1 0 0 0\n3 3 2 3\n4 0 4 0\n0 2 0 3\n15 3\n0", "o... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nDo you know \"sed,\" a tool provided with Unix? Its most popular use is to substitute every occurrence of a string contained in the input string (actually each input line) with another string β. More precisely, it procee... | [{"type": "stdin_stdout", "input": "2\na bb\nb aa\nb\nbbbbbbbb\n1\nb aa\nb\naaaaa\n3\nbb aab\nabc aadc\nad dee\nabc\ndeeeeeeeec\n10\na acb\nb bai\nc acf\nd bec\ne bbh\nf fag\ng abe\nh bag\ni aaj\nj bbb\na\nabaceaabe\n0", "output": "-1\n-1\n-1\n-1\n"}, {"type": "stdin_stdout", "input": "2\na bb\nb aa\nb\nbbbbbbbb\n1\nb ... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nTop-model Izabella participates in the competition. She wants to impress judges and show her mathematical skills.\n\nHer problem is following: for given string, consisting of only 0 and 1, tell if it's possible to remove ... | [{"type": "stdin_stdout", "input": "1111111111101111111111111111111111111011111111111111111111111101111011111101111111111101111111111111\n", "output": "yes\n"}, {"type": "stdin_stdout", "input": "0110111111111111111111011111111110110111110111111111111111111111111111111111111110111111111111111111\n", "output": "yes\n"},... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nSo the Beautiful Regional Contest (BeRC) has come to an end! $n$ students took part in the contest. The final standings are already known: the participant in the $i$-th place solved $p_i$ problems. Since the participants ... | [{"type": "stdin_stdout", "input": "5\n12\n5 4 4 3 2 2 1 1 1 1 1 1\n4\n4 3 2 2\n1\n1000100\n20\n20 19 18 17 16 15 14 13 15 11 10 9 8 7 6 5 4 3 2 1\n32\n125 64 63 58 58 58 58 58 37 37 37 37 34 34 28 28 28 28 28 28 24 24 19 17 17 17 17 16 16 16 16 11\n", "output": "1 2 3\n0 0 0\n0 0 0\n1 2 7\n1 2 11\n"}, {"type": "stdin_... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nRead problems statements in Mandarin Chinese . \n\nYou are given two strings A and B of the same length. Each string contains N Lower case Latin character (from 'a' to 'z'). A shift operation will remove the first charact... | [{"type": "stdin_stdout", "input": "5\nccade\nbddcc", "output": "3\n"}, {"type": "stdin_stdout", "input": "5\nccade\nccdcb", "output": "0\n"}, {"type": "stdin_stdout", "input": "5\nddacc\nbddcc", "output": "1\n"}, {"type": "stdin_stdout", "input": "5\nddacc\nccddb", "output": "2\n"}, {"type": "stdin_stdout", "input": "... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nRead problems statements in Mandarin Chinese and Russian. \n\nAlok-nath is man of equality. He needs your help to divide his “sanskars” evenly amongst all his followers. By doing this, Alok-nath can create equality among... | [{"type": "stdin_stdout", "input": "2\n6 3\n1 4 14 4 11\n5 2\n-1 2 0 14 4", "output": "no\nno\n"}, {"type": "stdin_stdout", "input": "2\n6 3\n1 4 14 4 11\n5 4\n-1 2 0 14 4", "output": "no\nno\n"}, {"type": "stdin_stdout", "input": "2\n5 3\n1 2 14 4 11\n5 2\n-1 2 0 8 7", "output": "no\nno\n"}, {"type": "stdin_stdout", "... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nCodehorses has just hosted the second Codehorses Cup. This year, the same as the previous one, organizers are giving T-shirts for the winners.\n\nThe valid sizes of T-shirts are either \"M\" or from $0$ to $3$ \"X\" follo... | [{"type": "stdin_stdout", "input": "43\nL\nXXXL\nM\nXS\nL\nXXL\nS\nL\nM\nXXXL\nXXS\nS\nXS\nS\nXS\nXL\nXXL\nXXL\nXS\nXXS\nXXL\nL\nXXXL\nL\nL\nXXL\nXXL\nM\nXXXS\nM\nXXL\nXXXS\nXXXL\nXXS\nL\nL\nXS\nL\nXS\nXS\nL\nXXL\nM\nXXXL\nXXL\nXXL\nXL\nL\nXS\nM\nXL\nXXXS\nXXXS\nS\nXXL\nXXXL\nXXL\nXS\nXXS\nL\nS\nXXXS\nXL\nL\nXL\nXXXS\n... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\n# Description\n\"It's the end of trick-or-treating and we have a list/array representing how much candy each child in our group has made out with. We don't want the kids to start arguing, and using our parental intuition ... | [{"input": "[17, 20, 50, 61, 42, 44]", "output": "[132]", "fn_name": "candies"}, {"input": "[1, 2, 4, 6]", "output": "[11]", "fn_name": "candies"}, {"input": "[1, 3, 3, 7]", "output": "[14]", "fn_name": "candies"}, {"input": "[5, 8, 6, 4]", "output": "[9]", "fn_name": "candies"}, {"input": "[7, 7, 7, 7]", "output": "[0... | code_functional |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nEverybody knows the classic [\"half your age plus seven\"](https://en.wikipedia.org/wiki/Age_disparity_in_sexual_relationships#The_.22half-your-age-plus-seven.22_rule) dating rule that a lot of people follow (including my... | [{"input": "17", "output": "[\"15-20\"]", "fn_name": "dating_range"}, {"input": "40", "output": "[\"27-66\"]", "fn_name": "dating_range"}, {"input": "15", "output": "[\"14-16\"]", "fn_name": "dating_range"}, {"input": "35", "output": "[\"24-56\"]", "fn_name": "dating_range"}, {"input": "53", "output": "[\"33-92\"]", "f... | code_functional |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nThis time the Berland Team Olympiad in Informatics is held in a remote city that can only be reached by one small bus. Bus has n passenger seats, seat i can be occupied only by a participant from the city a_{i}.\n\nToday ... | [{"type": "stdin_stdout", "input": "1 1000000000 1000000000\n100000\n", "output": " 0"}, {"type": "stdin_stdout", "input": "5 3 2\n1 1 2 1 1\n", "output": " 7"}, {"type": "stdin_stdout", "input": ... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nE869120 has A 1-yen coins and infinitely many 500-yen coins.\n\nDetermine if he can pay exactly N yen using only these coins.\n\n-----Constraints-----\n - N is an integer between 1 and 10000 (inclusive).\n - A is an integ... | [{"type": "stdin_stdout", "input": "2018\n218\n", "output": "Yes\n"}, {"type": "stdin_stdout", "input": "2018\n113", "output": "Yes\n"}, {"type": "stdin_stdout", "input": "2018\n111", "output": "Yes\n"}, {"type": "stdin_stdout", "input": "2018\n101", "output": "Yes\n"}, {"type": "stdin_stdout", "input": "2018\n100", "o... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nThere is a square grid of size $n \\times n$. Some cells are colored in black, all others are colored in white. In one operation you can select some rectangle and color all its cells in white. It costs $\\min(h, w)$ to co... | [{"type": "stdin_stdout", "input": "1000 24\n190 39 552 958\n539 146 763 587\n31 526 423 673\n208 432 953 442\n263 69 719 635\n162 428 623 797\n49 126 94 963\n749 623 979 919\n190 461 367 855\n211 240 939 914\n169 80 336 203\n684 546 829 582\n80 218 324 327\n560 452 656 637\n316 534 982 642\n521 634 758 686\n514 324 75... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nAuction\n\nsquare1001 You were watching a certain auction.\n\nAn auction is a transaction in which when there are a large number of buyers and the number of items is limited, the one with the highest price is given the ri... | [{"type": "stdin_stdout", "input": "5\n-1 -1 -2 -2 3", "output": "4\n5\n"}, {"type": "stdin_stdout", "input": "5\n-1 -1 -3 -2 3", "output": "3\n5\n"}, {"type": "stdin_stdout", "input": "5\n-1 -1 -3 -1 3", "output": "3\n5\n"}, {"type": "stdin_stdout", "input": "5\n-1 -1 -6 -1 3", "output": "3\n5\n"}, {"type": "stdin_std... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nDevu is a renowned classical singer. He is invited to many big functions/festivals. Recently he was invited to \"All World Classical Singing Festival\". Other than Devu, comedian Churu was also invited.\n\nDevu has provid... | [{"type": "stdin_stdout", "input": "100 6000\n41 31 23 17 24 78 26 96 93 48 46 2 49 33 35 9 73 100 34 48 83 36 33 69 43 24 3 74 8 81 27 33 94 38 77 9 76 90 62 90 21 67 22 22 12 2 17 27 102 18 72 85 59 65 71 38 90 75 74 66 60 47 58 50 90 95 75 10 5 100 97 29 83 88 65 26 93 90 22 98 36 55 70 38 50 92 88 72 99 96 25 14 74... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nIn the $2022$ year, Mike found two binary integers $a$ and $b$ of length $n$ (both of them are written only by digits $0$ and $1$) that can have leading zeroes. In order not to forget them, he wanted to construct integer ... | [{"type": "stdin_stdout", "input": "5\n1\n0\n3\n011\n3\n110\n6\n111000\n6\n001011\n", "output": "\n1\n110\n100\n101101\n101110\n"}, {"type": "stdin_stdout", "input": "5\n1\n0\n3\n011\n3\n110\n6\n111000\n6\n001011\n", "output": "1\n110\n100\n101101\n101110\n"}, {"type": "stdin_stdout", "input": "5\n1\n0\n3\n011\n3\n110\... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nConsider a simplified penalty phase at the end of a football match.\n\nA penalty phase consists of at most $10$ kicks, the first team takes the first kick, the second team takes the second kick, then the first team takes ... | [{"type": "stdin_stdout", "input": "4\n1001???0?1\n1111111111\n??????????\n0100001000\n", "output": "8\n10\n6\n10\n"}, {"type": "stdin_stdout", "input": "4\n1?0???1001\n1111111111\n??????????\n0000000000\n", "output": "7\n10\n6\n10\n"}, {"type": "stdin_stdout", "input": "4\n1001?1?0??\n0111111011\n??????????\n110001100... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nGiven an array $a$ of length $n$ and an integer $k$, find the number of indices $1 \\leq i \\leq n - k$ such that the subarray $[a_i, \\dots, a_{i+k}]$ with length $k+1$ (not with length $k$) has the following property:\n... | [{"type": "stdin_stdout", "input": "1\n40 39\n1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nTakahashi has a string S consisting of lowercase English letters.\nStarting with this string, he will produce a new one in the procedure given as follows.\nThe procedure consists of Q operations. In Operation i (1 \\leq i... | [{"type": "stdin_stdout", "input": "a\n6\n2 2 a\n2 1 b\n1\n2 2 c\n1\n1\n", "output": "aabc\n"}, {"type": "stdin_stdout", "input": "a\n6\n2 2 a\n2 1 b\n1\n2 2 d\n1\n1", "output": "aabd\n"}, {"type": "stdin_stdout", "input": "a\n6\n2 2 b\n2 1 b\n1\n2 2 d\n1\n1", "output": "babd\n"}, {"type": "stdin_stdout", "input": "a\n... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\n# Base reduction\n\n## Input\n\nA positive integer:\n```\n0 < n < 1000000000\n```\n\n## Output\n\nThe end result of the base reduction.\n\nIf it cannot be fully reduced (reduced down to a single-digit number), return -1.\... | [{"input": "10", "output": "[2]", "fn_name": "basereduct"}, {"input": "15", "output": "[3]", "fn_name": "basereduct"}, {"input": "5", "output": "[5]", "fn_name": "basereduct"}, {"input": "7", "output": "[7]", "fn_name": "basereduct"}, {"input": "7", "output": "[7]", "fn_name": "basereduct"}] | code_functional |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nYou are playing a game called Guru Guru Gururin. In this game, you can move with the vehicle called Gururin. There are two commands you can give to Gururin: 'R' and 'L'. When 'R' is sent, Gururin rotates clockwise by 90 d... | [{"type": "stdin_stdout", "input": "RRLRRLRRRRLRRLRRRRLRRLRRRRLRRLRR", "output": "4"}, {"type": "stdin_stdout", "input": "RLLRRLLLRRRLLLLRR", "output": "0\n"}, {"type": "stdin_stdout", "input": "RLLRRLLMRRRLLLLRR", "output": "0\n"}, {"type": "stdin_stdout", "input": "RLLRLLLLRRRLLLRRR", "output": "0"}, {"type": "stdin_... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nYou are given $q$ queries in the following form:\n\nGiven three integers $l_i$, $r_i$ and $d_i$, find minimum positive integer $x_i$ such that it is divisible by $d_i$ and it does not belong to the segment $[l_i, r_i]$.\n... | [{"type": "stdin_stdout", "input": "30\n1 1000000000 1\n1 1000000000 1\n1 1000000000 1\n1 1000000000 1\n1 1000000000 1\n1 1000000000 1\n1 1000000000 1\n1 1000000000 1\n1 1000000000 1\n1 1000000000 1\n1 1000000000 1\n1 1000000000 1\n1 1000000000 1\n1 1000000000 1\n1 1000000000 1\n1 1000000000 1\n1 1000000000 1\n1 100000... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\n*This kata is based on [Project Euler Problem 539](https://projecteuler.net/problem=539)*\n\n##Object\n\nFind the last number between 1 and `n` (inclusive) that survives the elimination process\n\n####How It Works\n\nStar... | [{"input": "50000", "output": "[22358]", "fn_name": "last_man_standing"}, {"input": "1000", "output": "[510]", "fn_name": "last_man_standing"}, {"input": "100", "output": "[54]", "fn_name": "last_man_standing"}, {"input": "10", "output": "[8]", "fn_name": "last_man_standing"}, {"input": "9", "output": "[6]", "fn_name":... | code_functional |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nFrom 1603 to 1867, people call that era the EDO era. EDO stands for Enhanced Driving Operation, the most advanced space navigation technology at the time, and was developed by Dr. Izy in 1603.\n\nYou are a space adventure... | [{"type": "stdin_stdout", "input": "2\n10 11\n11 12\n2\nN 2\nE 1\n2\n10 11\n11 12\n2\nN 2\nW 1\n3\n0 15\n5 10\n5 15\n5\nW 20\nS 10\nN 20\nE 10\nS 10\n0", "output": "Yes\nNo\nNo\n"}, {"type": "stdin_stdout", "input": "2\n10 11\n11 12\n2\nN 2\nE 1\n2\n10 11\n11 12\n2\nN 3\nW 1\n3\n0 15\n5 10\n5 15\n5\nW 20\nS 10\nN 20\nE... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nYour friend Cody has to sell a lot of jam, so he applied a good 25% discount to all his merchandise.\n\nTrouble is that he mixed all the prices (initial and discounted), so now he needs your cool coding skills to filter o... | [{"input": "\"10349349 13799132 14426622 17347290 19235496 23129720 24791793 32049435 33055724 42732580 48771579 51731211 58387395 59065617 65028772 67572870 68974948 71437914 77849860 78754156 81661776 88101462 90097160 95250552 97020531 108882368 114334791 117468616 128978592 129360708 138971622 140891505 151010565 1... | code_functional |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nCapitalization is writing a word with its first letter as a capital letter. Your task is to capitalize the given word.\n\nNote, that during capitalization all the letters except the first one remains unchanged.\n\n\n-----... | [{"type": "stdin_stdout", "input": "lZqBqKeGvNdSeYuWxRiVnFtYbKuJwQtUcKnVtQhAlOeUzMaAuTaEnDdPfDcNyHgEoBmYjZyFePeJrRiKyAzFnBfAuGiUyLrIeLrNhBeBdVcEeKgCcBrQzDsPwGcNnZvTsEaYmFfMeOmMdNuZbUtDoQoNcGwDqEkEjIdQaPwAxJbXeNxOgKgXoEbZiIsVkRrNpNyAkLeHkNfEpLuQvEcMbIoGaDzXbEtNsLgGfOkZaFiUsOvEjVeCaMcZqMzKeAdXxJsVeCrZaFpJtZxInQxFaSmGgSsV... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nWrite a program which reads an integer and prints sum of its digits.\n\n\n\nInput\n\nThe input consists of multiple datasets. For each dataset, an integer x is given in a line. The number of digits in x does not exceed 10... | [{"type": "stdin_stdout", "input": "123\n158\n1100\n0", "output": "6\n14\n2\n"}, {"type": "stdin_stdout", "input": "123\n181\n1111\n0", "output": "6\n10\n4\n"}, {"type": "stdin_stdout", "input": "123\n418\n1100\n0", "output": "6\n13\n2\n"}, {"type": "stdin_stdout", "input": "123\n418\n1110\n0", "output": "6\n13\n3\n"},... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nYour task is to calculate logical value of boolean array. Test arrays are one-dimensional and their size is in the range 1-50.\n\nLinks referring to logical operations: [AND](https://en.wikipedia.org/wiki/Logical_conjunct... | [{"input": "[true, false, false, false]\n\"AND\"", "output": "[false]", "fn_name": "logical_calc"}, {"input": "[true, true, false, false]\n\"AND\"", "output": "[false]", "fn_name": "logical_calc"}, {"input": "[true, true, false, false]\n\"XOR\"", "output": "[false]", "fn_name": "logical_calc"}, {"input": "[true, false,... | code_functional |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nScheduling is how the processor decides which jobs(processes) get to use the processor and for how long. This can cause a lot of problems. Like a really long process taking the entire CPU and freezing all the other proces... | [{"input": "[3, 10, 20, 1, 2, 10, 10]\n5", "output": "[26]", "fn_name": "SJF"}, {"input": "[3, 10, 10, 20, 1, 2]\n1", "output": "[16]", "fn_name": "SJF"}, {"input": "[3, 10, 10, 20, 1, 2]\n2", "output": "[26]", "fn_name": "SJF"}, {"input": "[3, 10, 20, 1, 2, 3]\n5", "output": "[9]", "fn_name": "SJF"}, {"input": "[3, 10... | code_functional |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nTakahashi, who is A years old, is riding a Ferris wheel.\nIt costs B yen (B is an even number) to ride the Ferris wheel if you are 13 years old or older, but children between 6 and 12 years old (inclusive) can ride it for... | [{"type": "stdin_stdout", "input": "30 100\n", "output": "100\n"}, {"type": "stdin_stdout", "input": "13 298\n", "output": "298\n"}, {"type": "stdin_stdout", "input": "60 654\n", "output": "654\n"}, {"type": "stdin_stdout", "input": "12 100\n", "output": "50\n"}, {"type": "stdin_stdout", "input": "6 482\n", "output": "... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nThe Smart Beaver from ABBYY loves puzzles. One of his favorite puzzles is the magic square. He has recently had an idea to automate the solution of this puzzle. The Beaver decided to offer this challenge to the ABBYY Cup ... | [{"type": "stdin_stdout", "input": "4\n-64322865 -60701256 -53458038 -42593211 -38971602 -31728384 -24485166 -17241948 -2755512 4487706 11730924 18974142 22595751 33460578 40703796 44325405\n", "output": "-39994920\n-60701256 -64322865 44325405 40703796\n-2755512 33460578 -53458038 -17241948\n18974142 -31728384 1173092... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nInternational Christmas Present Company (ICPC) is a company to employ Santa and deliver presents on Christmas. Many parents request ICPC to deliver presents to their children at specified time of December 24. Although sam... | [{"type": "stdin_stdout", "input": "3 2 3\n0 1 10\n1 2 15\n0 -1\n1 8\n2 -1\n3 2 4\n0 1 10\n1 2 10\n0 0\n1 19\n2 20\n0 25\n13 10 10\n0 1 39\n2 3 48\n3 5 20\n4 8 25\n3 9 10\n8 9 40\n3 4 5\n5 0 17\n0 7 93\n1 3 13\n0 0\n1 100000000\n2 100\n3 543\n4 500\n5 400\n6 300\n6 200\n8 100\n9 100\n0 0 0", "output": "3\n3\n4\n"}, {"t... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nAirport Codes\n\nAirport code\n\nIn the Kingdom of JAG, airport codes are assigned to each domestic airport for identification.\n\nAirport codes are assigned according to the following rules based on the name of the airpo... | [{"type": "stdin_stdout", "input": "3\nhaneda\noookayama\nssu\n2\nazusa\nazishirabe\n2\nsnuke\nsnake\n4\nhaneda\nhonda\nhanamaki\nhawaii\n0", "output": "1\n4\n-1\n3\n"}, {"type": "stdin_stdout", "input": "3\nhaneda\noookayama\nstu\n2\nazusa\nebarihsiza\n2\nsnuke\nsnake\n4\nhaneda\nhonda\nhanamaki\nhawaih\n0", "output":... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nEshag has an array $a$ consisting of $n$ integers.\n\nEshag can perform the following operation any number of times: choose some subsequence of $a$ and delete every element from it which is strictly larger than $AVG$, whe... | [{"type": "stdin_stdout", "input": "3\n6\n1 1 1 7 3 1\n6\n17 17 8 11 9 12\n6\n10 2 2 2 1 1\n", "output": "2\n5\n4\n"}, {"type": "stdin_stdout", "input": "3\n6\n1 1 1 7 3 1\n6\n17 17 8 11 9 12\n6\n10 2 2 2 0 1\n", "output": "2\n5\n5\n"}, {"type": "stdin_stdout", "input": "3\n6\n1 1 2 7 3 1\n6\n17 17 8 11 9 12\n6\n10 2 2... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nRikhail Mubinchik believes that the current definition of prime numbers is obsolete as they are too complex and unpredictable. A palindromic number is another matter. It is aesthetically pleasing, and it has a number of r... | [{"type": "stdin_stdout", "input": "10000 239\n", "output": "1168638\n"}, {"type": "stdin_stdout", "input": "10001 239\n", "output": "1168798\n"}, {"type": "stdin_stdout", "input": "10000 239\n", "output": "1168638"}, {"type": "stdin_stdout", "input": "10278 674\n", "output": "204510\n"}, {"type": "stdin_stdout", "inpu... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nHave you ever played Hanabi? If not, then you've got to try it out! This problem deals with a simplified version of the game.\n\nOverall, the game has 25 types of cards (5 distinct colors and 5 distinct values). Borya is ... | [{"type": "stdin_stdout", "input": "100\nY3 Y3 Y5 Y2 Y4 Y1 Y2 Y3 Y1 Y5 Y3 Y1 Y4 Y5 Y5 Y3 Y1 Y5 Y2 Y3 Y1 Y4 Y4 Y1 Y2 Y2 Y4 Y2 Y4 Y5 Y5 Y2 Y3 Y1 Y3 Y5 Y3 Y1 Y5 Y3 Y3 Y2 Y5 Y1 Y5 Y5 Y4 Y2 Y2 Y1 Y2 Y4 Y3 Y2 Y5 Y3 Y4 Y3 Y1 Y4 Y2 Y4 Y4 Y3 Y3 Y1 Y1 Y4 Y2 Y5 Y3 Y4 Y4 Y4 Y3 Y2 Y2 Y2 Y3 Y4 Y4 Y2 Y1 Y2 Y2 Y4 Y3 Y5 Y4 Y2 Y5 Y3 Y1 ... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nOnce again, Boris needs the help of Anton in creating a task. This time Anton needs to solve the following problem:\n\nThere are two arrays of integers $a$ and $b$ of length $n$. It turned out that array $a$ contains only... | [{"type": "stdin_stdout", "input": "5\n3\n1 -1 0\n1 1 -2\n3\n0 1 1\n0 2 2\n2\n1 -1\n1 44\n2\n-1 0\n-1 -38\n5\n1 1 -1 1 -1\n1 1 -1 1 -1\n", "output": "YES\nNO\nYES\nYES\nYES\n"}, {"type": "stdin_stdout", "input": "5\n3\n0 -1 -1\n1 1 -2\n3\n0 1 1\n0 1 2\n2\n1 0\n1 41\n2\n-1 0\n-1 -41\n5\n0 1 -1 1 -1\n0 1 -1 1 -1\n", "out... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nInna and Dima bought a table of size n × m in the shop. Each cell of the table contains a single letter: \"D\", \"I\", \"M\", \"A\".\n\nInna loves Dima, so she wants to go through his name as many times as possible as she... | [{"type": "stdin_stdout", "input": "14 34\nDDDDDDDDDDDDIMADDDDDDDDDDDDDDDIMAD\nDDDDDDIMADDDDDDDDDDDDDDDDDDDDDIMAD\nDDDDDDDDDDDDDIDDDDDDDDDDDIDIMIDIMA\nDDDDDDIMDDDDDDDDDDDDDIDDDDDDDDDDDD\nDDDDDDDDDDDDDDDDDMADDDDDDDDDDDDDMD\nDDDDDDIMIDDDDDDDDDDDDIMIDIMIDDDIDD\nDDDDDDDDDDDDDDDDDMIMDDDDIMDDIMADIM\nDDDDDDDDDDDADIMADIDDDDDDI... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\n### Task\nYou've just moved into a perfectly straight street with exactly ```n``` identical houses on either side of the road. Naturally, you would like to find out the house number of the people on the other side of the ... | [{"input": "20\n3400", "output": "[6781]", "fn_name": "over_the_road"}, {"input": "10\n22", "output": "[35]", "fn_name": "over_the_road"}, {"input": "7\n11", "output": "[16]", "fn_name": "over_the_road"}, {"input": "9\n26", "output": "[44]", "fn_name": "over_the_road"}, {"input": "20\n10", "output": "[1]", "fn_name": "... | code_functional |
[
{
"content": "Solve the following coding problem using the programming language python:\n\n# Task\n You are given a string `s`. Let's call its substring a group, if all letters in it are adjacent and the same(such as `\"aa\",\"bbb\",\"cccc\"`..). Let's call the substiring with 2 or more adjacent group a big gro... | [{"input": "\"gztxxxxxggggggggggggsssssssbbbbbeeeeeeehhhmmmmmmmitttttttlllllhkppppp\"", "output": "[2]", "fn_name": "repeat_adjacent"}, {"input": "\"ccccoodeffffiiighhhhhhhhhhttttttts\"", "output": "[3]", "fn_name": "repeat_adjacent"}, {"input": "\"ccccoooooooooooooooooooooooddee\"", "output": "[1]", "fn_name": "repeat... | code_functional |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nLet's call beauty of an array $b_1, b_2, \\ldots, b_n$ ($n > 1$) — $\\min\\limits_{1 \\leq i < j \\leq n} |b_i - b_j|$.\n\nYou're given an array $a_1, a_2, \\ldots a_n$ and a number $k$. Calculate the sum of beauty over ... | [{"type": "stdin_stdout", "input": "52 52\n19752 66708 73109 84463 95683 96876 98503 98812 99766 99778 99913 99975 99977 99997 99997 99997 99998 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 ... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nGiven a string, turn each letter into its ASCII character code and join them together to create a number - let's call this number `total1`:\n\n```\n'ABC' --> 'A' = 65, 'B' = 66, 'C' = 67 --> 656667\n```\n\nThen replace an... | [{"input": "\"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ\"", "output": "[96]", "fn_name": "calc"}, {"input": "\"jfmgklf8hglbe\"", "output": "[6]", "fn_name": "calc"}, {"input": "\"aaaaaddddr\"", "output": "[30]", "fn_name": "calc"}, {"input": "\"ifkhchlhfd\"", "output": "[6]", "fn_name": "calc"}, {"input": "\... | code_functional |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nConstruct a function 'coordinates', that will return the distance between two points on a cartesian plane, given the x and y coordinates of each point.\n\nThere are two parameters in the function, ```p1``` and ```p2```. `... | [{"input": "[-4, -5]\n[-5, -4]\n1", "output": "[1.4]", "fn_name": "coordinates"}, {"input": "[-2, 5]\n[-2, -10]\n2", "output": "[15]", "fn_name": "coordinates"}, {"input": "[4, 7]\n[6, 2]\n3", "output": "[5.385]", "fn_name": "coordinates"}, {"input": "[5, 3]\n[10, 15]\n2", "output": "[13]", "fn_name": "coordinates"}, {... | code_functional |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nGerald plays the following game. He has a checkered field of size n × n cells, where m various cells are banned. Before the game, he has to put a few chips on some border (but not corner) board cells. Then for n - 1 minut... | [{"type": "stdin_stdout", "input": "10 5\n2 1\n4 4\n2 2\n4 3\n1 1\n", "output": "11\n"}, {"type": "stdin_stdout", "input": "5 5\n3 2\n5 4\n3 3\n2 3\n1 2\n", "output": "1\n"}, {"type": "stdin_stdout", "input": "5 5\n3 2\n1 4\n5 1\n4 5\n3 1\n", "output": "2\n"}, {"type": "stdin_stdout", "input": "5 5\n2 2\n5 3\n2 3\n5 1\... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nIn the world of DragonBool there are fierce warriors called Soints. Also there are even fiercer warriors called Sofloats – the mortal enemies of Soints.\n\nThe power of each warrior is determined by the amount of chakra h... | [{"type": "stdin_stdout", "input": "2\n2 3\n10 1\n20 2\n5 2\n4 2\n18 1\n5 5\n73 87\n100 13\n36 36\n77 46\n16 93\n49 46\n27 93\n118 87\n172 13\n63 36", "output": "8\n155\n"}, {"type": "stdin_stdout", "input": "2\n2 3\n7 1\n20 2\n5 2\n4 2\n18 1\n5 5\n73 87\n100 13\n36 36\n77 46\n16 93\n49 46\n27 93\n118 87\n172 13\n63 36... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nThe objective of this Kata is to write a function that creates a dictionary of factors for a range of numbers.\n\nThe key for each list in the dictionary should be the number. The list associated with each key should poss... | [{"input": "2\n100", "output": "[{\"2\": [\"None\"], \"3\": [\"None\"], \"4\": [2], \"5\": [\"None\"], \"6\": [2, 3], \"7\": [\"None\"], \"8\": [2, 4], \"9\": [3], \"10\": [2, 5], \"11\": [\"None\"], \"12\": [2, 3, 4, 6], \"13\": [\"None\"], \"14\": [2, 7], \"15\": [3, 5], \"16\": [2, 4, 8], \"17\": [\"None\"], \"18\":... | code_functional |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nGiven the triangle of consecutive odd numbers:\n\n```\n 1\n 3 5\n 7 9 11\n 13 15 17 19\n21 23 25 27 29\n...\n```\n\nCalculate the row sums of this triangle from... | [{"input": "101", "output": "[1030301]", "fn_name": "row_sum_odd_numbers"}, {"input": "74", "output": "[405224]", "fn_name": "row_sum_odd_numbers"}, {"input": "86", "output": "[636056]", "fn_name": "row_sum_odd_numbers"}, {"input": "93", "output": "[804357]", "fn_name": "row_sum_odd_numbers"}, {"input": "41", "output":... | code_functional |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nA ski base is planned to be built in Walrusland. Recently, however, the project is still in the constructing phase. A large land lot was chosen for the construction. It contains n ski junctions, numbered from 1 to n. Init... | [{"type": "stdin_stdout", "input": "2 40\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": "0\n1\n3\n7\n15\n31\n63\n127\n255\n511\n1023\n2047\n4095\n8191\n1... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nCheesy Cheeseman just got a new monitor! He is happy with it, but he just discovered that his old desktop wallpaper no longer fits. He wants to find a new wallpaper, but does not know which size wallpaper he should be loo... | [{"input": "3840\n\"32:9\"", "output": "[\"3840x1080\"]", "fn_name": "find_screen_height"}, {"input": "1920\n\"16:9\"", "output": "[\"1920x1080\"]", "fn_name": "find_screen_height"}, {"input": "5120\n\"32:9\"", "output": "[\"5120x1440\"]", "fn_name": "find_screen_height"}, {"input": "1280\n\"16:9\"", "output": "[\"1280... | code_functional |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nGiven is an integer x that is greater than or equal to 0, and less than or equal to 1.\nOutput 1 if x is equal to 0, or 0 if x is equal to 1.\n\n-----Constraints-----\n - 0 \\leq x \\leq 1\n - x is an integer\n\n-----Inpu... | [{"type": "stdin_stdout", "input": "000", "output": "1\n"}, {"type": "stdin_stdout", "input": "000", "output": "1\n"}, {"type": "stdin_stdout", "input": "1\n", "output": "0\n"}, {"type": "stdin_stdout", "input": "0\n", "output": "1\n"}, {"type": "stdin_stdout", "input": "1", "output": "0"}, {"type": "stdin_stdout", "in... | code_stdio |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.