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\nInternational Coding Procedures Company (ICPC) writes all its code in Jedi Script (JS) programming language. JS does not get compiled, but is delivered for execution in its source form. Sources contain comments, extra whi... | [{"type": "stdin_stdout", "input": "8\n< > << >> in out fun in>>out\n6\n# let's rock\nin>>out in >> out inout>>outin bin>>out # yay!\nfun>>in>>out funin>>out out>>in <in> > <out>\nin> >> >>> >>>> >>>>>out\n# what's going on here?\n<> <> <> <> <fun> <funfun> <not so fun>\n", "output": "in>>outin>> out a>>b c>>out fun>>i... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nn! = n Γ (n β 1) Γ (n β 2) Γ ... Γ 3 Γ 2 Γ 1\n\nIs called the factorial of n. For example, the factorial of 12\n\n12! = 12 x 11 x 10 x 9 x 8 x 7 x 6 x 5 x 4 x 3 x 2 x 1 = 479001600\n\nAnd there are two consecutive 0s at t... | [{"type": "stdin_stdout", "input": "2\n51\n11000\n0", "output": "0\n12\n2748\n"}, {"type": "stdin_stdout", "input": "2\n58\n10011\n0", "output": "0\n13\n2501\n"}, {"type": "stdin_stdout", "input": "2\n59\n10111\n0", "output": "0\n13\n2525\n"}, {"type": "stdin_stdout", "input": "2\n62\n10110\n0", "output": "0\n14\n2525\... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nThe Tower of Hanoi is a well-known mathematical puzzle. It consists of three rods, and a number of disks of different sizes which can slide onto any rod. The puzzle starts with the disks in a neat stack in ascending order... | [{"type": "stdin_stdout", "input": "0 10000 10000\n10000 0 10000\n10000 10000 0\n40\n", "output": "10995116277750000\n"}, {"type": "stdin_stdout", "input": "0 10000 10000\n10000 0 10000\n10000 10000 0\n40\n", "output": "10995116277750000\n"}, {"type": "stdin_stdout", "input": "0 00000 10000\n10000 0 10000\n10000 10000 ... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nDo you have in mind the good old TicTacToe?\n\nAssuming that you get all the data in one array, you put a space around each value, `|` as a columns separator and multiple `-` as rows separator, with something like `[\"O\"... | [{"input": "[\"1\", \"2\", \"3\", \"4\", \"5\", \"1\", \"2\", \"3\", \"4\", \"5\", \"1\", \"2\", \"3\", \"4\", \"5\", \"1\", \"2\", \"3\", \"4\", \"5\", \"1\", \"2\", \"3\", \"4\", \"5\", \"1\", \"2\", \"3\", \"4\", \"5\", \"1\", \"2\", \"3\", \"4\", \"5\", \"1\"]\n6", "output": "[\" 1 | 2 | 3 | 4 | 5 | 1 \\n----------... | code_functional |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nN people run a marathon. There are M resting places on the way. For each resting place, the i-th runner takes a break with probability P_i percent. When the i-th runner takes a break, he gets rest for T_i time.\n\nThe i-t... | [{"type": "stdin_stdout", "input": "3 2 100\n-1 2 2\n50 -1 1\n83 2 2", "output": "0.9767033300\n0.0000000000\n-0.0005526700\n"}, {"type": "stdin_stdout", "input": "3 5 010\n-1 2 2\n55 0 1\n22 2 2", "output": "0.7318185458\n-0.0000007555\n-0.0143144522\n"}, {"type": "stdin_stdout", "input": "3 3 111\n-1 1 2\n1 0 2\n126 ... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nArpa is researching the Mexican wave.\n\nThere are n spectators in the stadium, labeled from 1 to n. They start the Mexican wave at time 0. \n\n At time 1, the first spectator stands. At time 2, the second spectator sta... | [{"type": "stdin_stdout", "input": "1000000000 1000000000 1000000000\n", "output": "1000000000\n"}, {"type": "stdin_stdout", "input": "1000000000 1000000000 1000000000\n", "output": "1000000000\n"}, {"type": "stdin_stdout", "input": "1000000000 1000000000 1400000000\n", "output": "600000000\n"}, {"type": "stdin_stdout"... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nPak Chanek has $n$ blank heart-shaped cards. Card $1$ is attached directly to the wall while each of the other cards is hanging onto exactly one other card by a piece of string. Specifically, card $i$ ($i > 1$) is hanging... | [{"type": "stdin_stdout", "input": "15\n1 1 2 2 3 4 4 5 6 7 7 8 9 10\n", "output": "11\n"}, {"type": "stdin_stdout", "input": "8\n1 1 3 3 5 5 7\n", "output": "5\n"}, {"type": "stdin_stdout", "input": "7\n1 1 3 3 5 5\n", "output": "4\n"}, {"type": "stdin_stdout", "input": "6\n1 2 1 4 2\n", "output": "4\n"}, {"type": "st... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nA robot is standing at the origin of the infinite two-dimensional plane. Each second the robot moves exactly $1$ meter in one of the four cardinal directions: north, south, west, and east. For the first step the robot can... | [{"type": "stdin_stdout", "input": "1000\n", "output": "251001\n"}, {"type": "stdin_stdout", "input": "1000\n", "output": "251001\n"}, {"type": "stdin_stdout", "input": "777\n", "output": "303420\n"}, {"type": "stdin_stdout", "input": "998\n", "output": "250000\n"}, {"type": "stdin_stdout", "input": "999\n", "output": ... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nAs a tradition, every year before IOI all the members of Natalia Fan Club are invited to Malek Dance Club to have a fun night together. Malek Dance Club has 2^{n} members and coincidentally Natalia Fan Club also has 2^{n}... | [{"type": "stdin_stdout", "input": "0110011110111000001101001010101000011011101001001101000000111101010101111101010011101001111010111001\n", "output": "416862683\n"}, {"type": "stdin_stdout", "input": "0111001111110010000001111100110100111110001100100001111111110000010010111010010010010111000110001111\n", "output": "77... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nDemiurges Shambambukli and Mazukta love to watch the games of ordinary people. Today, they noticed two men who play the following game.\n\nThere is a rooted tree on n nodes, m of which are leaves (a leaf is a nodes that d... | [{"type": "stdin_stdout", "input": "50\n1 2\n2 3\n3 4\n4 5\n5 6\n6 7\n7 8\n8 9\n9 10\n10 11\n11 12\n12 13\n13 14\n14 15\n15 16\n16 17\n17 18\n18 19\n19 20\n20 21\n21 22\n22 23\n23 24\n24 25\n25 26\n26 27\n27 28\n28 29\n29 30\n30 31\n31 32\n32 33\n33 34\n34 35\n35 36\n36 37\n37 38\n38 39\n39 40\n40 41\n41 42\n42 43\n43 ... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nCreate a function which checks a number for three different properties.\n\n- is the number prime?\n- is the number even?\n- is the number a multiple of 10?\n\nEach should return either true or false, which should be given... | [{"input": "179424693", "output": "[[false, false, false]]", "fn_name": "number_property"}, {"input": "179424691", "output": "[[true, false, false]]", "fn_name": "number_property"}, {"input": "25", "output": "[[false, false, false]]", "fn_name": "number_property"}, {"input": "131", "output": "[[true, false, false]]", "... | code_functional |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nFor a set $S$ of integers, perform a sequence of the following operations. Note that each value in $S$ must be unique.\n\n* insert($x$): Insert $x$ to $S$ and report the number of elements in $S$ after the operation.\n* f... | [{"type": "stdin_stdout", "input": "7\n0 -1\n0 2\n0 6\n1 2\n0 -1\n0 -1\n1 20", "output": "1\n2\n3\n1\n3\n3\n0\n"}, {"type": "stdin_stdout", "input": "7\n0 -1\n0 2\n0 5\n1 2\n0 -1\n1 0\n1 20", "output": "1\n2\n3\n1\n3\n0\n0\n"}, {"type": "stdin_stdout", "input": "7\n0 -1\n0 2\n0 6\n1 2\n0 -1\n0 0\n1 20", "output": "1\n2... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nMaria participates in a bicycle race.\n\nThe speedway takes place on the shores of Lake Lucerne, just repeating its contour. As you know, the lake shore consists only of straight sections, directed to the north, south, ea... | [{"type": "stdin_stdout", "input": "24\n-10000 -10000\n-10000 9998\n9998 9998\n9998 -10000\n-6364 -10000\n-6364 6362\n6362 6362\n6362 -6364\n-2728 -6364\n-2728 2726\n2726 2726\n2726 -910\n908 -910\n908 908\n-910 908\n-910 -4546\n4544 -4546\n4544 4544\n-4546 4544\n-4546 -8182\n8180 -8182\n8180 8180\n-8182 8180\n-8182 -1... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nYou've got a robot, its task is destroying bombs on a square plane. Specifically, the square plane contains n bombs, the i-th bomb is at point with coordinates (x_{i}, y_{i}). We know that no two bombs are at the same poi... | [{"type": "stdin_stdout", "input": "24\n-2 -2\n-1 1\n0 1\n1 1\n0 2\n1 -1\n2 -2\n1 -4\n-1 1\n0 -2\n0 -2\n-2 0\n-2 -1\n2 -1\n2 2\n-1 -2\n-2 1\n2 0\n-1 2\n1 2\n-1 -1\n1 0\n2 1\n-2 2\n", "output": "130\n1 1 U\n2\n1 1 D\n3\n1 1 R\n2\n1 1 L\n3\n1 1 L\n1 1 U\n2\n1 1 R\n1 1 D\n3\n1 1 R\n1 1 U\n2\n1 1 L\n1 1 D\n3\n1 2 U\n2\n1 2... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nLet $f(x)$ be the sum of digits of a decimal number $x$.\n\nFind the smallest non-negative integer $x$ such that $f(x) + f(x + 1) + \\dots + f(x + k) = n$.\n\n\n-----Input-----\n\nThe first line contains one integer $t$ (... | [{"type": "stdin_stdout", "input": "7\n1 0\n2 1\n42 7\n1 9\n64 0\n99 0\n99 2\n", "output": "1\n-1\n4\n-1\n19999999\n99999999999\n7997\n"}, {"type": "stdin_stdout", "input": "7\n1 0\n1 1\n42 7\n1 9\n64 0\n99 0\n99 2\n", "output": "1\n0\n4\n-1\n19999999\n99999999999\n7997\n"}, {"type": "stdin_stdout", "input": "7\n1 0\n1... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nAlmost every text editor has a built-in function of center text alignment. The developers of the popular in Berland text editor Β«TextpadΒ» decided to introduce this functionality into the fourth release of the product.\n\n... | [{"type": "stdin_stdout", "input": "8\n\n\n\ny\nW\n\n\n\n3B\n\nw\nV\n\n\n\nL\nSr\n\n\nV\n\n5\n\nAq\n\n\n\nJ\nR\n\n04\nJ\nv\nUh\n\n\n\nY\nG\n4\n\nG\nb\n\n\n9\n\n6\nd\n\n2\n\n\nE\n7\n\nr\n\n\n\n\nKC\ns\nE\n\nab\n4\nx\n\n\n\n\n\nEe\n4\n\nl\n\np\n\nG\nM\n\n\nn\n\n\nm0\n\nw\n\n\nP\n\n\n\n0\n\n\n", "output": "****\n*8 *\n* ... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nJohnny is a farmer and he annually holds a beet farmers convention \"Drop the beet\".\n\nEvery year he takes photos of farmers handshaking. Johnny knows that no two farmers handshake more than once. He also knows that som... | [{"input": "0", "output": "[1]", "fn_name": "get_participants"}, {"input": "1", "output": "[2]", "fn_name": "get_participants"}, {"input": "3", "output": "[3]", "fn_name": "get_participants"}, {"input": "6", "output": "[4]", "fn_name": "get_participants"}, {"input": "7", "output": "[5]", "fn_name": "get_participants"}] | code_functional |
[
{
"content": "Solve the following coding problem using the programming language python:\n\n< PREVIOUS KATA\nNEXT KATA >\n\n## Task:\n\nYou have to write a function `pattern` which returns the following Pattern(See Examples) upto desired number of rows. \n\n* Note:```Returning``` the pattern is not the same as `... | [{"input": "10\n-2999", "output": "[\"1 1\\n 2 2 \\n 3 3 \\n 4 4 \\n 5 5 \\n 6 6 \\n 7 7 \\n 8 8 \\n 9 9 \\n 0 \\n 9 9 \\n 8 8 \\n 7 7 ... | code_functional |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nYou are the top spy of AtCoder Kingdom. To prevent the stolen secret from being handed to AlDebaran Kingdom, you have sneaked into the party where the transaction happens.\nThere are N attendees in the party, and they are... | [{"type": "stdin_stdout", "input": "32\n3 1 8 1 5 9 4 2 3 3 9 8 11 7 16 4 2 4 8 2 4 4 7 7 3 3 30 4 4 7 2 8", "output": "13\n"}, {"type": "stdin_stdout", "input": "32\n3 1 8 1 5 2 7 2 3 3 9 8 11 7 16 4 2 4 8 2 4 4 7 7 3 3 30 4 4 7 2 8", "output": "12\n"}, {"type": "stdin_stdout", "input": "32\n3 1 4 1 8 11 8 6 5 3 5 8 9... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nJafar has n cans of cola. Each can is described by two integers: remaining volume of cola a_{i} and can's capacity b_{i} (a_{i} β€ b_{i}).\n\nJafar has decided to pour all remaining cola into just 2 cans, determine if he... | [{"type": "stdin_stdout", "input": "10\n15 26 15 14 14 39 40 4 25 39\n27 72 16 44 69 48 53 17 63 42\n", "output": "NO\n"}, {"type": "stdin_stdout", "input": "10\n15 26 15 14 14 39 40 4 25 39\n27 72 16 44 69 48 53 17 63 42\n", "output": "no\n"}, {"type": "stdin_stdout", "input": "10\n15 26 15 14 14 39 40 5 25 39\n27 72 ... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nWe have a long seat of width X centimeters.\nThere are many people who wants to sit here. A person sitting on the seat will always occupy an interval of length Y centimeters.\nWe would like to seat as many people as possi... | [{"type": "stdin_stdout", "input": "100010 0 -1", "output": "-100011\n"}, {"type": "stdin_stdout", "input": "64146 123 456\n", "output": "110\n"}, {"type": "stdin_stdout", "input": "64145 123 456\n", "output": "109\n"}, {"type": "stdin_stdout", "input": "100000 1 1\n", "output": "49999\n"}, {"type": "stdin_stdout", "in... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nYou have a simple undirected graph consisting of $n$ vertices and $m$ edges. The graph doesn't contain self-loops, there is at most one edge between a pair of vertices. The given graph can be disconnected.\n\nLet's make a... | [{"type": "stdin_stdout", "input": "21 35\n1 4\n2 4\n1 5\n2 5\n1 6\n2 6\n1 7\n2 7\n1 8\n2 8\n1 9\n2 9\n1 10\n2 10\n1 11\n2 11\n1 12\n2 12\n1 13\n2 13\n1 14\n2 14\n1 15\n2 15\n1 16\n2 16\n1 17\n2 17\n1 18\n2 18\n1 19\n2 19\n1 20\n2 20\n3 21\n", "output": "-1\n"}, {"type": "stdin_stdout", "input": "21 35\n1 4\n2 4\n1 5\n... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nOne foggy Stockholm morning, Karlsson decided to snack on some jam in his friend Lillebror Svantenson's house. Fortunately for Karlsson, there wasn't anybody in his friend's house. Karlsson was not going to be hungry any ... | [{"type": "stdin_stdout", "input": "15\n0 0\n0 0\n0 0\n0 0\n0 0\n0 0\n0 0\n0 0\n0 0\n0 0\n0 0\n0 0\n0 0\n0 0\n0 0\n", "output": "0\n"}, {"type": "stdin_stdout", "input": "15\n0 0\n0 0\n0 0\n0 0\n0 0\n0 0\n0 0\n0 0\n0 0\n0 0\n0 0\n0 0\n0 0\n0 0\n0 0\n", "output": "0\n"}, {"type": "stdin_stdout", "input": "8\n0 1\n1 0\n0... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nThe time on the planet Lapituletti goes the same way it goes on Earth but a day lasts $h$ hours and each hour lasts $m$ minutes. The inhabitants of that planet use digital clocks similar to earth ones. Clocks display time... | [{"type": "stdin_stdout", "input": "15\n1 1\n00:00\n1 100\n00:01\n100 100\n02:82\n10 10\n04:04\n100 100\n99:00\n100 2\n30:00\n50 3\n30:00\n51 3\n30:01\n52 16\n21:12\n100 20\n20:07\n23 100\n21:45\n11 11\n02:02\n89 89\n88:86\n100 1\n01:00\n1 100\n00:01\n", "output": "00:00\n00:00\n02:82\n00:00\n00:00\n00:00\n00:00\n50:00... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nPetya loves lucky numbers. We all know that lucky numbers are the positive integers whose decimal representations contain only the lucky digits 4 and 7. For example, numbers 47, 744, 4 are lucky and 5, 17, 467 are not.\n\... | [{"type": "stdin_stdout", "input": "99994\n", "output": "abcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabc... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nThere is a trampoline park with $n$ trampolines in a line. The $i$-th of which has strength $S_i$.\n\nPekora can jump on trampolines in multiple passes. She starts the pass by jumping on any trampoline of her choice.\n\nI... | [{"type": "stdin_stdout", "input": "3\n7\n1 2 10 2 2 2 2\n2\n2 1\n5\n1 1 1 2 1\n", "output": "10\n1\n1\n"}, {"type": "stdin_stdout", "input": "3\n7\n2 4 3 2 2 13 2\n2\n3 3\n5\n1 1 1 1 2\n", "output": "13\n4\n1\n"}, {"type": "stdin_stdout", "input": "3\n7\n3 4 3 2 2 24 2\n2\n3 3\n5\n1 1 1 1 2\n", "output": "24\n4\n1\n"}... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nYou get an array of numbers, return the sum of all of the positives ones.\n\nExample `[1,-4,7,12]` => `1 + 7 + 12 = 20`\n\nNote: if there is nothing to sum, the sum is default to `0`.\n\nWrite your solution by modifying t... | [{"input": "[-1, -2, -3, -4, -5]", "output": "[0]", "fn_name": "positive_sum"}, {"input": "[1, -2, 3, 4, 5]", "output": "[13]", "fn_name": "positive_sum"}, {"input": "[-1, 2, 3, 4, -5]", "output": "[9]", "fn_name": "positive_sum"}, {"input": "[1, 2, 3, 4, 5]", "output": "[15]", "fn_name": "positive_sum"}, {"input": "[]... | code_functional |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nFox Ciel is going to publish a paper on FOCS (Foxes Operated Computer Systems, pronounce: \"Fox\"). She heard a rumor: the authors list on the paper is always sorted in the lexicographical order. \n\nAfter checking some e... | [{"type": "stdin_stdout", "input": "10\npetr\negor\nendagorion\nfeferivan\nilovetanyaromanova\nkostka\ndmitriyh\nmaratsnowbear\nbredorjaguarturnik\ncgyforever\n", "output": "aghjlnopefikdmbcqrstuvwxyz\n"}, {"type": "stdin_stdout", "input": "10\npetr\nroge\nendagorion\nfeferivan\nilovetanyaromanova\nkostka\ndmitriyh\nma... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nMike is trying rock climbing but he is awful at it. \n\nThere are n holds on the wall, i-th hold is at height a_{i} off the ground. Besides, let the sequence a_{i} increase, that is, a_{i} < a_{i} + 1 for all i from 1 to ... | [{"type": "stdin_stdout", "input": "100\n2 43 47 49 50 57 59 67 74 98 901 903 904 906 907 908 909 910 911 912 913 914 915 916 917 1525 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 938 939 940 942 943 944 945 946 947 948 949 950 952 953 954 956 957 1027 959 960 961 962 963 965 966 967 968 969 ... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nPolycarp is a great fan of television.\n\nHe wrote down all the TV programs he is interested in for today. His list contains n shows, i-th of them starts at moment l_{i} and ends at moment r_{i}.\n\nPolycarp owns two TVs.... | [{"type": "stdin_stdout", "input": "5\n15 18\n23 24\n23 28\n26 24\n15 19\n", "output": "YES\n"}, {"type": "stdin_stdout", "input": "5\n15 18\n23 24\n23 11\n26 24\n15 19\n", "output": "YES\n"}, {"type": "stdin_stdout", "input": "5\n15 18\n23 24\n23 28\n22 24\n15 19\n", "output": "NO\n"}, {"type": "stdin_stdout", "input"... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nThe amount of information on the World Wide Web is growing quite rapidly. In this information explosion age, we must survive by accessing only the Web pages containing information relevant to our own needs. One of the key... | [{"type": "stdin_stdout", "input": "3 1\naa\nb\nccc\naabccczbaacccbaazaabbcccaa\n3 1\na\nb\nc\ncbbcbcbabaacabccaccbaacbccbcaaaccccbcbcbbcacbaacccaccbbcaacbbabbabaccc\n3 4\naaaaaaaaaaaaaaaaaaaa\naaaaaaaaaaaaaaaaaaaa\naaaaaaaaaaaaaaaaaaaa\naaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\naaaaaaaaaaaaaaaaaaaaaa... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\n# A History Lesson\n\nSoundex is an interesting phonetic algorithm developed nearly 100 years ago for indexing names as they are pronounced in English. The goal is for homophones to be encoded to the same representation s... | [{"input": "\"Sayra Cunnarr\"", "output": "[\"S600 C560\"]", "fn_name": "soundex"}, {"input": "\"Sarah Connor\"", "output": "[\"S600 C560\"]", "fn_name": "soundex"}, {"input": "\"Serah Coner\"", "output": "[\"S600 C560\"]", "fn_name": "soundex"}, {"input": "\"Sarh Connor\"", "output": "[\"S600 C560\"]", "fn_name": "sou... | code_functional |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nIn an electric circuit, when two resistors R_1 and R_2 are connected in parallel, the equivalent resistance R_3 can be derived from the following formula:\n\n* \\frac{1}{R_1} + \\frac{1}{R_2} = \\frac{1}{R_3}\n\n\n\nGiven... | [{"type": "stdin_stdout", "input": "001 230", "output": "0.995670995671\n"}, {"type": "stdin_stdout", "input": "001 379", "output": "0.997368421053\n"}, {"type": "stdin_stdout", "input": "001 119", "output": "0.991666666667\n"}, {"type": "stdin_stdout", "input": "100 113", "output": "53.0516431925\n"}, {"type": "stdin_... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\n# Task\n Call two arms equally strong if the heaviest weights they each are able to lift are equal.\n\n Call two people equally strong if their strongest arms are equally strong (the strongest arm can be both the right an... | [{"input": "10\n15\n15\n10", "output": "[true]", "fn_name": "are_equally_strong"}, {"input": "15\n10\n15\n10", "output": "[true]", "fn_name": "are_equally_strong"}, {"input": "10\n10\n10\n10", "output": "[true]", "fn_name": "are_equally_strong"}, {"input": "15\n10\n15\n9", "output": "[false]", "fn_name": "are_equally_s... | code_functional |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nAlice and Bob are going to celebrate Christmas by playing a game with a tree of presents. The tree has n nodes (numbered 1 to n, with some node r as its root). There are a_i presents are hanging from the i-th node.\n\nBef... | [{"type": "stdin_stdout", "input": "4 3\n1 2\n1 3\n3 4\n1000000000 999999999 0 1\n", "output": "0 1 0 1 "}, {"type": "stdin_stdout", "input": "4 3\n1 2\n1 3\n3 4\n1000000000 999999999 0 2\n", "output": "0 1 0 1\n"}, {"type": "stdin_stdout", "input": "4 3\n1 2\n1 3\n1 4\n1000000000 999999999 0 2\n", "output": "0 0 0 0\n... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nAlice and Bonnie are sisters, but they don't like each other very much. So when some old family photos were found in the attic, they started to argue about who should receive which photos. In the end, they decided that th... | [{"type": "stdin_stdout", "input": "7\n479456257 682467462 202838061 802929167\n133179116 541657110 703996842 253385760\n829210948 865639323 321812660 580155067\n723036605 467995973 911771109 838534160\n732332969 59715289 216696388 60573917\n515702466 655741352 105418444 651954316\n884987644 907866122 399463262 9527779... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nOne day in the IT lesson Anna and Maria learned about the lexicographic order.\n\nString x is lexicographically less than string y, if either x is a prefix of y (and x β y), or there exists such i (1 β€ i β€ min(|x|, |y|)),... | [{"type": "stdin_stdout", "input": "kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nA conglomerate consists of $n$ companies. To make managing easier, their owners have decided to merge all companies into one. By law, it is only possible to merge two companies, so the owners plan to select two companies,... | [{"type": "stdin_stdout", "input": "20\n1 1228\n7 957 657 854 608 621 874 617\n6 159 43 19 122 116 194\n7 813 984 847 953 808 801 900\n2 693 844\n12 903 910 764 949 990 959 987 884 876 743 838 1017\n1 636\n8 107 201 935 203 159 67 550 948\n1 919\n14 934 742 1000 707 801 958 889 980 799 841 927 676 918 841\n7 590 569 48... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nDetermine if an N-sided polygon (not necessarily convex) with sides of length L_1, L_2, ..., L_N can be drawn in a two-dimensional plane.\nYou can use the following theorem:\nTheorem: an N-sided polygon satisfying the con... | [{"type": "stdin_stdout", "input": "10\n100 100 100 100 100 100 100 100 100 100\n", "output": "Yes\n"}, {"type": "stdin_stdout", "input": "10\n72 91 66 75 90 52 94 1 87 59\n", "output": "Yes\n"}, {"type": "stdin_stdout", "input": "10\n11 11 11 11 99 11 11 11 11 11\n", "output": "No\n"}, {"type": "stdin_stdout", "input"... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\n###BACKGROUND:\nJacob recently decided to get healthy and lose some weight. He did a lot of reading and research and after focusing on steady exercise and a healthy diet for several months, was able to shed over 50 pounds... | [{"input": "\"F\"\n-461.9\n0.0", "output": "[\"Invalid weight\"]", "fn_name": "lose_weight"}, {"input": "\"F\"\n160\n-10", "output": "[\"Invalid duration\"]", "fn_name": "lose_weight"}, {"input": "\"llama\"\n1\n-10", "output": "[\"Invalid gender\"]", "fn_name": "lose_weight"}, {"input": "\"??\"\n-10\n-10", "output": "[... | code_functional |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nYou need to find if a number can be expressed as sum of two perfect powers. That is, given x find if there exists non negative integers a, b, m, n such that am + bn = x.\n\nInput\n\nFirst line of the input contains number... | [{"type": "stdin_stdout", "input": "20\n27955\n637815\n90575\n561777\n622205\n466162\n379336\n195938\n91560\n894581\n799253\n948756\n448870\n26762\n507653\n176200\n175215\n499651\n82441\n354697", "output": "No\nNo\nNo\nNo\nNo\nYes\nYes\nYes\nYes\nYes\nNo\nNo\nNo\nYes\nYes\nYes\nNo\nNo\nNo\nYes"}, {"type": "stdin_stdout... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nIroha loves Haiku. Haiku is a short form of Japanese poetry. A Haiku consists of three phrases with 5, 7 and 5 syllables, in this order.\nTo create a Haiku, Iroha has come up with three different phrases. These phrases ha... | [{"type": "stdin_stdout", "input": "5 5 7\n", "output": "YES\n"}, {"type": "stdin_stdout", "input": "13 4 -2", "output": "NO\n"}, {"type": "stdin_stdout", "input": "13 4 -1", "output": "NO\n"}, {"type": "stdin_stdout", "input": "20 4 -1", "output": "NO\n"}, {"type": "stdin_stdout", "input": "-1 -1 3", "output": "NO\n"}... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\n## Problem\n\nDetermine whether a positive integer number is **colorful** or not.\n\n`263` is a colorful number because `[2, 6, 3, 2*6, 6*3, 2*6*3]` are all different; whereas `236` is not colorful, because `[2, 3, 6, 2*3... | [{"input": "2357893", "output": "[false]", "fn_name": "colorful"}, {"input": "235789", "output": "[true]", "fn_name": "colorful"}, {"input": "236", "output": "[false]", "fn_name": "colorful"}, {"input": "263", "output": "[true]", "fn_name": "colorful"}, {"input": "50", "output": "[false]", "fn_name": "colorful"}, {"inp... | code_functional |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nWhen a warrior wants to talk with another one about peace or war he uses a smartphone. In one distinct country warriors who spent all time in training kata not always have enough money. So if they call some number they ... | [{"input": "\"80671991111\"", "output": "[\"Kyivstar\"]", "fn_name": "detect_operator"}, {"input": "\"80111551111\"", "output": "[\"no info\"]", "fn_name": "detect_operator"}, {"input": "\"80631551111\"", "output": "[\"Life:)\"]", "fn_name": "detect_operator"}, {"input": "\"80931551111\"", "output": "[\"Life:)\"]", "fn... | code_functional |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nYou are given a string S of length N consisting of A, C, G and T. Answer the following Q queries:\n - Query i (1 \\leq i \\leq Q): You will be given integers l_i and r_i (1 \\leq l_i < r_i \\leq N). Consider the substring... | [{"type": "stdin_stdout", "input": "8 3\nACACTABG\n6 3\n4 6\n2 1", "output": "-1\n0\n-1\n"}, {"type": "stdin_stdout", "input": "8 3\nACACTACG\n3 7\n2 3\n1 8\n", "output": "2\n0\n3\n"}, {"type": "stdin_stdout", "input": "8 3\nACACTACG\n3 7\n4 3\n1 2", "output": "2\n-1\n1\n"}, {"type": "stdin_stdout", "input": "8 3\nACAC... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nLet $n$ be an integer. Consider all permutations on integers $1$ to $n$ in lexicographic order, and concatenate them into one big sequence $p$. For example, if $n = 3$, then $p = [1, 2, 3, 1, 3, 2, 2, 1, 3, 2, 3, 1, 3, 1,... | [{"type": "stdin_stdout", "input": "1000000\n", "output": " 549766631"}, {"type": "stdin_stdout", "input": "771623\n", "output": " 501916356"}, {"type": "stdin_stdout", "input": "623847\n", "output": " ... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nA chess board is normally played with 16 pawns and 16 other pieces, for this kata a variant will be played with only the pawns. All other pieces will not be on the board. \nFor information on how pawns move, refer [here... | [{"input": "[\"a3\", \"h6\", \"a4\", \"h5\", \"a5\", \"h4\", \"a6\", \"h3\", \"axb7\", \"hxg2\"]", "output": "[[[\".\", \".\", \".\", \".\", \".\", \".\", \".\", \".\"], [\"p\", \"P\", \"p\", \"p\", \"p\", \"p\", \"p\", \".\"], [\".\", \".\", \".\", \".\", \".\", \".\", \".\", \".\"], [\".\", \".\", \".\", \".\", \".\"... | code_functional |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nAstronaut Natasha arrived on Mars. She knows that the Martians are very poor aliens. To ensure a better life for the Mars citizens, their emperor decided to take tax from every tourist who visited the planet. Natasha is t... | [{"type": "stdin_stdout", "input": "2 420\n412 363\n", "output": "420\n0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 8... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nYou are wandering in the explorer space of the 2050 Conference.\n\nThe explorer space can be viewed as an undirected weighted grid graph with size nΓ m. The set of vertices is \\{(i, j)|1β€ iβ€ n, 1β€ jβ€ m\\}. Two vertices (... | [{"type": "stdin_stdout", "input": "3 3 10\n1 1\n1 1\n1 1\n1 1 1\n1 1 1\n", "output": "\n10 10 10\n10 10 10\n10 10 10\n"}, {"type": "stdin_stdout", "input": "3 3 10\n1 1\n2 1\n1 1\n1 1 1\n1 1 1\n", "output": "10 10 10\n10 10 10\n10 10 10\n"}, {"type": "stdin_stdout", "input": "3 3 10\n1 1\n2 2\n1 1\n1 2 1\n2 2 1\n", "o... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nHint\n\nIn solving this problem, the following may be referred to. Shows how to convert an integer value to a string. Assign value as a string to str.\n\nFor C\n\n\ninclude <stdio.h>\n\nint main () {\nint value = 123; // ... | [{"type": "stdin_stdout", "input": "6 101\n111 101 101 101 001 101 101 001 101 101", "output": "444444\n"}, {"type": "stdin_stdout", "input": "5 100\n101 101 101 101 001 101 101 101 101 101", "output": "44444\n"}, {"type": "stdin_stdout", "input": "5 100\n101 101 101 101 101 101 001 101 101 101", "output": "66666\n"}, ... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nChouti was tired of the tedious homework, so he opened up an old programming problem he created years ago.\n\nYou are given a connected undirected graph with $n$ vertices and $m$ weighted edges. There are $k$ special vert... | [{"type": "stdin_stdout", "input": "4 4 2\n3 1\n1 2 1000000000\n2 3 1000000000\n3 1 1000000000\n3 4 1\n", "output": "1000000000 1000000000\n"}, {"type": "stdin_stdout", "input": "4 4 2\n3 1\n1 2 1000000000\n2 3 1000000001\n3 1 1000000000\n3 4 1\n", "output": "1000000000 1000000000\n"}, {"type": "stdin_stdout", "input":... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nA famous gang of pirates, Sea Dogs, has come back to their hideout from one of their extravagant plunders. They want to split their treasure fairly amongst themselves, that is why You, their trusted financial advisor, dev... | [{"type": "stdin_stdout", "input": "1000010000 3\n44431 10822\n45250 1096927361\n264372930 1\n", "output": "-1"}, {"type": "stdin_stdout", "input": "1000010001 3\n44431 10822\n45250 1096927361\n264372930 1\n", "output": "-1"}, {"type": "stdin_stdout", "input": "1000000000 3\n30490 19232\n45250 999980767\n264372930 1\n"... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nMr. Suzuki has opened a new mobile sales shop for freshly squeezed milk in the Aizu area. It is assumed that all the customers who come to buy that day are already in the store with bottles to take home and will not incre... | [{"type": "stdin_stdout", "input": "5\n-2\n45\n162\n2\n15\n0", "output": "73\n"}, {"type": "stdin_stdout", "input": "5\n-2\n32\n30\n2\n12\n0", "output": "52\n"}, {"type": "stdin_stdout", "input": "5\n-1\n-1\n4\n106\n0\n0", "output": "-3\n"}, {"type": "stdin_stdout", "input": "5\n4\n31\n14\n11\n14\n0", "output": "91\n"}... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nGiven an array A of N numbers, find the number of distinct pairs (i, j) such that j β₯i and A[i] = A[j].\n\nFirst line of the input contains number of test cases T. Each test case has two lines, first line is the number N,... | [{"type": "stdin_stdout", "input": "10\n807\n935399 145100 -386862 856283 628359 256963 -461034 935399 776945 -759500 -759500 935399 -967263 649644 -24686 -452785 -352467 688773 908612 -386862 -479957 -146506 439811 -506538 -146506 145100 -461034 935399 -352307 -181185 740341 740341 439811 742466 -854789 700140 -740255... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nJoy is a short and lazy guy, he uses elevator to reach his flat. But unfortunately elevator is not working today and he became sad. Suddenly God came and made the stairs magical, such that he can jump on it in a magical w... | [{"type": "stdin_stdout", "input": "100\n41\n18467\n6334\n26500\n19169\n15724\n11478\n29358\n26962\n24464\n5705\n28145\n23281\n16827\n9961\n491\n2995\n11942\n4827\n5436\n32391\n14604\n3902\n153\n292\n12382\n17421\n18716\n19718\n19895\n5447\n21726\n14771\n11538\n1869\n19912\n25667\n26299\n17035\n9894\n28703\n23811\n3132... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nAlan decided to get in shape for the summer, so he created a precise workout plan to follow. His plan is to go to a different gym every day during the next N days and lift X[i] grams on day i. In order to improve his work... | [{"type": "stdin_stdout", "input": "5 10000\n10010 1629 30000 40724 20000\n20000\n12 1 5 3 10\n", "output": "13\n"}, {"type": "stdin_stdout", "input": "5 10000\n10010 1552 30000 40724 20000\n20000\n20 1 5 3 10\n", "output": "21\n"}, {"type": "stdin_stdout", "input": "5 10000\n10010 1552 30000 40724 20000\n20000\n20 0 5... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nWhen Masha came to math classes today, she saw two integer sequences of length $n - 1$ on the blackboard. Let's denote the elements of the first sequence as $a_i$ ($0 \\le a_i \\le 3$), and the elements of the second sequ... | [{"type": "stdin_stdout", "input": "100\n2 2 2 2 3 3 3 3 3 3 1 3 3 2 3 3 0 3 3 3 2 3 3 3 3 1 3 3 3 3 3 3 3 1 1 2 2 2 2 2 1 3 3 2 2 1 3 3 3 2 3 3 3 1 1 2 3 1 0 0 1 3 3 3 1 3 2 2 2 2 3 3 2 2 2 3 3 2 2 3 1 1 1 1 3 3 3 3 3 3 3 3 3 3 3 2 3 3 3\n0 0 0 2 2 1 0 0 0 0 0 0 2 2 2 0 0 0 3 2 2 2 2 2 1 1 1 3 3 1 0 2 1 1 0 0 2 2 2 0 ... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\n# Definition\n\nA **_Tidy number_** *is a number whose* **_digits are in non-decreasing order_**.\n___\n# Task\n\n**_Given_** a number, **_Find if it is Tidy or not_** . \n____\n\n# Warm-up (Highly recommended)\n\n# [Pl... | [{"input": "9672", "output": "[false]", "fn_name": "tidyNumber"}, {"input": "102", "output": "[false]", "fn_name": "tidyNumber"}, {"input": "2789", "output": "[true]", "fn_name": "tidyNumber"}, {"input": "2335", "output": "[true]", "fn_name": "tidyNumber"}, {"input": "12", "output": "[true]", "fn_name": "tidyNumber"}] | code_functional |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nSnuke can change a string t of length N into a string t' of length N - 1 under the following rule:\n\n* For each i (1 β€ i β€ N - 1), the i-th character of t' must be either the i-th or (i + 1)-th character of t.\n\n\n\nThe... | [{"type": "stdin_stdout", "input": "whcrjpbyhtxywkrlxnbrbaojmr", "output": "10\n"}, {"type": "stdin_stdout", "input": "smjoabjdoxmrjwypugydyqrchv", "output": "11\n"}, {"type": "stdin_stdout", "input": "xwwwnajdrxmrqwzpugnhlojced", "output": "12\n"}, {"type": "stdin_stdout", "input": "xpwzglbjquntrci{axpdikofyw", "outpu... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nOnce upon a time Mike and Mike decided to come up with an outstanding problem for some stage of ROI (rare olympiad in informatics). One of them came up with a problem prototype but another stole the idea and proposed that... | [{"type": "stdin_stdout", "input": "5 6\n1 2 3 4 5\n2 10\n1 1 5\n2 10\n1 1 6\n2 10\n1 1 7\n", "output": "50\n45\n50\n46\n50\n47\n"}, {"type": "stdin_stdout", "input": "5 5\n5 6 2 10 10\n1 2 7\n2 4\n1 1 10\n2 8\n1 3 4\n", "output": "34\n20\n26\n40\n36\n"}, {"type": "stdin_stdout", "input": "5 5\n1 2 3 4 5\n1 1 5\n2 10\n... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nCounting was a difficult task in ancient Rome. The Arabic numerals 0,1,2,3,β¦, 9 have not yet been disseminated. Instead, the following symbols were used:\n\nArabic numerals | Roman numerals | Arabic numerals | Roman numer... | [{"type": "stdin_stdout", "input": "VI\nCXDCXXMCXVIIII\nDXDCIX", "output": "6\n1809\n1099\n"}, {"type": "stdin_stdout", "input": "IV\nCXDCXXMCXVIIII\nDXDCIX", "output": "4\n1809\n1099\n"}, {"type": "stdin_stdout", "input": "IV\nCCDIIXXXXVIDLI\nXIDXDC", "output": "4\n1095\n1099\n"}, {"type": "stdin_stdout", "input": "IV... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nOh, no!\n\nThe coronavirus has caught you, and now you're sitting in a dark cellar, with tied legs (but not hands). You have a delicious cookie, a laptop in front of you, and your ideal development environment is open. Th... | [{"type": "stdin_stdout", "input": "3\n8707 7998 1614\n999941093851 131953876 8707\n", "output": "SMALL\n15155\nPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPP... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nMr.X, who the handle name is T, looked at the list which written N handle names, S_1, S_2, ..., S_N.\nBut he couldn't see some parts of the list. Invisible part is denoted `?`.\n\nPlease calculate all possible index of th... | [{"type": "stdin_stdout", "input": "2\ntourist\neptr\ne", "output": "1\n"}, {"type": "stdin_stdout", "input": "2\nssvuhnr\nerrs\nf", "output": "2\n"}, {"type": "stdin_stdout", "input": "2\nhupouvt\netor\ni", "output": "3\n"}, {"type": "stdin_stdout", "input": "2\nsourist\neptr\ne", "output": "1\n"}, {"type": "stdin_std... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nMishka is decorating the Christmas tree. He has got three garlands, and all of them will be put on the tree. After that Mishka will switch these garlands on.\n\nWhen a garland is switched on, it periodically changes its s... | [{"type": "stdin_stdout", "input": "1499 1498 1500\n", "output": "NO\n"}, {"type": "stdin_stdout", "input": "1500 1500 1500\n", "output": "NO\n"}, {"type": "stdin_stdout", "input": "1493 1489 1487\n", "output": "NO\n"}, {"type": "stdin_stdout", "input": "1500 1500 1500\n", "output": "NO"}, {"type": "stdin_stdout", "inp... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nNatasha travels around Mars in the Mars rover. But suddenly it broke down, namely β the logical scheme inside it. The scheme is an undirected tree (connected acyclic graph) with a root in the vertex 1, in which every leaf... | [{"type": "stdin_stdout", "input": "60\nAND 20 4\nNOT 42\nAND 48 59\nOR 17 7\nIN 0\nAND 36 37\nIN 1\nIN 0\nIN 1\nNOT 47\nAND 52 49\nOR 44 35\nIN 0\nIN 1\nAND 33 56\nIN 0\nIN 0\nIN 0\nAND 31 41\nOR 15 3\nOR 43 46\nIN 1\nXOR 22 28\nIN 1\nIN 1\nIN 1\nAND 34 21\nIN 1\nIN 1\nIN 0\nXOR 51 23\nXOR 10 54\nOR 57 40\nIN 0\nNOT 1... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nBaby Badawy's first words were \"AND 0 SUM BIG\", so he decided to solve the following problem. Given two integers $n$ and $k$, count the number of arrays of length $n$ such that:\n\nall its elements are integers between ... | [{"type": "stdin_stdout", "input": "10\n99281 18\n100000 16\n100000 15\n100000 14\n100000 6\n8823 3\n283 17\n299 18\n182 19\n1928 20\n", "output": "207307884\n95964640\n764800965\n570057652\n999657007\n829332965\n995193330\n759808819\n657208696\n258367760\n"}, {"type": "stdin_stdout", "input": "10\n99281 18\n100000 16\... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nSome time ago Mister B detected a strange signal from the space, which he started to study.\n\nAfter some transformation the signal turned out to be a permutation p of length n or its cyclic shift. For the further investi... | [{"type": "stdin_stdout", "input": "108\n1 102 33 99 6 83 4 20 61 100 76 71 44 9 24 87 57 2 81 82 90 85 12 30 66 53 47 36 43 29 31 64 96 84 77 23 93 78 58 68 42 55 13 70 62 19 92 14 10 65 63 75 91 48 11 105 37 50 32 94 18 26 52 89 104 106 86 97 80 95 17 72 40 22 79 103 25 101 35 51 15 98 67 5 34 69 54 27 45 88 56 16 46... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nYour task is to develop a tiny little part of spreadsheet software.\n\nWrite a program which adds up columns and rows of given table as shown in the following figure:\n\n<image>\n\n\n\nInput\n\nThe input consists of sever... | [{"type": "stdin_stdout", "input": "4\n52 26 16 20\n143 22 35 45\n45 78 54 36\n10 86 74 55\n4\n52 151 15 28\n86 22 24 45\n45 78 54 36\n16 86 74 55\n0", "output": " 52 26 16 20 114\n 143 22 35 45 245\n 45 78 54 36 213\n 10 86 74 55 225\n 250 212 179 156 797\n 52 151 15 28 ... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nFor given integers m and n, compute mn (mod 1,000,000,007). Here, A (mod M) is the remainder when A is divided by M.\n\nConstraints\n\n* 1 β€ m β€ 100\n* 1 β€ n β€ 109\n\nInput\n\n\nm n\n\n\nTwo integers m and n are given in ... | [{"type": "stdin_stdout", "input": "-1 1", "output": "1000000006\n"}, {"type": "stdin_stdout", "input": "-2 1", "output": "1000000005\n"}, {"type": "stdin_stdout", "input": "-4 1", "output": "1000000003\n"}, {"type": "stdin_stdout", "input": "-3 1", "output": "1000000004\n"}, {"type": "stdin_stdout", "input": "-5 1", "... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\n\"You must lift the dam. With a lever. I will give it to you.\n\nYou must block the canal. With a rock. I will not give the rock to you.\" \n\nDanik urgently needs rock and lever! Obviously, the easiest way to get these t... | [{"type": "stdin_stdout", "input": "5\n5\n1 5 3 12 10\n3\n1 1 2\n4\n6 2 5 3\n2\n2 4\n1\n1\n", "output": "1\n1\n2\n0\n0\n"}, {"type": "stdin_stdout", "input": "5\n5\n1 5 3 12 10\n3\n1 1 1\n4\n6 2 5 3\n2\n2 4\n1\n1\n", "output": "1\n3\n2\n0\n0\n"}, {"type": "stdin_stdout", "input": "5\n5\n1 5 3 12 10\n3\n2 1 2\n4\n6 2 5 ... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nThe season for Snuke Festival has come again this year. First of all, Ringo will perform a ritual to summon Snuke. For the ritual, he needs an altar, which consists of three parts, one in each of the three categories: upp... | [{"type": "stdin_stdout", "input": "6\n5 30 290 0 -1 25\n106 2 21 1619 34 5\n1103 1563 -1 0 26 885", "output": "58\n"}, {"type": "stdin_stdout", "input": "6\n5 26 290 0 -1 25\n106 4 8 1619 60 5\n1103 1563 0 0 26 1803", "output": "64\n"}, {"type": "stdin_stdout", "input": "6\n4 43 290 -1 6 27\n106 13 11 837 28 8\n1103 7... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nRead problems statements in Mandarin Chinese and Russian. \n\nGiven a string S consisting of only 1s and 0s, find the number of substrings which start and end both in 1.\n\nIn this problem, a substring is defined as a se... | [{"type": "stdin_stdout", "input": "2\n4\n1111\n5\n11011", "output": "10\n10\n"}, {"type": "stdin_stdout", "input": "2\n4\n1111\n5\n10000", "output": "10\n1\n"}, {"type": "stdin_stdout", "input": "2\n4\n1111\n5\n10100", "output": "10\n3\n"}, {"type": "stdin_stdout", "input": "2\n4\n1111\n5\n10011", "output": "10\n6\n"}... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\n$k$ people want to split $n$ candies between them. Each candy should be given to exactly one of them or be thrown away.\n\nThe people are numbered from $1$ to $k$, and Arkady is the first of them. To split the candies, Ar... | [{"type": "stdin_stdout", "input": "1815995848677761959 576460752303423488 202657637814241276 1000\n", "output": "202657637814241276\n"}, {"type": "stdin_stdout", "input": "576460752303423488 576460752303423488 351082447248993993 1000\n", "output": "351082447248993993\n"}, {"type": "stdin_stdout", "input": "57646075230... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nA robot cleaner is placed on the floor of a rectangle room, surrounded by walls. The floor consists of $n$ rows and $m$ columns. The rows of the floor are numbered from $1$ to $n$ from top to bottom, and columns of the fl... | [{"type": "stdin_stdout", "input": "5\n18 20 11 1 2 11\n10 10 5 9 2 1\n17 17 3 10 2 2\n6 9 2 2 5 8\n3 2 1 2 2 2\n", "output": "10\n10\n22\n3\n0\n"}, {"type": "stdin_stdout", "input": "5\n18 20 11 1 2 11\n10 10 5 9 2 1\n17 17 3 10 2 1\n6 9 2 2 5 8\n3 2 1 2 2 2\n", "output": "10\n10\n23\n3\n0\n"}, {"type": "stdin_stdout"... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nYou are given $n$ points on the plane. The polygon formed from all the $n$ points is strictly convex, that is, the polygon is convex, and there are no three collinear points (i.e. lying in the same straight line). The poi... | [{"type": "stdin_stdout", "input": "20\n-2967010 48581504\n-2967318 48581765\n-2967443 48581988\n-2967541 48582265\n-2967443 48582542\n-2967318 48582765\n-2967010 48583026\n-2966691 48583154\n-2966252 48583234\n-2965813 48583154\n-2965494 48583026\n-2965186 48582765\n-2965061 48582542\n-2964963 48582265\n-2965061 48581... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nBob watches TV every day. He always sets the volume of his TV to $b$. However, today he is angry to find out someone has changed the volume to $a$. Of course, Bob has a remote control that can change the volume.\n\nThere ... | [{"type": "stdin_stdout", "input": "3\n-1 -1\n13 93\n3 2\n", "output": "0\n16\n1\n"}, {"type": "stdin_stdout", "input": "3\n-1 -1\n15 93\n3 2\n", "output": "0\n17\n1\n"}, {"type": "stdin_stdout", "input": "3\n-1 -1\n19 93\n3 2\n", "output": "0\n16\n1\n"}, {"type": "stdin_stdout", "input": "3\n-1 -1\n9 93\n3 6\n", "outp... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nThe height of the student was measured at the medical examination. Create a program that takes height data as input, creates a frequency distribution, and outputs it. The frequency distribution is divided into 6 classes i... | [{"type": "stdin_stdout", "input": "21\n182.52038838661136\n173.59035199874677\n159.1654152748587\n178.37721834424076\n171.14400777912027\n182.81130283538022\n174.6786970584368\n172.29285424816956\n164.63708333553282\n170.35024430895632\n176.98250427300766\n170.33088547272038\n163.32499378168183\n173.12553016807985\n17... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nGerman mathematician Christian Goldbach (1690-1764) [conjectured](https://en.wikipedia.org/wiki/Goldbach%27s_conjecture) that every even number greater than 2 can be represented by the sum of two prime numbers. For exampl... | [{"input": "1500", "output": "[[\"7+1493\", \"11+1489\", \"13+1487\", \"17+1483\", \"19+1481\", \"29+1471\", \"41+1459\", \"47+1453\", \"53+1447\", \"61+1439\", \"67+1433\", \"71+1429\", \"73+1427\", \"101+1399\", \"127+1373\", \"139+1361\", \"173+1327\", \"179+1321\", \"181+1319\", \"193+1307\", \"197+1303\", \"199+13... | code_functional |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nCirno_9baka has a paper tape with $n$ cells in a row on it. As he thinks that the blank paper tape is too dull, he wants to paint these cells with $m$ kinds of colors. For some aesthetic reasons, he thinks that the $i$-th... | [{"type": "stdin_stdout", "input": "10\n2 1 1\n2\n2 1 1\n2\n1 1 1\n1\n1 1 1\n1\n1 1 1\n1\n2 1 1\n2\n1 1 1\n1\n1 1 1\n1\n2 1 1\n2\n2 1 1\n2\n", "output": "YES\nYES\nYES\nYES\nYES\nYES\nYES\nYES\nYES\nYES\n"}, {"type": "stdin_stdout", "input": "10\n1 1 1\n1\n1 1 1\n1\n2 1 1\n2\n2 1 1\n2\n2 1 1\n2\n2 1 1\n2\n2 1 1\n2\n2 1... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nPaprika loves permutations. She has an array $a_1, a_2, \\dots, a_n$. She wants to make the array a permutation of integers $1$ to $n$.\n\nIn order to achieve this goal, she can perform operations on the array. In each op... | [{"type": "stdin_stdout", "input": "4\n2\n2 7\n3\n2 5 2\n4\n12345678 87654321 18276684 23571113\n9\n2 3 1 4 18 23 5 12 7\n", "output": "1\n-1\n4\n-1\n"}, {"type": "stdin_stdout", "input": "4\n2\n2 7\n3\n2 5 2\n4\n12345678 87654321 18276684 23571113\n9\n2 3 1 4 18 34 5 12 7\n", "output": "1\n-1\n4\n-1\n"}, {"type": "std... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nLet's denote as <image> the number of bits set ('1' bits) in the binary representation of the non-negative integer x.\n\nYou are given multiple queries consisting of pairs of integers l and r. For each query, find the x, ... | [{"type": "stdin_stdout", "input": "18\n0 18\n1 101\n1 1001\n0 10000\n2 100000\n1 1001010\n1 10000000\n1 100000001\n1 1000000000\n1 10000010000\n1 100000000000\n0 1100000000000\n2 10000100000000\n0 100000000000000\n1 1000100000000000\n1 10000000000000000\n1 100000000000000001\n2 1000000000000000100\n", "output": "15\n6... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nTaro is an elementary school student and has graffiti on the back of the leaflet. At one point, Taro came up with the next game.\n\n* Write n Γ n grid-like squares.\n* The initial state of each square is either marked or ... | [{"type": "stdin_stdout", "input": "4\n1 2 3 4\n1 2 3 4\n1 2 3 4\n2 2 3 4\n1 2 3 4\n1 2 3 4\n1 2 3 4\n1 2 3 4\noooo\noooo\noooo\noooo", "output": "30\n12\n1 1 erase\n1 2 erase\n1 3 erase\n2 1 erase\n2 2 erase\n2 4 erase\n3 1 erase\n3 3 erase\n3 4 erase\n4 2 erase\n4 3 erase\n4 4 erase\n"}, {"type": "stdin_stdout", "inp... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nConsider a linear function f(x) = Ax + B. Let's define g^{(0)}(x) = x and g^{(}n)(x) = f(g^{(}n - 1)(x)) for n > 0. For the given integer values A, B, n and x find the value of g^{(}n)(x) modulo 10^9 + 7.\n\n\n-----Input-... | [{"type": "stdin_stdout", "input": "1377612828 606974665 846646545585165081 745145208\n", "output": "891861122\n"}, {"type": "stdin_stdout", "input": "978837295 606974665 846646545585165081 745145208\n", "output": "154788991\n"}, {"type": "stdin_stdout", "input": "978837295 606974665 846646545585165081 745145208\n", "o... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nHave you heard about the myth that [if you fold a paper enough times, you can reach the moon with it](http://scienceblogs.com/startswithabang/2009/08/31/paper-folding-to-the-moon/)? Sure you have, but exactly how many? Ma... | [{"input": "384000000", "output": "[42]", "fn_name": "fold_to"}, {"input": "5e-05", "output": "[0]", "fn_name": "fold_to"}, {"input": "1e-07", "output": "[0]", "fn_name": "fold_to"}, {"input": "-1", "output": "[null]", "fn_name": "fold_to"}, {"input": "0", "output": "[0]", "fn_name": "fold_to"}] | code_functional |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nNikolay lives in a two-storied house. There are $n$ rooms on each floor, arranged in a row and numbered from one from left to right. So each room can be represented by the number of the floor and the number of the room on... | [{"type": "stdin_stdout", "input": "1\n100\n0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000\n", "output": "100\n"}, {"type": "stdin_stdout", "input": "1\n100\n0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000\n", "ou... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nOrigami, or the art of folding paper\n\nMaster Grus is a famous origami (paper folding) artist, who is enthusiastic about exploring the possibility of origami art. For future creation, he is now planning fundamental exper... | [{"type": "stdin_stdout", "input": "2 1 1 1\n1 1\n0 0\n1 3 2 1\n2 1\n2 1\n0 0\n15 10 3 2\n2 2\n1 1\n1 1\n0 0\n3 4\n4 3 3 2\n1 2\n1 2\n1 1\n0 1\n0 0\n0 0 0 0", "output": "2\n3\n6\n1\n4\n4\n"}, {"type": "stdin_stdout", "input": "2 1 1 1\n2 1\n0 0\n1 3 2 1\n2 0\n2 1\n0 1\n10 13 3 2\n2 2\n1 3\n1 1\n0 1\n3 4\n3 5 3 2\n1 2\n... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nThe finalists of the \"Russian Code Cup\" competition in 2214 will be the participants who win in one of the elimination rounds.\n\nThe elimination rounds are divided into main and additional. Each of the main elimination... | [{"type": "stdin_stdout", "input": "100 100\n100 100\n100\n", "output": "9900\n"}, {"type": "stdin_stdout", "input": "100 100\n100 100\n100\n", "output": "9900\n"}, {"type": "stdin_stdout", "input": "10 100\n100 100\n99\n", "output": "1000\n"}, {"type": "stdin_stdout", "input": "10 100\n100 100\n99\n", "output": "1000\... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nThere is an automatic door at the entrance of a factory. The door works in the following way: when one or several people come to the door and it is closed, the door immediately opens automatically and all people immediat... | [{"type": "stdin_stdout", "input": "97 60 1 1\n5 6 6 7 9 10 10 11 11 11 12 13 13 13 13 14 14 15 16 18 20 23 23 24 25 26 29 31 32 35 38 41 43 43 46 47 48 48 49 52 53 54 55 56 58 59 68 70 72 74 78 81 81 82 91 92 96 96 97 98\n", "output": "49\n"}, {"type": "stdin_stdout", "input": "97 60 1 1\n5 6 6 7 9 10 10 11 11 11 12 1... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nGerald is setting the New Year table. The table has the form of a circle; its radius equals R. Gerald invited many guests and is concerned whether the table has enough space for plates for all those guests. Consider all p... | [{"type": "stdin_stdout", "input": "10 1000 236\n", "output": "YES\n"}, {"type": "stdin_stdout", "input": "1 1484 1100\n", "output": "YES\n"}, {"type": "stdin_stdout", "input": "1 1484 0100\n", "output": "YES\n"}, {"type": "stdin_stdout", "input": "100 821 25\n", "output": "YES\n"}, {"type": "stdin_stdout", "input": "1... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nGiven an array of integers.\n\nReturn an array, where the first element is the count of positives numbers and the second element is sum of negative numbers.\n\nIf the input array is empty or null, return an empty array.\n... | [{"input": "[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, -11, -12, -13, -14, -15]", "output": "[[10, -65]]", "fn_name": "count_positives_sum_negatives"}, {"input": "[0, 2, 3, 0, 5, 6, 7, 8, 9, 10, -11, -12, -13, -14]", "output": "[[8, -50]]", "fn_name": "count_positives_sum_negatives"}, {"input": "[0, 0, 0, 0, 0, 0, 0, 0, 0]", "out... | code_functional |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nWilliam has two numbers $a$ and $b$ initially both equal to zero. William mastered performing three different operations with them quickly. Before performing each operation some positive integer $k$ is picked, which is th... | [{"type": "stdin_stdout", "input": "6\n7 0\n0 15\n7 12\n2 5\n0 0\n-1 6\n", "output": "-1\n-1\n-1\n-1\n0\n-1\n"}, {"type": "stdin_stdout", "input": "6\n7 0\n0 15\n10 12\n2 5\n0 0\n-1 6\n", "output": "-1\n-1\n2\n-1\n0\n-1\n"}, {"type": "stdin_stdout", "input": "6\n2 -1\n3 0\n0 3\n6 3\n4 1\n0 1\n", "output": "-1\n-1\n-1\n... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nLittle penguin Polo adores strings. But most of all he adores strings of length n.\n\nOne day he wanted to find a string that meets the following conditions:\n\n 1. The string consists of n lowercase English letters (tha... | [{"type": "stdin_stdout", "input": "70054 25\n", "output": "abababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababab... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nYou are given a binary string $s$ (recall that a string is binary if each character is either $0$ or $1$).\n\nLet $f(t)$ be the decimal representation of integer $t$ written in binary form (possibly with leading zeroes). ... | [{"type": "stdin_stdout", "input": "4\n0110\n0101\n00001000\n0001000\n", "output": "4\n3\n4\n3\n"}, {"type": "stdin_stdout", "input": "4\n0110\n1101\n00001000\n0001000\n", "output": "4\n4\n4\n3\n"}, {"type": "stdin_stdout", "input": "4\n0110\n1101\n00001000\n0101000\n", "output": "4\n4\n4\n5\n"}, {"type": "stdin_stdout... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nGiant chess is quite common in Geraldion. We will not delve into the rules of the game, we'll just say that the game takes place on an h Γ w field, and it is painted in two colors, but not like in chess. Almost all cells ... | [{"type": "stdin_stdout", "input": "100 10 30\n40 4\n15 3\n75 3\n88 10\n32 1\n16 5\n81 8\n45 2\n72 8\n11 6\n86 4\n50 2\n9 4\n11 1\n20 3\n47 3\n2 4\n68 3\n90 5\n85 2\n88 1\n88 5\n86 3\n70 9\n49 3\n34 4\n5 7\n77 5\n50 1\n87 5\n", "output": "402737011\n"}, {"type": "stdin_stdout", "input": "100 10 30\n40 4\n15 3\n75 3\n88... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nIn 2028 and after a continuous growth, AtCoder Inc. finally built an empire with six cities (City 1, 2, 3, 4, 5, 6)!\nThere are five means of transport in this empire:\n - Train: travels from City 1 to 2 in one minute. A ... | [{"type": "stdin_stdout", "input": "802565984633806\n802252530129536\n544410837252078\n872045491508709\n274353138702170\n562308817245826\n", "output": "7\n"}, {"type": "stdin_stdout", "input": "956131704220258\n897098524760050\n55734601880356\n155602009554546\n559895124828099\n830172607676349\n", "output": "22\n"}, {"t... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nStory:\nIn the realm of numbers, the apocalypse has arrived. Hordes of zombie numbers have infiltrated and are ready to turn everything into undead. The properties of zombies are truly apocalyptic: they reproduce themselv... | [{"input": "[687, 829, 998]", "output": "[45664]", "fn_name": "survivor"}, {"input": "[1, 7, 15]", "output": "[0]", "fn_name": "survivor"}, {"input": "[7, 11]", "output": "[59]", "fn_name": "survivor"}, {"input": "[2, 10]", "output": "[-1]", "fn_name": "survivor"}, {"input": "[]", "output": "[-1]", "fn_name": "survivor... | code_functional |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nGiven is an integer N.\nDetermine whether there is a pair of positive integers (A, B) such that 3^A + 5^B = N, and find one such pair if it exists.\n\n-----Constraints-----\n - 1 \\leq N \\leq 10^{18}\n - All values in in... | [{"type": "stdin_stdout", "input": "748307129767950488\n", "output": "37 25\n"}, {"type": "stdin_stdout", "input": "450283905890997368\n", "output": "37 1\n"}, {"type": "stdin_stdout", "input": "298023223876953128\n", "output": "1 25\n"}, {"type": "stdin_stdout", "input": "150094635296999246\n", "output": "36 3\n"}, {"... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nAlice gave Bob two integers $a$ and $b$ ($a > 0$ and $b \\ge 0$). Being a curious boy, Bob wrote down an array of non-negative integers with $\\operatorname{MEX}$ value of all elements equal to $a$ and $\\operatorname{XOR... | [{"type": "stdin_stdout", "input": "5\n1 1\n2 1\n2 0\n1 10000\n2 10000\n", "output": "3\n2\n3\n2\n3\n"}, {"type": "stdin_stdout", "input": "5\n1 1\n2 1\n2 0\n1 10000\n2 10000\n", "output": "3\n2\n3\n2\n3\n"}, {"type": "stdin_stdout", "input": "1\n187994 180766\n", "output": "187995\n"}, {"type": "stdin_stdout", "input"... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nHaving learned the multiplication table, Takahashi can multiply two integers between 1 and 9 (inclusive) together.\nGiven an integer N, determine whether N can be represented as the product of two integers between 1 and 9... | [{"type": "stdin_stdout", "input": "00010", "output": "Yes\n"}, {"type": "stdin_stdout", "input": "00001", "output": "Yes\n"}, {"type": "stdin_stdout", "input": "11111", "output": "No\n"}, {"type": "stdin_stdout", "input": "10111", "output": "No\n"}, {"type": "stdin_stdout", "input": "10011", "output": "No\n"}, {"type"... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nExample\n\nInput\n\n2 3 1 3 1 0\n\n\nOutput\n\n2\n\nThe input will be stdin and you should print your solution to stdout\n\n\nNow solve the problem and return the code.\n\nWrite Python code to solve this problem. Your pro... | [{"type": "stdin_stdout", "input": "15 18 0 12 0 4", "output": "138\n"}, {"type": "stdin_stdout", "input": "15 18 0 22 0 4", "output": "124\n"}, {"type": "stdin_stdout", "input": "15 18 1 22 0 4", "output": "120\n"}, {"type": "stdin_stdout", "input": "11 51 4 0 1 -1", "output": "255\n"}, {"type": "stdin_stdout", "input... | code_stdio |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.