messages listlengths 1 1 | ground_truth stringlengths 88 726k | dataset stringclasses 2
values |
|---|---|---|
[
{
"content": "Solve the following coding problem using the programming language python:\n\nYou are playing euchre and you want to know the new score after finishing a hand. There are two teams and each hand consists of 5 tricks. The team who wins the majority of the tricks will win points but the number of poin... | [{"input": "[4, 0]\n1\nfalse\n[2, 2, 2, 2, 2]", "output": "[[4, 2]]", "fn_name": "update_score"}, {"input": "[4, 4]\n2\nfalse\n[2, 2, 2, 2, 2]", "output": "[[4, 6]]", "fn_name": "update_score"}, {"input": "[4, 6]\n2\ntrue\n[2, 2, 2, 2, 2]", "output": "[[4, 10]]", "fn_name": "update_score"}, {"input": "[7, 2]\n1\nfalse\... | code_functional |
[
{
"content": "Solve the following coding problem using the programming language python:\n\n# Task\n Miss X has only two combs in her possession, both of which are old and miss a tooth or two. She also has many purses of different length, in which she carries the combs. The only way they fit is horizontally and ... | [{"input": "\"*..*.*\"\n\"*.***\"", "output": "[9]", "fn_name": "combs"}, {"input": "\"*...*\"\n\"*.*\"", "output": "[5]", "fn_name": "combs"}, {"input": "\"*..*\"\n\"*.*\"", "output": "[5]", "fn_name": "combs"}, {"input": "\"*.**\"\n\"*.*\"", "output": "[5]", "fn_name": "combs"}, {"input": "\"*.*\"\n\"*.*\"", "output"... | code_functional |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nThere are N students and M checkpoints on the xy-plane.\n\nThe coordinates of the i-th student (1 \\leq i \\leq N) is (a_i,b_i), and the coordinates of the checkpoint numbered j (1 \\leq j \\leq M) is (c_j,d_j).\n\nWhen t... | [{"type": "stdin_stdout", "input": "50 50\n-87868672 9773500\n38180447 36636308\n-93470873 38029088\n49678522 -87311634\n62792334 -82584220\n50941177 2445768\n-21746015 -16856077\n-69539173 -40150977\n-82915111 -60619217\n-42155179 93071641\n-3205477 16657057\n26789545 -1410866\n-32360553 -38239433\n-69707837 59109468\... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nAtCoDeer the deer has found two positive integers, a and b.\nDetermine whether the concatenation of a and b in this order is a square number.\n\n-----Constraints-----\n - 1 ≤ a,b ≤ 100\n - a and b are integers.\n\n-----In... | [{"type": "stdin_stdout", "input": "100 100\n", "output": "No\n"}, {"type": "stdin_stdout", "input": "000 001", "output": "Yes\n"}, {"type": "stdin_stdout", "input": "010 000", "output": "Yes\n"}, {"type": "stdin_stdout", "input": "000 000", "output": "Yes\n"}, {"type": "stdin_stdout", "input": "000 100", "output": "Ye... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nIn a strategic computer game \"Settlers II\" one has to build defense structures to expand and protect the territory. Let's take one of these buildings. At the moment the defense structure accommodates exactly n soldiers.... | [{"type": "stdin_stdout", "input": "100 100\n100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nRecently, Duff has been practicing weight lifting. As a hard practice, Malek gave her a task. He gave her a sequence of weights. Weight of i-th of them is 2wi pounds. In each step, Duff can lift some of the remaining weig... | [{"type": "stdin_stdout", "input": "100\n196 1681 196 0 61 93 196 196 196 196 196 0 0 96 18 1576 0 93 666463 18 93 1 1278 8939 93 196 196 1278 3 0 67416 869956 10 56489 196 745 39 783 196 8939 196 81 69634 4552 39 3 14 20 25 8 10 4 7302 0 19579 20 1140 15990 7302 0 19579 4142 11 1354 75252 93 311 1278 0 79475 10 75252 ... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nThere was an electronic store heist last night.\n\nAll keyboards which were in the store yesterday were numbered in ascending order from some integer number $x$. For example, if $x = 4$ and there were $3$ keyboards in the... | [{"type": "stdin_stdout", "input": "40\n194 121 110 134 172 142 195 135 186 187 128 161 185 132 117 175 178 131 143 151 170 181 188 140 133 145 119 129 179 149 109 123 124 106 100 199 197 155 141 183\n", "output": "60\n"}, {"type": "stdin_stdout", "input": "40\n194 121 110 134 172 142 195 135 186 187 128 161 185 132 11... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nOnce Bob took a paper stripe of n squares (the height of the stripe is 1 square). In each square he wrote an integer number, possibly negative. He became interested in how many ways exist to cut this stripe into three pie... | [{"type": "stdin_stdout", "input": "100\n3 0 -5 2 -3 -1 -1 0 -2 -5 -4 2 1 2 -2 -1 -1 -4 3 -1 -3 -1 5 0 -4 -4 -1 0 -2 -2 0 1 -1 -2 -1 -5 -4 -2 3 1 -3 0 -1 1 0 -1 2 0 -2 -1 -3 1 -2 2 3 2 -3 -5 2 2 -2 -2 1 2 -2 -1 3 0 -4 7 -2 2 1 4 -9 -1 -2 -1 0 -1 0 -2 -2 -1 1 1 -4 2 -3 -3 7 1 1 -3 -7 0 -2 0 5 -2\n", "output": "5\n"}, {"... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nFor this problem you must create a program that says who ate the last cookie. If the input is a string then \"Zach\" ate the cookie. If the input is a float or an int then \"Monica\" ate the cookie. If the input is anythi... | [{"input": "1.98528462", "output": "[\"Who ate the last cookie? It was Monica!\"]", "fn_name": "cookie"}, {"input": "false", "output": "[\"Who ate the last cookie? It was the dog!\"]", "fn_name": "cookie"}, {"input": "true", "output": "[\"Who ate the last cookie? It was the dog!\"]", "fn_name": "cookie"}, {"input": "\"... | code_functional |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nLet x be an array of integers x = [x_1, x_2, ..., x_n]. Let's define B(x) as a minimal size of a partition of x into subsegments such that all elements in each subsegment are equal. For example, B([3, 3, 6, 1, 6, 6, 6]) =... | [{"type": "stdin_stdout", "input": "5\n1 1 1 1 1\n1000000000 1000000000 1000000000 1000000000 1000000000\n", "output": "530612279\n"}, {"type": "stdin_stdout", "input": "10\n10 1 9 3 9 4 10 3 8 5\n10 1 10 14 12 4 10 4 10 7\n", "output": "875000103\n"}, {"type": "stdin_stdout", "input": "10\n10 1 9 3 9 4 10 3 8 5\n10 2 ... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nYou are going out for a walk, when you suddenly encounter N monsters. Each monster has a parameter called health, and the health of the i-th monster is h_i at the moment of encounter. A monster will vanish immediately whe... | [{"type": "stdin_stdout", "input": "5 2 1\n900000000\n900000000\n1000000000\n1000000000\n1000000000\n", "output": "800000000\n"}, {"type": "stdin_stdout", "input": "5 2 1\n105611412\n1737860309\n1010000000\n1000000101\n1100000000", "output": "969572082\n"}, {"type": "stdin_stdout", "input": "5 3 1\n105611412\n115148729... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nIlya is an experienced player in tic-tac-toe on the 4 × 4 field. He always starts and plays with Xs. He played a lot of games today with his friend Arseny. The friends became tired and didn't finish the last game. It was ... | [{"type": "stdin_stdout", "input": "xx..\n.oo.\nx...\noox.\n", "output": "YES\n"}, {"type": "stdin_stdout", "input": "x..x\n..oo\no...\nx.xo\n", "output": "YES\n"}, {"type": "stdin_stdout", "input": ".xox\no.x.\nx.o.\n..o.\n", "output": "YES\n"}, {"type": "stdin_stdout", "input": "o.oo\n.x.o\nx.x.\n.x..\n", "output": "... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nSehr Sus is an infinite hexagonal grid as pictured below, controlled by MennaFadali, ZerooCool and Hosssam.\n\nThey love equilateral triangles and want to create $n$ equilateral triangles on the grid by adding some straig... | [{"type": "stdin_stdout", "input": "10\n45996\n1494\n17871\n87082\n59317\n76537\n37514\n56796\n60195\n80410\n", "output": "263\n48\n164\n362\n299\n339\n238\n292\n301\n348\n"}, {"type": "stdin_stdout", "input": "5\n66\n6666\n666666\n66666666\n666666666\n", "output": "10\n100\n1000\n10000\n31623\n"}, {"type": "stdin_stdo... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nGiven N integers A_1, ..., A_N, compute A_1 \\times ... \\times A_N.\nHowever, if the result exceeds 10^{18}, print -1 instead.\n\n-----Constraints-----\n - 2 \\leq N \\leq 10^5\n - 0 \\leq A_i \\leq 10^{18}\n - All value... | [{"type": "stdin_stdout", "input": "31\n4 1 5 9 2 6 5 3 5 8 9 7 9 3 2 3 8 4 6 2 6 4 3 3 8 3 2 7 9 5 0\n", "output": "0\n"}, {"type": "stdin_stdout", "input": "31\n4 1 5 9 2 6 5 3 5 8 9 7 9 3 2 3 8 4 6 2 6 4 3 3 8 0 2 7 9 5 0", "output": "0\n"}, {"type": "stdin_stdout", "input": "31\n4 1 5 9 2 6 5 3 5 8 9 7 9 3 2 3 8 4 ... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nThere are n workers in a company, each of them has a unique id from 1 to n. Exaclty one of them is a chief, his id is s. Each worker except the chief has exactly one immediate superior.\n\nThere was a request to each of t... | [{"type": "stdin_stdout", "input": "10 10\n3 0 0 0 0 0 1 1 1 0\n", "output": "5\n"}, {"type": "stdin_stdout", "input": "10 10\n3 0 0 0 0 0 1 0 1 0\n", "output": "6\n"}, {"type": "stdin_stdout", "input": "10 10\n3 0 0 0 0 1 1 0 1 0\n", "output": "5\n"}, {"type": "stdin_stdout", "input": "10 10\n3 0 0 0 1 1 1 0 1 0\n", "... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nOnce upon a time, Oolimry saw a suffix array. He wondered how many strings can produce this suffix array.\n\nMore formally, given a suffix array of length $n$ and having an alphabet size $k$, count the number of strings t... | [{"type": "stdin_stdout", "input": "73 95\n4 53 37 9 45 54 16 34 12 10 13 24 2 36 33 48 50 43 15 11 47 42 46 30 27 52 67 72 66 19 56 61 69 21 68 1 70 49 64 62 3 51 44 65 29 25 38 28 8 5 39 59 17 6 26 20 63 7 41 23 22 32 40 14 57 60 55 31 35 58 18 0 71\n", "output": "423380456"}, {"type": "stdin_stdout", "input": "73 95... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nWe have N squares assigned the numbers 1,2,3,\\ldots,N. Each square has an integer written on it, and the integer written on Square i is a_i.\n\nHow many squares i satisfy both of the following conditions?\n\n* The assign... | [{"type": "stdin_stdout", "input": "15\n1 10 145 15 87 138 51 194 1 18 77 20 9 17 93", "output": "8\n"}, {"type": "stdin_stdout", "input": "15\n15 11 46 15 50 98 93 129 31 43 44 11 6 24 14", "output": "3\n"}, {"type": "stdin_stdout", "input": "15\n15 11 46 15 50 98 93 129 41 43 44 11 6 24 14", "output": "3\n"}, {"type"... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nFirecrackers scare Nian the monster, but they're wayyyyy too noisy! Maybe fireworks make a nice complement.\n\nLittle Tommy is watching a firework show. As circular shapes spread across the sky, a splendid view unfolds on... | [{"type": "stdin_stdout", "input": "3\n-10 4 10\n10 4 10\n0 -7 10\n", "output": "7\n"}, {"type": "stdin_stdout", "input": "3\n-10 4 10\n10 4 10\n0 -7 10\n", "output": "7\n"}, {"type": "stdin_stdout", "input": "3\n-3 -2 3\n-4 -12 3\n-6 -4 9\n", "output": "5\n"}, {"type": "stdin_stdout", "input": "3\n1 -7 10\n-7 9 10\n-2... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nDima the hamster enjoys nibbling different things: cages, sticks, bad problemsetters and even trees!\n\nRecently he found a binary search tree and instinctively nibbled all of its edges, hence messing up the vertices. Dim... | [{"type": "stdin_stdout", "input": "36\n3 41 82 123 174 216 432 864 1080 1228 2149 4298 8596 11052 22104 33156 35919 71838 179595 359190 431028 862056 994680 1315440 1753920 3507840 7015680 10523520 21047040 26500200 53000400 106000800 132501000 176668000 353336000 530004000\n", "output": "Yes\n"}, {"type": "stdin_stdo... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\n-----Problem Statement-----\nWrite a program that accepts a number, n, and outputs the same.\n\n-----Input-----\nThe only line contains a single integer. \n\n-----Output-----\nOutput the answer in a single line.\n\n-----C... | [{"type": "stdin_stdout", "input": "1047", "output": "1047\n"}, {"type": "stdin_stdout", "input": "1652", "output": "1652\n"}, {"type": "stdin_stdout", "input": "3133", "output": "3133\n"}, {"type": "stdin_stdout", "input": "1313", "output": "1313\n"}, {"type": "stdin_stdout", "input": "1107", "output": "1107\n"}, {"ty... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nAs the students are back in hostel after a long time, the gamers have decided to have a LAN gaming competition to find out who has utilized his time in gaming during vacations. They play \"Counter ATOD\". However, the sco... | [{"type": "stdin_stdout", "input": "2 2200\nvinay 1\nvinay -1000000\nvinay -1000000\nvinay -1000000\nvinay -1000000\nvinay -1000000\nvinay -1000000\nvinay -1000000\nvinay -1000000\nvinay -1000000\nvinay -1000000\nvinay -1000000\nvinay -1000000\nvinay -1000000\nvinay -1000000\nvinay -1000000\nvinay -1000000\nvinay -1000... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nDrazil likes heap very much. So he created a problem with heap:\n\nThere is a max heap with a height h implemented on the array. The details of this heap are the following:\n\nThis heap contains exactly 2^h - 1 distinct p... | [{"type": "stdin_stdout", "input": "2\n3 1\n14 6 3 5 4 2 1\n3 2\n7 4 5 1 3 2 1\n", "output": "1\n1 1 1 1 1 1\n4\n1 1 1 1\n"}, {"type": "stdin_stdout", "input": "2\n3 1\n14 6 3 5 4 2 1\n3 2\n7 6 5 1 3 2 1\n", "output": "1\n1 1 1 1 1 1\n4\n1 1 1 1\n"}, {"type": "stdin_stdout", "input": "2\n3 1\n14 6 3 5 4 2 1\n3 2\n9 6 5... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nYou have $n$ sticks of the given lengths.\n\nYour task is to choose exactly four of them in such a way that they can form a rectangle. No sticks can be cut to pieces, each side of the rectangle must be formed by a single ... | [{"type": "stdin_stdout", "input": "10\n20\n10 14 10 14 10 7 10 10 14 10 7 9 10 8 14 10 10 8 14 15\n12\n7 2 2 2 2 16 16 7 18 17 17 18\n5\n7 13 17 13 7\n6\n10 10 9 9 10 10\n6\n17 19 17 19 14 14\n10\n10 13 5 18 13 13 13 10 18 5\n11\n3 4 16 4 4 3 4 13 4 16 13\n7\n17 19 1 17 17 1 19\n5\n17 17 19 17 19\n9\n13 15 13 18 13 18... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nInitially Ildar has an empty array. He performs $n$ steps. On each step he takes a subset of integers already added to the array and appends the mex of this subset to the array. \n\nThe mex of an multiset of integers is t... | [{"type": "stdin_stdout", "input": "3\n0 1 1000000000\n", "output": "3\n"}, {"type": "stdin_stdout", "input": "3\n1 1 1000000000\n", "output": "1\n"}, {"type": "stdin_stdout", "input": "3\n1 0 1000000000\n", "output": "1\n"}, {"type": "stdin_stdout", "input": "3\n1 0 0000000000\n", "output": "1\n"}, {"type": "stdin_std... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nGiven are a positive integer N and a string S of length N consisting of lowercase English letters.\nDetermine whether the string is a concatenation of two copies of some string.\nThat is, determine whether there is a stri... | [{"type": "stdin_stdout", "input": "100\ntttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttt\n", "output": "Yes\n"}, {"type": "stdin_stdout", "input": "100\nyyxyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy\n", "output":... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nIn this task you need to process a set of stock exchange orders and use them to create order book.\n\nAn order is an instruction of some participant to buy or sell stocks on stock exchange. The order number i has price p_... | [{"type": "stdin_stdout", "input": "3 3\nB 16671 5044\nS 23924 4895\nS 76276 1905\n", "output": "S 76276 1905\nS 23924 4895\nB 16671 5044\n"}, {"type": "stdin_stdout", "input": "3 3\nB 16671 5006\nS 23924 4895\nS 76276 1905\n", "output": "S 76276 1905\nS 23924 4895\nB 16671 5006\n"}, {"type": "stdin_stdout", "input": "... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nProblem C Medical Checkup\n\nStudents of the university have to go for a medical checkup, consisting of lots of checkup items, numbered 1, 2, 3, and so on.\n\nStudents are now forming a long queue, waiting for the checkup... | [{"type": "stdin_stdout", "input": "3 102\n1\n3\n0", "output": "103\n34\n34\n"}, {"type": "stdin_stdout", "input": "3 35\n1\n3\n3", "output": "36\n12\n11\n"}, {"type": "stdin_stdout", "input": "3 55\n1\n3\n4", "output": "56\n19\n13\n"}, {"type": "stdin_stdout", "input": "3 55\n1\n3\n0", "output": "56\n19\n19\n"}, {"typ... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nVasya has found a piece of paper with an array written on it. The array consists of n integers a_1, a_2, ..., a_{n}. Vasya noticed that the following condition holds for the array a_{i} ≤ a_{i} + 1 ≤ 2·a_{i} for any posit... | [{"type": "stdin_stdout", "input": "48\n4 7 12 16 23 43 61 112 134 141 243 267 484 890 1427 1558 1653 2263 2889 3313 3730 5991 10176 18243 18685 36555 40006 62099 70557 106602 122641 125854 213236 309698 379653 713328 999577 1021356 2007207 2886237 4994645 5812125 11576387 14215887 26060277 35989707 36964781 57933366\n... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nGenerate and return **all** possible increasing arithmetic progressions of six primes `[a, b, c, d, e, f]` between the given limits. Note: the upper and lower limits are inclusive.\n\nAn arithmetic progression is a sequen... | [{"input": "1000\n4000", "output": "[[[1013, 1193, 1373, 1553, 1733, 1913], [1039, 1249, 1459, 1669, 1879, 2089], [1039, 1609, 2179, 2749, 3319, 3889], [1091, 1301, 1511, 1721, 1931, 2141], [1201, 1471, 1741, 2011, 2281, 2551], [1289, 1709, 2129, 2549, 2969, 3389], [1301, 1511, 1721, 1931, 2141, 2351], [1307, 1487, 166... | code_functional |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nВ самолёте есть n рядов мест. Если смотреть на ряды сверху, то в каждом ряду есть 3 места слева, затем проход между рядами, затем 4 центральных места, затем ещё один проход между рядами, а затем ещё 3 места справа.\n\nИзв... | [{"type": "stdin_stdout", "input": "30 1\nPPP-PPP.-PPP\nPPP-PPPP-PPP\nPPP-PPPP-PPP\nPPP-PPPP-PPP\nPPP-PPPP-PPP\nPPP-PPPP-PPP\nPPP-PPPP-PPP\nPPP-PPPP-PPP\nPPP-PPPP-PPP\nPPP-PPPP-PPP\nPPP-PPPP-PPP\nPPP-PPPP-PPP\nPPP-PPPP-PPP\nPPP-PPPP-PPP\nPPP-PPPP-PPP\nPPP-PPPP-PPP\nPPP-PPPP-PPP\nPPP-PPPP-PPP\nPPP-PPPP-PPP\nPPP-PPPP-PPP... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nWhen Petya went to school, he got interested in large numbers and what they were called in ancient times. For instance, he learned that the Russian word \"tma\" (which now means \"too much to be counted\") used to stand f... | [{"type": "stdin_stdout", "input": "2147483647\n2147483647\n", "output": "YES\n0\n"}, {"type": "stdin_stdout", "input": "2147483646\n2147483647\n", "output": "NO\n"}, {"type": "stdin_stdout", "input": "1094841453\n1656354409\n", "output": "NO\n"}, {"type": "stdin_stdout", "input": "2147483647\n2147483646\n", "output": ... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nVasya is studying in the last class of school and soon he will take exams. He decided to study polynomials. Polynomial is a function P(x) = a_0 + a_1x^1 + ... + a_{n}x^{n}. Numbers a_{i} are called coefficients of a polyn... | [{"type": "stdin_stdout", "input": "1000000000000000000 1000000000000000000 1000000000000000000\n", "output": "2\n"}, {"type": "stdin_stdout", "input": "1000000000000000000 1000000000000000000 1000000000000000000\n", "output": "2\n"}, {"type": "stdin_stdout", "input": "1001000000000000000 1000000000000000000 1000000000... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\n# Introduction \n\nKa ka ka cypher is a cypher used by small children in some country. When a girl wants to pass something to the other girls and there are some boys nearby, she can use Ka cypher. So only the other girls ... | [{"input": "\"Incomprehensibilities\"", "output": "[\"kaIkancokamprekahekansikabikalikatiekas\"]", "fn_name": "ka_co_ka_de_ka_me"}, {"input": "\"maintenance\"", "output": "[\"kamaikantekanakance\"]", "fn_name": "ka_co_ka_de_ka_me"}, {"input": "\"Woodie\"", "output": "[\"kaWookadie\"]", "fn_name": "ka_co_ka_de_ka_me"}, ... | code_functional |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nThis function should test if the `factor` is a factor of `base`.\n\nReturn `true` if it is a factor or `false` if it is not.\n\n## About factors\nFactors are numbers you can multiply together to get another number.\n\n2 a... | [{"input": "24617\n3", "output": "[false]", "fn_name": "check_for_factor"}, {"input": "24612\n3", "output": "[true]", "fn_name": "check_for_factor"}, {"input": "2453\n5", "output": "[false]", "fn_name": "check_for_factor"}, {"input": "2450\n5", "output": "[true]", "fn_name": "check_for_factor"}, {"input": "653\n7", "ou... | code_functional |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nShaass has decided to hunt some birds. There are n horizontal electricity wires aligned parallel to each other. Wires are numbered 1 to n from top to bottom. On each wire there are some oskols sitting next to each other. ... | [{"type": "stdin_stdout", "input": "100\n54 15 25 18 64 62 23 59 70 137 50 26 87 35 75 86 0 22 6 60 70 41 21 9 75 50 25 3 69 14 39 68 64 46 59 99 2 0 21 76 90 12 61 42 12 91 36 39 47 41 93 81 66 57 70 36 68 89 52 1 19 93 67 22 76 20 8 81 123 18 100 73 61 93 75 80 53 72 40 20 2 86 33 70 27 16 11 26 55 44 47 55 94 58 2 5... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nAn atom of element X can exist in n distinct states with energies E_1 < E_2 < ... < E_{n}. Arkady wants to build a laser on this element, using a three-level scheme. Here is a simplified description of the scheme. \n\nThr... | [{"type": "stdin_stdout", "input": "50 64\n257 258 350 375 1014 1017 1051 1097 1169 1177 1223 1836 1942 1983 2111 2131 2341 2418 2593 2902 2948 3157 3243 3523 3566 4079 4499 4754 5060 5624 6279 6976 7011 7071 7278 7366 7408 7466 7526 7837 7934 8532 8577 8680 9221 9271 9327 9411 9590 9794\n", "output": "0.91891891891891... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nGiven are strings S and T. Consider changing S to T by repeating the operation below. Find the minimum number of operations required to do so.\nOperation: Choose one character of S and replace it with a different characte... | [{"type": "stdin_stdout", "input": "sjpvbzildfxlaukqtfznjjyryrdawsycubdpieejlzsexyhuajiqqigetwdyjeignkuuedzguvqhyrubpdfsenayqahbaqnyhavlaptlqtrotfzvbqbtpkuddnopjzoteuubxgkthzdyepesqgozkdvkcakraxeulhhqtnpolbtcsgxgskjjzdimcyhclnnwfbxwmznpvjaqjqqogwgwmzzpcvhywpcocmsxxmgsodckxvipzobspvwjezxugjlivdhefgdfkzzidktxjcnayjubmsqm... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nGiven a side length `n`, traveling only right and down how many ways are there to get from the top left corner to the bottom right corner of an `n by n` grid?\n\nYour mission is to write a program to do just that!\n\nAdd ... | [{"input": "165", "output": "[95995892383488599901870820732368671856306475542669347911637204757217297906428740013991568571288240]", "fn_name": "routes"}, {"input": "156", "output": "[376594020312425061595746241557406711201605603899894320577733841460621358204120168599683135056]", "fn_name": "routes"}, {"input": "126", "... | code_functional |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nYou are given two rectangles on a plane. The centers of both rectangles are located in the origin of coordinates (meaning the center of the rectangle's symmetry). The first rectangle's sides are parallel to the coordinate... | [{"type": "stdin_stdout", "input": "988480 1151420 106\n", "output": "981327901099.81217265129089355"}, {"type": "stdin_stdout", "input": "1503946 527535 69\n", "output": "298092342476.75622430443763733"}, {"type": "stdin_stdout", "input": "988480 819219 106\n", "output": "684860009476.82913672924041748"}, {"type": "st... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nLet's assume that \n\n * v(n) is the largest prime number, that does not exceed n;\n * u(n) is the smallest prime number strictly greater than n. \n\n\n\nFind <image>.\n\nInput\n\nThe first line contains integer t (1 ≤ ... | [{"type": "stdin_stdout", "input": "6\n999\n1095\n821\n635\n63\n480\n", "output": "1003961/2011946\n1196833/2398042\n674039/1351366\n403199/808942\n3959/8174\n232303/466546\n"}, {"type": "stdin_stdout", "input": "6\n999\n588\n821\n635\n63\n480\n", "output": "1003961/2011946\n346909/696182\n674039/1351366\n403199/808942... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nCaracal is fighting with a monster.\nThe health of the monster is H.\nCaracal can attack by choosing one monster. When a monster is attacked, depending on that monster's health, the following happens:\n - If the monster's... | [{"type": "stdin_stdout", "input": "1000000000000\n", "output": "1099511627775\n"}, {"type": "stdin_stdout", "input": "999999999999\n", "output": "1099511627775\n"}, {"type": "stdin_stdout", "input": "549755813888\n", "output": "1099511627775\n"}, {"type": "stdin_stdout", "input": "707813884927\n", "output": "109951162... | 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\nEugene loves sequences, especially arithmetic progressions. One day he was asked to solve a difficult problem.\n\nIf a sequence of numbers ... | [{"type": "stdin_stdout", "input": "2\n-3 3 -2 -2\n2 2 126 3", "output": "6\n-609\n"}, {"type": "stdin_stdout", "input": "2\n-3 3 -2 -2\n2 2 126 0", "output": "6\n-621\n"}, {"type": "stdin_stdout", "input": "2\n-1 6 -2 -2\n2 2 92 -1", "output": "8\n-461\n"}, {"type": "stdin_stdout", "input": "2\n-2 6 -2 -2\n2 2 92 -1",... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nAlice and Borys are playing tennis.\n\nA tennis match consists of games. In each game, one of the players is serving and the other one is receiving.\n\nPlayers serve in turns: after a game where Alice is serving follows a... | [{"type": "stdin_stdout", "input": "2\n134843 8\n2 6957\n", "output": "18\n67417 67418 67419 67420 67421 67422 67423 67424 67425 67426 67427 67428 67429 67430 67431 67432 67433 67434\n6\n3477 3478 3479 3480 3481 3482\n"}, {"type": "stdin_stdout", "input": "2\n35737 8\n0 960\n", "output": "18\n17864 17865 17866 17867 17... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nPolycarpus has a ribbon, its length is n. He wants to cut the ribbon in a way that fulfils the following two conditions: \n\n * After the cutting each ribbon piece should have length a, b or c. \n * After the cutting th... | [{"type": "stdin_stdout", "input": "3043 317 1141 2438\n", "output": "7\n"}, {"type": "stdin_stdout", "input": "3399 2035 2 3334\n", "output": "683\n"}, {"type": "stdin_stdout", "input": "4000 500 1000 2000\n", "output": "8\n"}, {"type": "stdin_stdout", "input": "4000 500 1000 1671\n", "output": "8\n"}, {"type": "stdin... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nThere are $n$ bags with candies, initially the $i$-th bag contains $i$ candies. You want all the bags to contain an equal amount of candies in the end.\n\nTo achieve this, you will:\n\nChoose $m$ such that $1 \\le m \\le ... | [{"type": "stdin_stdout", "input": "100\n100\n2\n3\n4\n5\n6\n7\n8\n9\n15\n14\n12\n13\n14\n15\n16\n17\n6\n19\n17\n21\n32\n23\n24\n6\n26\n27\n28\n29\n0\n31\n32\n52\n34\n35\n72\n37\n38\n11\n5\n20\n35\n43\n44\n15\n46\n47\n26\n49\n50\n51\n54\n53\n54\n55\n72\n73\n69\n103\n60\n61\n62\n49\n58\n6\n40\n67\n121\n69\n48\n71\n127\n... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nCreate a function xMasTree(height) that returns a christmas tree of the correct height. The height is passed through to the function and the function should return a list containing each line of the tree. \n```\nxMasTree(... | [{"input": "7", "output": "[[\"______#______\", \"_____###_____\", \"____#####____\", \"___#######___\", \"__#########__\", \"_###########_\", \"#############\", \"______#______\", \"______#______\"]]", "fn_name": "xMasTree"}, {"input": "6", "output": "[[\"_____#_____\", \"____###____\", \"___#####___\", \"__#######__\... | code_functional |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nIn the year of 30XX participants of some world programming championship live in a single large hotel. The hotel has n floors. Each floor has m sections with a single corridor connecting all of them. The sections are enume... | [{"type": "stdin_stdout", "input": "10 10 1 8 4\n10\n2 3 4 5 6 7 8 9\n10\n1 1 3 1\n2 1 7 1\n1 1 9 1\n7 1 4 1\n10 1 7 1\n2 1 7 1\n3 1 2 1\n5 1 2 1\n10 1 5 1\n6 1 9 1\n", "output": "3\n4\n4\n3\n3\n4\n3\n3\n4\n3\n"}, {"type": "stdin_stdout", "input": "10 18 1 8 4\n10\n2 3 4 5 6 7 8 9\n10\n1 1 3 1\n2 1 7 1\n1 1 9 1\n7 1 4 ... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nproblem\n\nChairman K is a regular customer of the JOI pizza shop in the center of JOI city. For some reason, he decided to start a life-saving life this month. So he wanted to order the pizza with the highest calories pe... | [{"type": "stdin_stdout", "input": "3\n16 2\n358\n87\n1601\n010", "output": "108\n"}, {"type": "stdin_stdout", "input": "3\n16 2\n696\n77\n1150\n010", "output": "102\n"}, {"type": "stdin_stdout", "input": "3\n12 2\n200\n87\n1514\n010", "output": "122\n"}, {"type": "stdin_stdout", "input": "3\n12 2\n491\n77\n1150\n010",... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nYou have an array $a_1, a_2, \\dots, a_n$ consisting of $n$ distinct integers. You are allowed to perform the following operation on it:\n\nChoose two elements from the array $a_i$ and $a_j$ ($i \\ne j$) such that $\\gcd(... | [{"type": "stdin_stdout", "input": "57\n241 444 553 126 612 550 441 420 742 879 520 664 590 198 910 731 308 740 791 680 904 629 324 606 621 75 350 253 57 164 440 970 876 648 581 258 989 851 186 117 700 537 837 284 654 130 728 955 859 988 820 345 901 294 244 125 512\n", "output": "48"}, {"type": "stdin_stdout", "input":... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nA: Isono, let's do that! --Sendame -\n\nstory\n\nNakajima \"Isono ~, let's do that!\"\n\nIsono \"What is that, Nakajima\"\n\nNakajima \"Look, that's that. It's hard to explain because I have to express it in letters for s... | [{"type": "stdin_stdout", "input": "3\ntameru\ntameru\nuremat\ntameru\nkougekida\ntameru", "output": "Nakajima-kun\n"}, {"type": "stdin_stdout", "input": "3\ntameru\ntameru\nuremat\ntameru\nadikeguok\ntameru", "output": "Hikiwake-kun\n"}, {"type": "stdin_stdout", "input": "3\ntameru\ntameru\nuremat\ntameru\nadikeguok\n... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nPolycarp is going to participate in the contest. It starts at $h_1:m_1$ and ends at $h_2:m_2$. It is guaranteed that the contest lasts an even number of minutes (i.e. $m_1 \\% 2 = m_2 \\% 2$, where $x \\% y$ is $x$ modulo... | [{"type": "stdin_stdout", "input": "10:00\n11:00\n", "output": "10:30\n"}, {"type": "stdin_stdout", "input": "11:10\n11:12\n", "output": "11:11\n"}, {"type": "stdin_stdout", "input": "01:02\n03:02\n", "output": "02:02\n"}, {"type": "stdin_stdout", "input": "00:00\n23:58\n", "output": "11:59\n"}, {"type": "stdin_stdout"... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nThere are n problems prepared for the next Codeforces round. They are arranged in ascending order by their difficulty, and no two problems have the same difficulty. Moreover, there are m pairs of similar problems. Authors... | [{"type": "stdin_stdout", "input": "100000 10\n99562 484\n1099 99684\n593 99867\n99529 175\n99738 616\n99523 766\n99503 121\n99784 158\n199 99199\n15 99849\n", "output": "98100\n"}, {"type": "stdin_stdout", "input": "100000 10\n99562 484\n1099 99684\n593 99867\n99529 175\n99738 616\n99523 766\n42925 121\n99784 158\n199... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nRecently a serious bug has been found in the FOS code. The head of the F company wants to find the culprit and punish him. For that, he set up an organizational meeting, the issue is: who's bugged the code? Each of the n ... | [{"type": "stdin_stdout", "input": "10 3\n6 3\n6 10\n2 5\n5 7\n6 2\n9 2\n8 1\n10 5\n5 10\n7 6\n", "output": "34\n"}, {"type": "stdin_stdout", "input": "10 2\n10 2\n9 3\n9 4\n7 2\n4 6\n10 1\n9 2\n3 10\n7 1\n5 1\n", "output": "43\n"}, {"type": "stdin_stdout", "input": "10 3\n6 3\n6 10\n2 5\n5 7\n6 2\n9 2\n8 1\n10 5\n5 10... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nTakahashi has N days of summer vacation.\nHis teacher gave him M summer assignments. It will take A_i days for him to do the i-th assignment.\nHe cannot do multiple assignments on the same day, or hang out on a day he doe... | [{"type": "stdin_stdout", "input": "1000000 10000\n10000 10000 10000 10000 10000 10000 10000 10000 10000 10000 10000 10000 10000 10000 10000 10000 10000 10000 10000 10000 10000 10000 10000 10000 10000 10000 10000 10000 10000 10000 10000 10000 10000 10000 10000 10000 10000 10000 10000 10000 10000 10000 10000 10000 10000... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\n— This is not playing but duty as allies of justice, Nii-chan!\n\n— Not allies but justice itself, Onii-chan!\n\nWith hands joined, go everywhere at a speed faster than our thoughts! This time, the Fire Sisters — Karen an... | [{"type": "stdin_stdout", "input": "5000 5000 5000\n", "output": "986778560\n"}, {"type": "stdin_stdout", "input": "1171 2989 2853\n", "output": "234725427\n"}, {"type": "stdin_stdout", "input": "3238 2923 4661\n", "output": "636587126\n"}, {"type": "stdin_stdout", "input": "4539 2805 2702\n", "output": "356944655\n"},... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nStepan likes to repeat vowel letters when he writes words. For example, instead of the word \"pobeda\" he can write \"pobeeeedaaaaa\".\n\nSergey does not like such behavior, so he wants to write a program to format the wo... | [{"type": "stdin_stdout", "input": "200\nmmffggzvuuzzlkafduueqocuybiiaaeeoiioouaaurccuqoouuooooooyjjtyyxxiipnoeufyuuoyxxhhkaaeoooxapauuoppzabuuoiiuuggcciissuugejjiirruummsiifaauyypauwoofiemzaeeeeeeiioozzttyyidaaaiggizzerkooooeeepueeauupathhb\n", "output": "mmffggzvuzzlkafdueqocuybiaeeoioouaurccuqoouoyjjtyxxipnoeufyuoyx... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\n500-yen Saving\n\n\"500-yen Saving\" is one of Japanese famous methods to save money. The method is quite simple; whenever you receive a 500-yen coin in your change of shopping, put the coin to your 500-yen saving box. Ty... | [{"type": "stdin_stdout", "input": "4\n800\n700\n1600\n600\n4\n300\n1205\n1600\n30\n4\n300\n700\n1600\n650\n3\n1001\n2000\n638\n3\n250\n250\n1000\n4\n1251\n1466\n698\n299\n0", "output": "2 2900\n4 3135\n3 3250\n2 1639\n3 1500\n4 3714\n"}, {"type": "stdin_stdout", "input": "4\n800\n700\n1600\n600\n4\n300\n1205\n1600\n30... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nHolidays have finished. Thanks to the help of the hacker Leha, Noora managed to enter the university of her dreams which is located in a town Pavlopolis. It's well known that universities provide students with dormitory f... | [{"type": "stdin_stdout", "input": "12 1000000000\n", "output": "479001600\n"}, {"type": "stdin_stdout", "input": "1000000000 12\n", "output": "479001600\n"}, {"type": "stdin_stdout", "input": "1000000000 12\n", "output": "479001600\n"}, {"type": "stdin_stdout", "input": "12 1000000000\n", "output": "479001600\n"}, {"t... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nThere is an infinite board of square tiles. Initially all tiles are white.\n\nVova has a red marker and a blue marker. Red marker can color $a$ tiles. Blue marker can color $b$ tiles. If some tile isn't white then you can... | [{"type": "stdin_stdout", "input": "99999999999973 99999999999971\n", "output": "199999999999948\n"}, {"type": "stdin_stdout", "input": "99999999999962 99999999999973\n", "output": "133333333333296\n"}, {"type": "stdin_stdout", "input": "99999999999973 99999999999930\n", "output": "399999999999808\n"}, {"type": "stdin_... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nCQXYM is counting permutations length of $2n$.\n\nA permutation is an array consisting of $n$ distinct integers from $1$ to $n$ in arbitrary order. For example, $[2,3,1,5,4]$ is a permutation, but $[1,2,2]$ is not a permu... | [{"type": "stdin_stdout", "input": "20\n597\n2791\n71\n1\n6\n14\n196\n1\n4335\n14\n5133\n6\n17\n3620\n5111\n1\n119\n992\n76848\n127\n", "output": "924058387\n309126958\n25034588\n1\n239500800\n517878947\n323758520\n1\n41675960\n517878947\n479930293\n239500800\n971636156\n715097853\n974503605\n1\n796779807\n613317322\n1... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nWrite a function that takes a single array as an argument (containing multiple strings and/or positive numbers and/or arrays), and returns one of four possible string values, depending on the ordering of the lengths of th... | [{"input": "[[1, 23, 456, 78910], [\"abcdef\", \"ghijklmno\", \"pqrstuvwxy\"], [[1, 23, 456, 78910, [\"abcdef\", \"ghijklmno\", \"pqrstuvwxy\"]], 1234]]", "output": "[\"Decreasing\"]", "fn_name": "order_type"}, {"input": "[[\"ab\", \"cdef\", \"g\"], [\"hi\", \"jk\", \"lmnopq\"], [\"rst\", \"uv\", \"wx\"], [\"yz\"]]", "... | code_functional |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nYou are a mayor of Berlyatov. There are $n$ districts and $m$ two-way roads between them. The $i$-th road connects districts $x_i$ and $y_i$. The cost of travelling along this road is $w_i$. There is some path between eac... | [{"type": "stdin_stdout", "input": "5 5 4\n1 2 5\n4 3 4\n1 4 3\n4 3 10\n3 5 2\n1 5\n1 3\n3 3\n1 5\n", "output": "13\n"}, {"type": "stdin_stdout", "input": "5 5 4\n1 2 5\n4 3 4\n1 4 3\n4 3 10\n3 5 2\n1 2\n1 3\n3 3\n1 5\n", "output": "13\n"}, {"type": "stdin_stdout", "input": "5 5 4\n1 2 5\n2 3 4\n1 4 3\n4 3 7\n3 5 2\n1 ... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nSuppose $a_1, a_2, \\dots, a_n$ is a sorted integer sequence of length $n$ such that $a_1 \\leq a_2 \\leq \\dots \\leq a_n$.\n\nFor every $1 \\leq i \\leq n$, the prefix sum $s_i$ of the first $i$ terms $a_1, a_2, \\dots,... | [{"type": "stdin_stdout", "input": "10\n2 1\n1000000000\n3 2\n-100000000 -150000003\n3 2\n-100000000 -150000004\n3 2\n-100000000 -150000001\n3 2\n-100000000 -150000002\n3 2\n-100000000 -150000000\n3 2\n-100000000 -149999999\n3 2\n-100000000 -149999999\n3 2\n-100000000 -149999998\n3 2\n-100000000 -149999997\n", "output"... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nA number is called almost prime if it has exactly two distinct prime divisors. For example, numbers 6, 18, 24 are almost prime, while 4, 8, 9, 42 are not. Find the amount of almost prime numbers which are between 1 and n,... | [{"type": "stdin_stdout", "input": "2998\n", "output": "1375\n"}, {"type": "stdin_stdout", "input": "2999\n", "output": "1375\n"}, {"type": "stdin_stdout", "input": "2997\n", "output": "1374\n"}, {"type": "stdin_stdout", "input": "3000\n", "output": "1375\n"}, {"type": "stdin_stdout", "input": "2990\n", "output": "1370... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nVasya had a strictly increasing sequence of positive integers a_1, ..., a_{n}. Vasya used it to build a new sequence b_1, ..., b_{n}, where b_{i} is the sum of digits of a_{i}'s decimal representation. Then sequence a_{i}... | [{"type": "stdin_stdout", "input": "100\n18\n18\n18\n18\n18\n18\n18\n18\n18\n18\n18\n18\n18\n18\n18\n18\n18\n18\n18\n18\n18\n18\n18\n18\n18\n18\n18\n18\n18\n18\n18\n18\n18\n18\n18\n18\n18\n18\n18\n18\n18\n18\n18\n18\n18\n18\n18\n18\n18\n18\n18\n18\n18\n6\n18\n18\n18\n18\n18\n18\n18\n18\n18\n18\n18\n18\n18\n18\n18\n18\n... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\n#Permutation position\nIn this kata you will have to permutate through a string of lowercase letters, each permutation will start at ```a``` and you must calculate how many iterations it takes to reach the current permut... | [{"input": "\"foo\"", "output": "[3759]", "fn_name": "permutation_position"}, {"input": "\"aaab\"", "output": "[2]", "fn_name": "permutation_position"}, {"input": "\"aaa\"", "output": "[1]", "fn_name": "permutation_position"}, {"input": "\"z\"", "output": "[26]", "fn_name": "permutation_position"}, {"input": "\"a\"", "... | code_functional |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nDNA is a biomolecule that carries genetic information. It is composed of four different building blocks, called nucleotides: adenine (A), thymine (T), cytosine (C) and guanine (G). Two DNA strands join to form a double he... | [{"input": "\"TGCTACGTACGATCGACGATCCACGAC\"\n\"GTCGTGGATCGTCGATCGTACGTAGCA\"", "output": "[true]", "fn_name": "check_DNA"}, {"input": "\"CGACATCGAGGGGGCTCAGAAGTACTGA\"\n\"CATGGCGTCAGTACTTCTGAGCC\"", "output": "[false]", "fn_name": "check_DNA"}, {"input": "\"ATGCCTACGGCCATATATATTTAG\"\n\"CTAAATATGTATGGCCGTAGGCAT\"", "ou... | code_functional |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nMy little sister came back home from school with the following task:\ngiven a squared sheet of paper she has to cut it in pieces\nwhich, when assembled, give squares the sides of which form\nan increasing sequence of numb... | [{"input": "7654322", "output": "[[1, 4, 11, 69, 3912, 7654321]]", "fn_name": "decompose"}, {"input": "7654321", "output": "[[6, 10, 69, 3912, 7654320]]", "fn_name": "decompose"}, {"input": "123456", "output": "[[1, 2, 7, 29, 496, 123455]]", "fn_name": "decompose"}, {"input": "1234567", "output": "[[2, 8, 32, 1571, 123... | code_functional |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nThe Smart Beaver from ABBYY decided to have a day off. But doing nothing the whole day turned out to be too boring, and he decided to play a game with pebbles. Initially, the Beaver has n pebbles. He arranges them in a eq... | [{"type": "stdin_stdout", "input": "1000000000\n", "output": "1998535156\n"}, {"type": "stdin_stdout", "input": "1000001000\n", "output": "1906011808\n"}, {"type": "stdin_stdout", "input": "1549355491\n", "output": "1559780582\n"}, {"type": "stdin_stdout", "input": "1292236879\n", "output": "1292236880\n"}, {"type": "s... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nLet's assume that we are given a matrix b of size x × y, let's determine the operation of mirroring matrix b. The mirroring of matrix b is a 2x × y matrix c which has the following properties:\n\n the upper half of matri... | [{"type": "stdin_stdout", "input": "8 20\n0 0 1 1 1 1 0 0 0 0 1 1 1 1 0 0 0 1 1 0\n1 0 1 0 1 0 0 0 0 1 0 1 0 1 1 0 1 1 1 1\n1 0 1 0 1 0 0 0 0 1 0 1 0 1 1 0 1 1 1 1\n0 0 1 1 1 1 0 0 0 0 1 1 1 1 0 0 0 1 1 0\n0 0 1 1 1 1 0 0 0 0 1 1 1 1 0 0 0 1 1 0\n1 0 1 0 1 0 0 0 0 1 0 1 0 1 1 0 1 1 1 1\n1 0 1 0 1 0 0 0 0 1 0 1 0 1 1 0 ... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nYou are given undirected weighted graph. Find the length of the shortest cycle which starts from the vertex 1 and passes throught all the edges at least once. Graph may contain multiply edges between a pair of vertices an... | [{"type": "stdin_stdout", "input": "15 32\n15 9 8860\n12 4 9045\n12 12 8221\n9 6 8306\n11 14 9052\n13 14 8176\n14 5 8857\n6 8 8835\n3 9 8382\n10 14 8212\n13 13 9061\n2 14 8765\n4 13 9143\n13 13 8276\n13 11 8723\n7 10 8775\n8 15 8965\n15 5 8800\n4 5 9317\n5 13 9178\n1 7 9031\n4 10 9114\n10 4 8628\n9 1 8584\n5 7 8701\n6 ... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nThe Smart Beaver from ABBYY came up with another splendid problem for the ABBYY Cup participants! This time the Beaver invites the contest participants to check out a problem on sorting documents by their subjects. Let's ... | [{"type": "stdin_stdout", "input": "2000\nJAPAN FEBRUARY MONEY SUPPLY RISES 8.8 PCT\nTOKYO, March 17 - Japan's broadly defined money supply\naverage of M-2 plus certificate of deposits (CDs) rose a\npreliminary 8.8 pct in February from a year earlier, compared\nwith an 8.6 pct rise ni January, the Bank of Japan said.\n... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nWrite function describeList which returns \"empty\" if the list is empty or \"singleton\" if it contains only one element or \"longer\"\" if more.\n\nWrite your solution by modifying this code:\n\n```python\ndef describeL... | [{"input": "[\"one\", \"two\"]", "output": "[\"longer\"]", "fn_name": "describeList"}, {"input": "[1, 2, 5, 4]", "output": "[\"longer\"]", "fn_name": "describeList"}, {"input": "[[1, 2]]", "output": "[\"singleton\"]", "fn_name": "describeList"}, {"input": "[\"one\"]", "output": "[\"singleton\"]", "fn_name": "describeLi... | code_functional |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nGiven a string of words and numbers. Extract the expression including: \n1. the operator: either addition or subtraction\n2. the two numbers that we are operating on\n\nReturn the result of the calculation.\n\nExample:\n\... | [{"input": "\"Fred has 110 bananas and loses 50\"", "output": "[60]", "fn_name": "calculate"}, {"input": "\"Panda has 48 apples and loses 4\"", "output": "[44]", "fn_name": "calculate"}, {"input": "\"Jerry has 34 apples and gains 6\"", "output": "[40]", "fn_name": "calculate"}, {"input": "\"Tom has 20 apples and gains ... | code_functional |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nIvan plays an old action game called Heretic. He's stuck on one of the final levels of this game, so he needs some help with killing the monsters.\n\nThe main part of the level is a large corridor (so large and narrow tha... | [{"type": "stdin_stdout", "input": "2\n3 2\n1 3 5\n4 1\n5 2 3 5\n", "output": "2\n2\n"}, {"type": "stdin_stdout", "input": "2\n3 2\n1 3 5\n4 1\n5 4 3 5\n", "output": "2\n3\n"}, {"type": "stdin_stdout", "input": "2\n3 2\n1 1 5\n4 1\n5 4 3 5\n", "output": "1\n3\n"}, {"type": "stdin_stdout", "input": "2\n3 2\n0 1 5\n4 1\n... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nThere is an integer sequence A of length N whose values are unknown.\nGiven is an integer sequence B of length N-1 which is known to satisfy the following:\n B_i \\geq \\max(A_i, A_{i+1}) \nFind the maximum possible sum o... | [{"type": "stdin_stdout", "input": "100\n100000 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 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\nAt the big break Nastya came to the school dining room. There are $n$ pupils in the school, numbered from $1$ to $n$. Unfortunately, Nastya came pretty late, so that all pupils had already stood in the queue, i.e. Nastya ... | [{"type": "stdin_stdout", "input": "20 47\n4 6 11 15 9 17 3 1 19 14 12 8 2 5 7 20 16 18 13 10\n18 10\n6 3\n15 17\n18 7\n4 5\n19 10\n6 7\n11 3\n1 10\n17 3\n6 14\n7 10\n19 5\n12 10\n1 8\n6 11\n18 5\n6 8\n12 12\n1 5\n20 11\n16 8\n3 10\n20 19\n17 8\n19 10\n2 5\n19 8\n6 9\n16 3\n16 10\n19 7\n17 16\n10 13\n8 9\n12 5\n17 10\n... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nTakahashi participated in a contest on AtCoder.\nThe contest had N problems.\nTakahashi made M submissions during the contest.\nThe i-th submission was made for the p_i-th problem and received the verdict S_i (AC or WA).\... | [{"type": "stdin_stdout", "input": "100000 3\n7777 AC\n7777 AC\n7777 AC\n", "output": "1 0\n"}, {"type": "stdin_stdout", "input": "100000 3\n12676 AC\n7777 AC\n7777 CA", "output": "2 0\n"}, {"type": "stdin_stdout", "input": "100000 3\n7777 AC\n7777 AC\n7777 CA", "output": "1 0\n"}, {"type": "stdin_stdout", "input": "10... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nA series or sequence of numbers is usually the product of a function and can either be infinite or finite.\n\nIn this kata we will only consider finite series and you are required to return a code according to the type of... | [{"input": "[3, 5, 8, 9, 14, 23]", "output": "[1]", "fn_name": "sequence_classifier"}, {"input": "[3, 5, 8, 8, 14, 14]", "output": "[2]", "fn_name": "sequence_classifier"}, {"input": "[14, 14, 8, 8, 5, 3]", "output": "[4]", "fn_name": "sequence_classifier"}, {"input": "[3, 5, 8, 1, 14, 3]", "output": "[0]", "fn_name": ... | code_functional |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nLet S(n) denote the sum of the digits in the decimal notation of n.\nFor example, S(101) = 1 + 0 + 1 = 2.\nGiven an integer N, determine if S(N) divides N.\n\n-----Constraints-----\n - 1 \\leq N \\leq 10^9\n\n-----Input--... | [{"type": "stdin_stdout", "input": "1000000000\n", "output": "Yes\n"}, {"type": "stdin_stdout", "input": "999999999\n", "output": "Yes\n"}, {"type": "stdin_stdout", "input": "873041724\n", "output": "Yes\n"}, {"type": "stdin_stdout", "input": "689670774\n", "output": "Yes\n"}, {"type": "stdin_stdout", "input": "5064791... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nGrandma Laura came to the market to sell some apples. During the day she sold all the apples she had. But grandma is old, so she forgot how many apples she had brought to the market.\n\nShe precisely remembers she had n b... | [{"type": "stdin_stdout", "input": "40 562\nhalfplus\nhalfplus\nhalfplus\nhalfplus\nhalfplus\nhalfplus\nhalfplus\nhalfplus\nhalf\nhalf\nhalf\nhalfplus\nhalf\nhalf\nhalfplus\nhalf\nhalfplus\nhalf\nhalfplus\nhalf\nhalfplus\nhalf\nhalfplus\nhalfplus\nhalfplus\nhalfplus\nhalfplus\nhalf\nhalf\nhalfplus\nhalf\nhalfplus\nhalf... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nLet's say you are standing on the $XY$-plane at point $(0, 0)$ and you want to reach point $(n, n)$.\n\nYou can move only in two directions:\n\nto the right, i. e. horizontally and in the direction that increase your $x$ ... | [{"type": "stdin_stdout", "input": "3\n2\n13 100\n3\n4 3 1\n5\n13 4 1 1 5\n", "output": "226\n15\n25\n"}, {"type": "stdin_stdout", "input": "3\n2\n13 100\n3\n2 3 0\n5\n4 3 2 1 5\n", "output": "226\n11\n19\n"}, {"type": "stdin_stdout", "input": "3\n2\n13 100\n3\n2 3 0\n5\n4 3 1 1 5\n", "output": "226\n11\n15\n"}, {"type... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nMr. F has n positive integers, a_1, a_2, …, a_n.\n\nHe thinks the greatest common divisor of these integers is too small. So he wants to enlarge it by removing some of the integers.\n\nBut this problem is too simple for h... | [{"type": "stdin_stdout", "input": "100\n95 94 31 65 35 95 70 78 81 36 69 97 39 28 89 62 36 23 35 21 36 11 65 39 13 34 79 87 91 70 43 82 24 97 6 87 49 81 60 92 63 9 16 6 31 90 6 5 70 48 27 86 65 66 45 8 67 17 24 44 34 93 26 32 82 54 72 83 94 81 79 79 9 9 4 59 42 83 80 67 28 62 56 58 87 67 34 3 61 14 62 19 94 31 74 97 2... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nYou've got a rectangular parallelepiped with integer edge lengths. You know the areas of its three faces that have a common vertex. Your task is to find the sum of lengths of all 12 edges of this parallelepiped.\n\nInput\... | [{"type": "stdin_stdout", "input": "10000 10000 10000\n", "output": "1200"}, {"type": "stdin_stdout", "input": "10000 1 10000\n", "output": "40008"}, {"type": "stdin_stdout", "input": "9801 9801 9801\n", "output": "1188"}, {"type": "stdin_stdout", "input": "1 10000 10000\n", "output": "40008"}, {"type": "stdin_stdout",... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nAlice and Bob are playing a game on a line with n cells. There are n cells labeled from 1 through n. For each i from 1 to n-1, cells i and i+1 are adjacent.\n\nAlice initially has a token on some cell on the line, and Bob... | [{"type": "stdin_stdout", "input": "50 75\n2 4 6 8 10 12 14 16 18 20 22 24 26 28 30 32 34 36 38 40 42 44 46 48 50 1 3 5 7 9 11 13 15 17 19 21 23 25 27 29 31 33 35 37 39 41 43 45 47 49 2 4 6 8 10 12 14 16 18 20 22 24 26 28 30 32 34 36 38 40 42 44 46 48 50\n", "output": "0\n"}, {"type": "stdin_stdout", "input": "50 75\n2... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nShe loves e-mail so much! She sends e-mails by her cellular phone to her friends when she has breakfast, she talks with other friends, and even when she works in the library! Her cellular phone has somewhat simple layout ... | [{"type": "stdin_stdout", "input": "666660666\n134424306396481246895756\n12784174432754272468162", "output": "No\n'dhagdmdwmgt'agmtwjpjm\n'aptg'phdapjgapagmt'ma\n"}, {"type": "stdin_stdout", "input": "666660666\n113124756735251440964347\n33891614279093528467517", "output": "No\n,d'agpjmpdjaj'hwmgdgp\netw'm'gapwwdjatgmp... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nCharacter recognition software is widely used to digitise printed texts. Thus the texts can be edited, searched and stored on a computer.\n\nWhen documents (especially pretty old ones written with a typewriter), are digit... | [{"input": "\"J. K. R0WL1NG - HARRY P0TTER AND THE PH1L050PHER'5 5T0NE\"", "output": "[\"J. K. ROWLING - HARRY POTTER AND THE PHILOSOPHER'S STONE\"]", "fn_name": "correct"}, {"input": "\"J. K. R0WL1NG - HARRY P0TTER AND THE PR150NER 0F Azkaban\"", "output": "[\"J. K. ROWLING - HARRY POTTER AND THE PRISONER OF Azkaban\"... | code_functional |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nYour job is to write a function which increments a string, to create a new string.\n\n- If the string already ends with a number, the number should be incremented by 1.\n- If the string does not end with a number. the num... | [{"input": "\"foobar00999\"", "output": "[\"foobar01000\"]", "fn_name": "increment_string"}, {"input": "\"foobar999\"", "output": "[\"foobar1000\"]", "fn_name": "increment_string"}, {"input": "\"foobar001\"", "output": "[\"foobar002\"]", "fn_name": "increment_string"}, {"input": "\"foobar000\"", "output": "[\"foobar001... | code_functional |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nAlice and Bob begin their day with a quick game. They first choose a starting number X_0 ≥ 3 and try to reach one million by the process described below. \n\nAlice goes first and then they take alternating turns. In the i... | [{"type": "stdin_stdout", "input": "1000000\n", "output": "998677\n"}, {"type": "stdin_stdout", "input": "959806\n", "output": "239958\n"}, {"type": "stdin_stdout", "input": "166320\n", "output": "110879\n"}, {"type": "stdin_stdout", "input": "221760\n", "output": "110880\n"}, {"type": "stdin_stdout", "input": "277200\... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nPetya loves lucky numbers very much. Everybody knows that lucky numbers are positive integers whose decimal record contains only the lucky digits 4 and 7. For example, numbers 47, 744, 4 are lucky and 5, 17, 467 are not.\... | [{"type": "stdin_stdout", "input": "86451 754 85 84\n", "output": "4444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nWhat joy! Petya's parents went on a business trip for the whole year and the playful kid is left all by himself. Petya got absolutely happy. He jumped on the bed and threw pillows all day long, until... \n\nToday Petya op... | [{"type": "stdin_stdout", "input": "100\n100 100 100 100 100 100 100 100 100 100 100 100\n", "output": "1\n"}, {"type": "stdin_stdout", "input": "100\n100 100 100 100 110 100 100 100 100 100 100 100\n", "output": "1\n"}, {"type": "stdin_stdout", "input": "100\n100 100 100 100 110 100 100 100 100 100 101 100\n", "output... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nValerian was captured by Shapur. The victory was such a great one that Shapur decided to carve a scene of Valerian's defeat on a mountain. So he had to find the best place to make his victory eternal!\n\nHe decided to vis... | [{"type": "stdin_stdout", "input": "15\n12 1 52\n6 2 10\n4 1 55\n11 7 20\n10 3 54\n13 9 44\n15 2 6\n14 5 55\n9 3 32\n2 1 32\n8 4 14\n6 5 24\n5 3 74\n7 6 157\n", "output": "1039\n"}, {"type": "stdin_stdout", "input": "15\n12 1 52\n3 2 10\n4 1 45\n11 7 20\n10 3 54\n13 9 44\n15 2 6\n14 5 55\n9 3 32\n2 1 32\n8 4 14\n6 5 24... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nA cricket team consists of 11 players and some are good at batting, others are good at bowling and some of them are good at both batting and bowling. The batting coach wants to select exactly K players having maximum poss... | [{"type": "stdin_stdout", "input": "2\n1 2 3 4 5 11 14 11 11 6 11\n3\n0 5 1 2 4 1 4 5 1 2 1\n11", "output": "6\n1\n"}, {"type": "stdin_stdout", "input": "2\n2 1 3 4 5 11 14 11 12 6 12\n3\n0 5 1 2 4 1 4 5 1 2 1\n11", "output": "1\n1\n"}, {"type": "stdin_stdout", "input": "2\n2 1 3 4 5 11 14 11 9 6 11\n3\n-1 5 1 2 4 1 4 ... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nAlice and Bob are playing a game on a line with $n$ cells. There are $n$ cells labeled from $1$ through $n$. For each $i$ from $1$ to $n-1$, cells $i$ and $i+1$ are adjacent.\n\nAlice initially has a token on some cell on... | [{"type": "stdin_stdout", "input": "50 75\n2 4 6 8 10 12 14 16 18 20 22 24 26 28 30 32 34 36 38 40 42 44 46 48 50 1 3 5 7 9 11 13 15 17 19 21 23 25 27 29 31 33 35 37 39 41 43 45 47 49 2 4 6 8 10 12 14 16 18 20 22 24 26 28 30 32 34 36 38 40 42 44 46 48 50\n", "output": "0\n"}, {"type": "stdin_stdout", "input": "50 75\n2... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nВася купил стол, у которого n ножек. Каждая ножка состоит из двух частей, которые соединяются друг с другом. Каждая часть может быть произвольной положительной длины, но гарантируется, что из всех 2n частей возможно соста... | [{"type": "stdin_stdout", "input": "100\n8 7 7 5 2 7 7 5 1 8 6 3 6 7 2 4 4 2 6 8 5 6 5 2 6 1 3 9 5 8 7 6 5 4 8 6 5 5 3 2 6 5 4 9 7 1 5 7 9 5 7 4 1 6 5 8 2 6 6 1 4 2 3 2 3 9 3 8 7 1 2 4 5 7 3 5 5 6 3 8 3 6 1 5 5 3 3 3 8 8 1 4 3 6 7 1 1 2 4 4 7 3 7 7 8 9 5 8 6 6 4 7 4 9 3 4 7 5 2 8 4 1 9 7 9 7 9 6 7 7 9 6 1 1 1 9 9 4 4 1... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nSoroush and Keshi each have a labeled and rooted tree on n vertices. Both of their trees are rooted from vertex 1.\n\nSoroush and Keshi used to be at war. After endless decades of fighting, they finally became allies to p... | [{"type": "stdin_stdout", "input": "4\n4\n1 2 3\n1 2 3\n5\n1 2 3 4\n1 1 1 1\n6\n1 1 1 1 2\n1 2 1 2 2\n7\n1 1 3 4 4 5\n1 2 1 4 2 5\n", "output": "\n1\n4\n1\n3\n"}, {"type": "stdin_stdout", "input": "4\n4\n1 2 3\n1 2 3\n5\n1 2 3 4\n1 1 1 1\n6\n1 2 1 1 2\n1 2 1 2 2\n7\n1 1 3 4 4 5\n1 2 1 4 2 5\n", "output": "1\n4\n1\n3\n"... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nPeople do many crazy things to stand out in a crowd. Some of them dance, some learn by heart rules of Russian language, some try to become an outstanding competitive programmers, while others collect funny math objects.\n... | [{"type": "stdin_stdout", "input": "133 51\n", "output": "1613157\n1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 6651 6652 6653 6654 6655 6656 6657 6658 6659 6660 6661 6662 6663 6664 6665 6666 6667 6668 6669 6670 6671 6672 66... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nA bracket sequence is a string containing only characters \"(\" and \")\". A regular bracket sequence is a bracket sequence that can be transformed into a correct arithmetic expression by inserting characters \"1\" and \"... | [{"type": "stdin_stdout", "input": "50\n0\n2\n3\n0\n5\n6\n7\n8\n14\n10\n11\n1\n13\n31\n15\n22\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n54\n13\n29\n30\n31\n32\n39\n60\n9\n37\n37\n38\n39\n40\n1\n42\n43\n44\n45\n46\n22\n48\n60\n50\n", "output": "()()\n(())\n()()()\n(())()\n((()))\n()()()()()\n(())()()()\n((()))()()\n(((()... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nMonocarp has drawn a tree (an undirected connected acyclic graph) and then has given each vertex an index. All indices are distinct numbers from $1$ to $n$. For every edge $e$ of this tree, Monocarp has written two number... | [{"type": "stdin_stdout", "input": "15\n10 15\n12 15\n6 15\n8 15\n2 15\n3 15\n10 15\n13 15\n5 15\n7 15\n11 15\n4 14\n1 15\n14 15\n", "output": "NO\n"}, {"type": "stdin_stdout", "input": "15\n10 15\n12 15\n6 15\n8 15\n2 15\n3 15\n10 15\n13 15\n5 15\n7 15\n11 15\n4 14\n1 15\n14 15\n", "output": "NO\n"}, {"type": "stdin_s... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nCrazy Town is a plane on which there are n infinite line roads. Each road is defined by the equation a_{i}x + b_{i}y + c_{i} = 0, where a_{i} and b_{i} are not both equal to the zero. The roads divide the plane into conne... | [{"type": "stdin_stdout", "input": "841746 527518\n595261 331297\n10\n-946901 129987 670374\n-140388 -684770 309555\n-302589 415564 -387435\n-565799 -72069 -395358\n-523453 -511446 854898\n-846967 -749453 -341866\n-622388 434663 264157\n-638453 625357 344195\n-255265 -676356 -772398\n-824723 -319141 33585\n", "output":... | code_stdio |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.