problem_id
stringlengths
16
16
statement
stringlengths
29
9.15k
tests_json
stringlengths
70
5.27M
time_limit_s
float64
1
10
origin_json
stringlengths
82
233
25b10fd2a99a6dd8
Currently, people's entertainment is limited to programming contests. The activity of the entertainment club of a junior high school to which she belongs is to plan and run a programming contest. Her job is not to create problems. It's a behind-the-scenes job of soliciting issues from many, organizing referees, and pro...
[["1 1 1 1 1 1\n1 1 1 0 0 0\n1 0 0 0 1 0\n3 0 0 3 0 0\n3 1 0 1 3 1\n1 2 0 2 0 1\n0 0 1 1 0 3\n1 0 0 1 1 0\n0 0 0 0 0 0", "2\n1\n0\n2\n3\n1\n1\n0\n"], ["1 1 1 1 1 1\n1 1 1 0 0 0\n1 0 0 0 1 0\n3 0 0 0 0 0\n3 1 0 1 3 1\n1 2 0 2 0 1\n0 0 1 1 0 3\n1 0 0 1 1 0\n0 0 0 0 0 0", "2\n1\n0\n1\n3\n1\n1\n0\n"], ["1 1 1 1 1 1\n1 1 1 ...
1
{"source": "deepcoder/taco", "upstream_id": "taco/train-00001-of-00004.parquet#745"}
25c0baafdc4cbd77
This is an easier version of the problem with smaller constraints. Korney Korneevich dag up an array $a$ of length $n$. Korney Korneevich has recently read about the operation bitwise XOR , so he wished to experiment with it. For this purpose, he decided to find all integers $x \ge 0$ such that there exists an increas...
[["4\n4 2 2 4\n", "4\n0 2 4 6 \n"], ["8\n1 0 1 7 12 5 3 2\n", "12\n0 1 2 3 4 5 6 7 10 11 12 13 \n"], ["20\n28 42 36 59 26 37 42 57 1 33 15 4 14 47 1 49 1 5 53 54\n", "64\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 ...
1
{"source": "deepcoder/taco", "upstream_id": "taco/train-00003-of-00004.parquet#520"}
25c44219cd65215e
Someone give a strange birthday present to Ivan. It is hedgehog — connected undirected graph in which one vertex has degree at least $3$ (we will call it center) and all other vertices has degree 1. Ivan thought that hedgehog is too boring and decided to make himself $k$-multihedgehog. Let us define $k$-multihedgehog ...
[["14 2\n1 4\n2 4\n3 4\n4 13\n10 5\n11 5\n12 5\n14 5\n5 13\n6 7\n8 6\n13 6\n9 6\n", "Yes\n"], ["3 1\n1 3\n2 3\n", "No\n"], ["16 2\n1 12\n2 12\n3 12\n4 13\n5 13\n6 13\n7 14\n8 14\n9 15\n10 15\n11 15\n12 16\n13 16\n14 16\n15 16\n", "No\n"], ["13 2\n7 5\n10 11\n5 12\n1 2\n10 7\n2 6\n10 4\n9 5\n13 10\n2 8\n3 10\n2 7\n", "N...
1
{"source": "deepcoder/taco", "upstream_id": "taco/train-00002-of-00004.parquet#496"}
25c7e2819f5e2148
Vasya plays a computer game with ninjas. At this stage Vasya's ninja should get out of a deep canyon. The canyon consists of two vertical parallel walls, their height is n meters. Let's imagine that we split these walls into 1 meter-long areas and number them with positive integers from 1 to n from bottom to top. Some...
[["2 1\n-X\nX-\n", "YES\n"], ["25 3\n-XXXXX-XXXXX-XXXXX-X-XXXX\nXXX-XXXXX-XXXXX-X-----X--\n", "YES\n"], ["6 2\n--X--X\nXX-X-X\n", "YES\n"], ["12 3\n--XX--XX-XXX\n----X---XXX-\n", "NO\n"], ["101 1\n----------------------------------------------------------------------------------------------------X\n--------------------...
1
{"source": "deepcoder/taco", "upstream_id": "taco/train-00003-of-00004.parquet#593"}
25e5cca04b2c693f
There are $n$ students and $m$ clubs in a college. The clubs are numbered from $1$ to $m$. Each student has a potential $p_i$ and is a member of the club with index $c_i$. Initially, each student is a member of exactly one club. A technical fest starts in the college, and it will run for the next $d$ days. There is a c...
[["5 3\n0 1 2 2 0\n1 2 2 3 2\n5\n3\n2\n4\n5\n1\n", "3\n1\n1\n1\n0\n"], ["5 3\n0 1 2 2 1\n1 3 2 3 2\n5\n4\n2\n3\n5\n1\n", "3\n2\n2\n1\n0\n"], ["5 5\n0 1 2 4 5\n1 2 3 4 5\n4\n2\n3\n5\n4\n", "1\n1\n1\n1\n"], ["10 10\n8 5 1 3 9 2 7 0 6 4\n6 4 8 2 7 9 5 1 10 3\n10\n9\n2\n1\n7\n5\n6\n8\n3\n10\n4\n", "6\n5\n5\n5\n5\n2\n0\n0\n...
1
{"source": "deepcoder/taco", "upstream_id": "taco/train-00002-of-00004.parquet#576"}
25e9ccbbf87da19a
You are given a string $s$ consisting of lowercase Latin letters "a", "b" and "c" and question marks "?". Let the number of question marks in the string $s$ be $k$. Let's replace each question mark with one of the letters "a", "b" and "c". Here we can obtain all $3^{k}$ possible strings consisting only of letters "a",...
[["6\nac?b?c\n", "24\n"], ["7\n???????\n", "2835\n"], ["9\ncccbbbaaa\n", "0\n"], ["5\na???c\n", "46\n"], ["3\n???\n", "1\n"], ["3\nabc\n", "1\n"], ["100\naccbaccabccbbbbabacabaaccacbcbcababbbcbcbcccabcbbc?caaabcabcaaccbccabaaaaccacabbaabcbbccbbababaacbca\n", "14634\n"], ["100\ncbcbacbbba?aacaccabbabcbcbbccaccabcbbcbabc...
1
{"source": "deepcoder/taco", "upstream_id": "taco/train-00003-of-00004.parquet#1526"}
25f1493ed3212ee7
You are given a text consisting of $n$ space-separated words. There is exactly one space character between any pair of adjacent words. There are no spaces before the first word and no spaces after the last word. The length of text is the number of letters and spaces in it. $w_i$ is the $i$-th word of text. All words co...
[["6\nto be or not to be\n", "12\n"], ["10\na ab a a b ab a a b c\n", "13\n"], ["6\naa bb aa aa bb bb\n", "11\n"], ["45\nxr l pl sx c c u py sv j f x h u y w w bs u cp e ad ib b tz gy lm e s n ln kg fs rd ln v f sh t z r b j w of\n", "106\n"], ["250\nf r s d b f f k d e k v m b t k k j t t a o m m s n d w l v g e k x d...
1.46
{"source": "deepcoder/taco", "upstream_id": "taco/train-00003-of-00004.parquet#215"}
25fbd5eced11d8d6
You are given a directed graph $G$ which can contain loops (edges from a vertex to itself). Multi-edges are absent in $G$ which means that for all ordered pairs $(u, v)$ exists at most one edge from $u$ to $v$. Vertices are numbered from $1$ to $n$. A path from $u$ to $v$ is a sequence of edges such that: vertex $u$ ...
[["5\n\n6 7\n1 4\n1 3\n3 4\n4 5\n2 1\n5 5\n5 6\n\n1 0\n\n3 3\n1 2\n2 3\n3 1\n\n5 0\n\n4 4\n1 2\n2 3\n1 4\n4 3\n", "1 0 1 2 -1 -1 \n1 \n-1 -1 -1 \n1 0 0 0 0 \n1 1 2 1 \n"], ["1\n\n6 6\n1 2\n2 3\n3 4\n3 5\n4 2\n4 6\n", "1 -1 -1 -1 -1 -1 \n"], ["1\n\n6 7\n1 2\n2 3\n2 4\n3 1\n4 5\n5 6\n6 4\n", "-1 -1 -1 -1 -1 -1 \n"], ["1\...
1
{"source": "deepcoder/primeintellect", "upstream_id": "primeintellect/train-00004-of-00005.parquet#1708"}
25fddb4f086dbae3
On a certain meeting of a ruling party "A" minister Pavel suggested to improve the sewer system and to create a new pipe in the city. The city is an n × m rectangular squared field. Each square of the field is either empty (then the pipe can go in it), or occupied (the pipe cannot go in such square). Empty squares are...
[["3 3\n...\n..#\n...\n", "3\n"], ["4 2\n..\n..\n..\n..\n", "2\n"], ["4 5\n#...#\n#...#\n###.#\n###.#\n", "4\n"], ["6 4\n####\n####\n....\n####\n####\n####\n", "1\n"], ["4 6\n######\n######\n......\n######\n", "1\n"], ["6 4\n##.#\n##.#\n##.#\n##.#\n##.#\n##.#\n", "1\n"], ["4 6\n##.###\n##.###\n##.###\n##.###\n", "1\n"]...
1
{"source": "deepcoder/taco", "upstream_id": "taco/train-00000-of-00004.parquet#1141"}
262d1f40a484c762
Problem: You are given n natural numbers a1,a2,a3…… an. Let SOD of a number be defined as the Sum of Digits of that number. Compute the value of { [ SOD(a1) + SOD(a2) + …….. SOD(an) ] % 9 } – { [ SOD( a1 + a2 + ….. an ) ] % 9 } Input: The first line consists of the value of n. Next n lines are such that the i th li...
[["44\n9242491309192363508454348881448\n95499654020\n109758011410598474817655293640390075049706107889887302348716784557022182\n73075996487581437057821509555280826186715408365459266016843977808929\n845366999775902\n435255049317799578761128574212522387250\n86362858869984515851809408208396962613058300446003661080615646392...
1
{"source": "deepcoder/taco", "upstream_id": "taco/train-00002-of-00004.parquet#465"}
263452be42d97540
We have a permutation p = {p_1,\ p_2,\ ...,\ p_n} of {1,\ 2,\ ...,\ n}. Print the number of elements p_i (1 < i < n) that satisfy the following condition: * p_i is the second smallest number among the three numbers p_{i - 1}, p_i, and p_{i + 1}. Constraints * All values in input are integers. * 3 \leq n \leq 20 * p...
[["9\n9 6 3 2 5 8 7 4 1", "5"], ["5\n1 3 5 4 2", "2"], ["9\n9 6 3 2 5 14 7 4 1", "5\n"], ["5\n2 3 5 4 2", "2\n"], ["9\n14 17 3 4 5 25 7 4 0", "4\n"], ["5\n2 1 5 4 2", "1\n"], ["9\n14 12 3 2 9 14 1 4 0", "3\n"], ["5\n2 6 4 8 3", "0\n"], ["9\n14 6 3 2 5 14 7 4 1", "5\n"], ["9\n14 6 3 2 5 14 7 4 0", "5\n"], ["9\n14 12 3 2...
1
{"source": "deepcoder/primeintellect", "upstream_id": "primeintellect/train-00001-of-00005.parquet#2575"}
263a49fbdc950fa9
Vasya 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) = a0 + a1x1 + ... + anxn. Numbers ai are called coefficients of a polynomial, non-negative integer n is called a degree of a polynomial. Vasya has made a bet with his friends that h...
[["2 3 3\n", "1\n"], ["2 2 2\n", "2\n"], ["1 2 5\n", "1\n"], ["1000000000000000000 1000000000000000000 1000000000000000000\n", "2\n"], ["135645 1 365333453\n", "0\n"], ["1 12 1728\n", "1\n"], ["110 1000 998\n", "0\n"], ["1 5 5\n", "1\n"], ["1 3 6561\n", "1\n"], ["563236 135645 356563\n", "0\n"], ["1 10 9999999999999999...
1
{"source": "deepcoder/primeintellect", "upstream_id": "primeintellect/train-00001-of-00005.parquet#341"}
263f3efa94fff3d6
Given any integer x, Aoki can do the operation below. Operation: Replace x with the absolute difference of x and K. You are given the initial value of an integer N. Find the minimum possible value taken by N after Aoki does the operation zero or more times. Constraints * 0 ≤ N ≤ 10^{18} * 1 ≤ K ≤ 10^{18} * All valu...
[["1000000000000000000 1", "0"], ["7 4", "1"], ["2 6", "2"], ["1000000000000010000 1", "0\n"], ["7 6", "1\n"], ["7 9", "2\n"], ["17 12", "5\n"], ["7 13", "6\n"], ["8 16", "8\n"], ["5 9", "4\n"], ["30 23", "7\n"], ["10 22", "10\n"], ["37 10", "3\n"], ["12 23", "11\n"], ["14 23", "9\n"], ["13 30", "13\n"], ["19 31", "12\...
1
{"source": "deepcoder/primeintellect", "upstream_id": "primeintellect/train-00001-of-00005.parquet#499"}
2645c669d143e74d
problem AOR Ika is studying to pass the test. AOR Ika-chan solved the $ N $ question. After that, round the solved problem according to the following procedure. 1. Check the correctness of the answer. 2. If the answer is correct, write a circle mark, and if it is incorrect, write a cross mark on the answer sheet. ...
[["3\nnxx", "2\n"], ["3\nnwx", "3\n"], ["3\nxxo", "1\n"], ["3\nxwn", "3\n"], ["3\nowx", "3\n"], ["3\npxx", "2\n"], ["3\npyx", "3\n"], ["3\npzx", "3\n"], ["3\npzw", "3\n"], ["3\npwz", "3\n"], ["3\nzwp", "3\n"], ["3\nzxp", "3\n"], ["3\npxz", "3\n"], ["3\nzyp", "3\n"], ["3\nyzp", "3\n"], ["3\nyzq", "3\n"], ["3\nyzr", "3\n...
1
{"source": "deepcoder/taco", "upstream_id": "taco/train-00001-of-00004.parquet#1303"}
264d28efb7b447fa
Adilbek's house is located on a street which can be represented as the OX axis. This street is really dark, so Adilbek wants to install some post lamps to illuminate it. Street has $n$ positions to install lamps, they correspond to the integer numbers from $0$ to $n - 1$ on the OX axis. However, some positions are bloc...
[["6 2 3\n1 3\n1 2 3\n", "6\n"], ["4 3 4\n1 2 3\n1 10 100 1000\n", "1000\n"], ["5 1 5\n0\n3 3 3 3 3\n", "-1\n"], ["7 4 3\n2 4 5 6\n3 14 15\n", "-1\n"], ["1 0 1\n\n1000000\n", "1000000\n"], ["1 1 1\n0\n1000\n", "-1\n"], ["3 2 3\n1 2\n1 1 1000000\n", "1000000\n"], ["3 0 3\n\n333 500 1001\n", "999\n"], ["3 0 3\n\n334 500 ...
1.11
{"source": "deepcoder/taco", "upstream_id": "taco/train-00002-of-00004.parquet#1381"}
2667f86333288be7
Monocarp is playing a game "Assimilation IV". In this game he manages a great empire: builds cities and conquers new lands. Monocarp's empire has $n$ cities. In order to conquer new lands he plans to build one Monument in each city. The game is turn-based and, since Monocarp is still amateur, he builds exactly one Mon...
[["3 5\n1 4 4 3 4\n1 4 1 4 2\n1 4 4 4 3\n", "166374062\n"], ["1 1\n1\n", "1\n"], ["1 1\n2\n", "0\n"], ["3 1\n1\n1\n1\n", "1\n"], ["1 1\n1\n", "1\n"], ["1 1\n2\n", "0\n"], ["3 1\n1\n1\n1\n", "1\n"], ["3 1\n1\n1\n2\n", "1\n"], ["3 5\n1 4 4 3 4\n1 4 2 4 2\n1 4 4 4 3\n", "831870297\n"], ["3 5\n1 4 4 3 4\n1 4 2 4 2\n1 3 4 4...
1
{"source": "deepcoder/taco", "upstream_id": "taco/train-00003-of-00004.parquet#502"}
26703d2a65c48b98
Ilya the Lion wants to help all his friends with passing exams. They need to solve the following problem to pass the IT exam. You've got string s = s_1s_2... s_{n} (n is the length of the string), consisting only of characters "." and "#" and m queries. Each query is described by a pair of integers l_{i}, r_{i} (1 ≤ l...
[["......\n4\n3 4\n2 3\n1 6\n2 6\n", "1\n1\n5\n4\n"], ["#..###\n5\n1 3\n5 6\n1 5\n3 6\n3 4\n", "1\n1\n2\n2\n0\n"], [".#...#..\n6\n1 5\n2 3\n6 7\n2 4\n2 5\n1 3\n", "2\n0\n0\n1\n2\n0\n"], ["#.#.#..\n5\n3 4\n4 5\n5 7\n5 7\n1 3\n", "0\n0\n1\n1\n0\n"], ["#.##.##.\n7\n1 8\n2 6\n2 6\n6 8\n3 5\n2 4\n2 5\n", "2\n1\n1\n1\n1\n1\n...
1
{"source": "deepcoder/taco", "upstream_id": "taco/train-00000-of-00004.parquet#1831"}
267309f5a0c012b2
Mahmoud wants to write a new dictionary that contains n words and relations between them. There are two types of relations: synonymy (i. e. the two words mean the same) and antonymy (i. e. the two words mean the opposite). From time to time he discovers a new relation between two words. He know that if two words have ...
[["8 6 5\nhi welcome hello ihateyou goaway dog cat rat\n1 hi welcome\n1 ihateyou goaway\n2 hello ihateyou\n2 hi goaway\n2 hi hello\n1 hi hello\ndog cat\ndog hi\nhi hello\nihateyou goaway\nwelcome ihateyou\n", "YES\nYES\nYES\nYES\nNO\nYES\n3\n3\n1\n1\n2\n"], ["3 3 4\nhate love like\n1 love like\n2 love hate\n1 hate like...
1
{"source": "deepcoder/primeintellect", "upstream_id": "primeintellect/train-00002-of-00005.parquet#132"}
268b254e990d63d9
The Zoo in the Grid Kingdom is represented by an infinite grid. The Zoo has n observation binoculars located at the OX axis. For each i between 1 and n, inclusive, there exists a single binocular located at the point with coordinates (i, 0). There are m flamingos in the Zoo, located at points with positive coordinates....
[["1000000 2\n194305 1024\n4388610 1023\n", "1000000\n"], ["3 3\n227495634 254204506\n454991267 508409012\n217792637 799841973\n", "4\n"], ["1000000 2\n136395332 110293751\n568110113 459392523\n", "1000000\n"], ["3 3\n1 1\n2 10\n3 100\n", "3\n"], ["1000000 2\n881456674 979172365\n878302062 975668042\n", "1000000\n"], [...
1
{"source": "deepcoder/taco", "upstream_id": "taco/train-00001-of-00004.parquet#795"}
269298749b580457
Alice 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}$ value of all elements equal to $b$. What is the shortest possible length of the array Bob wrote? ...
[["5\n1 1\n2 1\n2 0\n1 10000\n2 10000\n", "3\n2\n3\n2\n3\n"], ["1\n187994 180766\n", "187995\n"], ["1\n187994 180766\n", "187995\n"], ["1\n187994 204747\n", "187995\n"], ["1\n246904 204747\n", "246905\n"], ["1\n85497 204747\n", "85498\n"], ["1\n131971 84448\n", "131972\n"], ["1\n234010 8121\n", "234011\n"], ["1\n276349...
1
{"source": "deepcoder/taco", "upstream_id": "taco/train-00000-of-00004.parquet#1494"}
26a0ea6d52f59cf1
Mr. Scrooge, a very busy man, decided to count the time he wastes on all sorts of useless stuff to evaluate the lost profit. He has already counted the time he wastes sleeping and eating. And now Mr. Scrooge wants to count the time he has wasted signing papers. Mr. Scrooge's signature can be represented as a polyline ...
[["48 447\n14 9\n9 -17\n-17 11\n-14 14\n19 -8\n-14 -17\n-7 10\n-6 -11\n-9 -19\n19 10\n-4 2\n-5 16\n20 9\n-10 20\n-7 -17\n14 -16\n-2 -10\n-18 -17\n14 12\n-6 -19\n5 -18\n-3 2\n-3 10\n-5 5\n13 -12\n10 -18\n10 -12\n-2 4\n7 -15\n-5 -5\n11 14\n11 10\n-6 -9\n13 -4\n13 9\n6 12\n-13 17\n-9 -12\n14 -19\n10 12\n-15 8\n-1 -11\n19 ...
1
{"source": "deepcoder/primeintellect", "upstream_id": "primeintellect/train-00003-of-00005.parquet#3110"}
26aa470467f06d8d
The USA Construction Operation (USACO) recently ordered Farmer John to arrange a row of $n$ haybale piles on the farm. The $i$-th pile contains $a_i$ haybales. However, Farmer John has just left for vacation, leaving Bessie all on her own. Every day, Bessie the naughty cow can choose to move one haybale in any pile t...
[["3\n4 5\n1 0 3 2\n2 2\n100 1\n1 8\n0\n", "3\n101\n0\n"], ["3\n4 5\n1 0 1 2\n2 2\n100 1\n1 8\n0\n", "3\n101\n0\n"], ["3\n4 5\n1 0 1 2\n2 2\n100 2\n1 8\n0\n", "3\n102\n0\n"], ["3\n4 5\n0 0 1 2\n2 2\n100 2\n1 7\n0\n", "2\n102\n0\n"], ["3\n4 5\n0 0 1 2\n2 2\n000 2\n1 7\n0\n", "2\n2\n0\n"], ["3\n4 5\n1 0 3 2\n2 2\n100 0\n...
1
{"source": "deepcoder/taco", "upstream_id": "taco/train-00000-of-00004.parquet#272"}
26be21f7ab2bd3ad
Revised The current era, Heisei, will end on April 30, 2019, and a new era will begin the next day. The day after the last day of Heisei will be May 1, the first year of the new era. In the system developed by the ACM-ICPC OB / OG Association (Japanese Alumni Group; JAG), the date uses the Japanese calendar (the Japa...
[["HEISEI 1 1 8\nHEISEI 31 4 30\nIESIEH 31 5 1\nHEISEI 99 12 31\nHEISEI 38 8 30\nHEISEI 98 2 22\nHEISEI 2 3 26\nHEISEI 28 4 23\n#", "HEISEI 1 1 8\nHEISEI 31 4 30\n? 1 5 1\n? 69 12 31\n? 8 8 30\n? 68 2 22\nHEISEI 2 3 26\nHEISEI 28 4 23\n"], ["HEISEI 1 1 8\nHEISEI 31 4 30\nIESIEH 31 5 1\nHEISEI 99 12 31\nHEISEI 38 8 30\n...
1
{"source": "deepcoder/taco", "upstream_id": "taco/train-00002-of-00004.parquet#113"}
26bfabe9f65af3d3
You are given two positive integers N and K. How many multisets of rational numbers satisfy all of the following conditions? - The multiset has exactly N elements and the sum of them is equal to K. - Each element of the multiset is one of 1, \frac{1}{2}, \frac{1}{4}, \frac{1}{8}, \dots. In other words, each element c...
[["4 2\n", "2\n"], ["2525 425\n", "687232272\n"], ["3000 1\n", "815951975\n"], ["2929 1\n", "898933669\n"], ["2 1\n", "1\n"], ["2 2\n", "1\n"], ["2987 3\n", "277026146\n"], ["2919 2863\n", "393849245\n"], ["2992 2938\n", "678074080\n"], ["198 21\n", "933081109\n"], ["88 11\n", "843932061\n"], ["2580 813\n", "498425930\...
4
{"source": "deepcoder/taco", "upstream_id": "taco/train-00002-of-00004.parquet#1274"}
26c17df22754567e
You are given n - 1 integers a_2, ..., a_n and a tree with n vertices rooted at vertex 1. The leaves are all at the same distance d from the root. Recall that a tree is a connected undirected graph without cycles. The distance between two vertices is the number of edges on the simple path between them. All non-root v...
[["4\n14\n1 1 1 2 3 4 4 5 5 6 7 8 8\n2 3 7 7 6 9 5 9 7 3 6 6 5\n6\n1 2 2 3 4\n32 78 69 5 41\n15\n1 15 1 10 4 9 11 2 4 1 8 6 10 11\n62 13 12 43 39 65 42 86 25 38 19 19 43 62\n15\n11 2 7 6 9 8 10 1 1 1 5 3 15 2\n50 19 30 35 9 45 13 24 8 44 16 26 10 40\n", "\n14\n45\n163\n123\n"], ["4\n14\n1 1 1 2 3 4 4 5 5 6 7 8 8\n2 3 7...
1
{"source": "deepcoder/primeintellect", "upstream_id": "primeintellect/train-00002-of-00005.parquet#768"}
26c23efa90e5a0d2
Bessie the cow has just intercepted a text that Farmer John sent to Burger Queen! However, Bessie is sure that there is a secret message hidden inside. The text is a string $s$ of lowercase Latin letters. She considers a string $t$ as hidden in string $s$ if $t$ exists as a subsequence of $s$ whose indices form an ari...
[["aaabb\n", "6\n"], ["usaco\n", "1\n"], ["lol\n", "2\n"], ["qdpinbmcrfwxpdbfgozvvocemjructoadewegtvbvbfwwrpgyeaxgddrwvlqnygwmwhmrhaizpyxvgaflrsvzhhzrouvpxrkxfza\n", "37\n"], ["cc\n", "2\n"], ["qqq\n", "3\n"], ["aaaa\n", "6\n"], ["bdhzijklmaopxqrstnfugvcwye\n", "1\n"], ["bdhzijklmaopxqrstnfugvcwyeb\n", "2\n"], ["zy\n",...
1
{"source": "deepcoder/taco", "upstream_id": "taco/train-00000-of-00004.parquet#217"}
26d13d044d76a4b7
You are given a sequence of $n$ integers $a_1, \, a_2, \, \dots, \, a_n$. Does there exist a sequence of $n$ integers $b_1, \, b_2, \, \dots, \, b_n$ such that the following property holds? For each $1 \le i \le n$, there exist two (not necessarily distinct) indices $j$ and $k$ ($1 \le j, \, k \le n$) such that $a_i ...
[["5\n5\n4 -7 -1 5 10\n1\n0\n3\n1 10 100\n4\n-3 2 10 2\n9\n25 -171 250 174 152 242 100 -205 -258\n", "YES\nYES\nNO\nYES\nYES\n"], ["20\n2\n0 -7\n3\n4 3 -2\n2\n6 0\n2\n0 5\n3\n0 -3 0\n3\n3 0 2\n2\n4 -9\n1\n0\n2\n0 6\n3\n0 -5 1\n2\n9 -6\n3\n-2 -3 -1\n3\n2 -4 -4\n3\n-1 -4 -2\n3\n-10 -2 -1\n3\n3 -8 1\n3\n2 5 10\n3\n-6 -9 -...
1
{"source": "deepcoder/taco", "upstream_id": "taco/train-00002-of-00004.parquet#724"}
26d85ca1f602c332
There is a kangaroo at coordinate 0 on an infinite number line that runs from left to right, at time 0. During the period between time i-1 and time i, the kangaroo can either stay at his position, or perform a jump of length exactly i to the left or to the right. That is, if his coordinate at time i-1 is x, he can be a...
[["12", "5\n"], ["4", "3\n"], ["19", "6\n"], ["24", "7\n"], ["10", "4\n"], ["1", "1\n"], ["3", "2\n"], ["40", "9\n"], ["50", "10\n"], ["29", "8\n"], ["69", "12\n"], ["105", "14\n"], ["173", "19\n"], ["200", "20\n"], ["227", "21\n"], ["349", "26\n"], ["60", "11\n"], ["108", "15\n"], ["135", "16\n"], ["89", "13\n"], ["60...
1
{"source": "deepcoder/taco", "upstream_id": "taco/train-00000-of-00004.parquet#345"}
26e9e9953998b83b
Petr stands in line of n people, but he doesn't know exactly which position he occupies. He can say that there are no less than a people standing in front of him and no more than b people standing behind him. Find the number of different positions Petr can occupy. Input The only line contains three integers n, a and ...
[["23 8 14\n", "15"], ["59 12 39\n", "40"], ["56 43 12\n", "13"], ["42 25 16\n", "17"], ["49 11 37\n", "38"], ["9 4 3\n", "4"], ["94 5 88\n", "89"], ["90 76 59\n", "14"], ["58 57 28\n", "1"], ["41 27 11\n", "12"], ["84 0 42\n", "43"], ["73 37 35\n", "36"], ["96 22 72\n", "73"], ["94 62 48\n", "32"], ["100 81 91\n", "19...
1
{"source": "deepcoder/taco", "upstream_id": "taco/train-00002-of-00004.parquet#1356"}
26f9d17ccfbb1189
A girl named Xenia has a cupboard that looks like an arc from ahead. The arc is made of a semicircle with radius r (the cupboard's top) and two walls of height h (the cupboard's sides). The cupboard's depth is r, that is, it looks like a rectangle with base r and height h + r from the sides. The figure below shows what...
[["1 1\n", "3\n"], ["1 2\n", "5\n"], ["2 1\n", "2\n"], ["2 2\n", "3\n"], ["2 3\n", "4\n"], ["4 1\n", "1\n"], ["5 1\n", "1\n"], ["5 2\n", "1\n"], ["5 3\n", "2\n"], ["5 4\n", "2\n"], ["5 5\n", "3\n"], ["5 6\n", "3\n"], ["5 9\n", "4\n"], ["5 10\n", "5\n"], ["5 11\n", "5\n"], ["674098 1358794\n", "5\n"], ["3983458 7761504\...
1
{"source": "deepcoder/taco", "upstream_id": "taco/train-00000-of-00004.parquet#81"}
26fafe829037bed8
Mike is trying rock climbing but he is awful at it. There are n holds on the wall, i-th hold is at height ai off the ground. Besides, let the sequence ai increase, that is, ai < ai + 1 for all i from 1 to n - 1; we will call such sequence a track. Mike thinks that the track a1, ..., an has difficulty <image>. In othe...
[["3\n1 4 6\n", "5\n"], ["5\n1 2 3 4 5\n", "2\n"], ["5\n1 2 3 7 8\n", "4\n"], ["100\n1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 97...
1
{"source": "deepcoder/primeintellect", "upstream_id": "primeintellect/train-00001-of-00005.parquet#921"}
270cd54fb1744c74
Your city has n junctions. There are m one-way roads between the junctions. As a mayor of the city, you have to ensure the security of all the junctions. To ensure the security, you have to build some police checkposts. Checkposts can only be built in a junction. A checkpost at junction i can protect junction j if eit...
[["5\n2 8 0 6 0\n6\n1 4\n1 3\n2 4\n3 4\n4 5\n5 1\n", "8 2\n"], ["3\n1 2 3\n3\n1 2\n2 3\n3 2\n", "3 1\n"], ["2\n7 91\n2\n1 2\n2 1\n", "7 1\n"], ["10\n1 3 2 2 1 3 1 4 10 10\n12\n1 2\n2 3\n3 1\n3 4\n4 5\n5 6\n5 7\n6 4\n7 3\n8 9\n9 10\n10 9\n", "15 6\n"], ["1\n0\n0\n", "0 1\n"], ["1\n1000000000\n0\n", "1000000000 1\n"], ["...
1
{"source": "deepcoder/primeintellect", "upstream_id": "primeintellect/train-00002-of-00005.parquet#2934"}
2718176d23171ce1
You are an upcoming movie director, and you have just released your first movie. You have also launched a simple review site with two buttons to press — upvote and downvote. However, the site is not so simple on the inside. There are two servers, each with its separate counts for the upvotes and the downvotes. $n$ re...
[["4\n1\n2\n3\n1 2 3\n5\n1 1 1 1 1\n3\n3 3 2\n", "0\n2\n5\n2\n"], ["9\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n", "1\n1\n1\n1\n1\n1\n1\n1\n1\n"], ["1\n1\n2\n", "0\n"], ["9\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n", "1\n1\n1\n1\n1\n1\n1\n1\n1\n"], ["1\n1\n2\n", "0\n"], ["9\n1\n1\n1\n1\n1\n1\...
1
{"source": "deepcoder/taco", "upstream_id": "taco/train-00001-of-00004.parquet#1695"}
271841b02e779d25
To make it difficult to withdraw money, a certain bank allows its customers to withdraw only one of the following amounts in one operation: - 1 yen (the currency of Japan) - 6 yen, 6^2(=36) yen, 6^3(=216) yen, ... - 9 yen, 9^2(=81) yen, 9^3(=729) yen, ... At least how many operations are required to withdraw exactly...
[["127\n", "4\n"], ["3\n", "3\n"], ["44852\n", "16\n"], ["43637\n", "16\n"], ["99788\n", "15\n"], ["35861\n", "15\n"], ["59049\n", "1\n"], ["46656\n", "1\n"], ["1\n", "1\n"], ["15\n", "2\n"], ["6\n", "1\n"], ["9\n", "1\n"], ["486\n", "5\n"], ["28277\n", "9\n"], ["76641\n", "7\n"], ["14248\n", "9\n"], ["434\n", "4\n"], ...
1.18
{"source": "deepcoder/taco", "upstream_id": "taco/train-00002-of-00004.parquet#1635"}
2719f9cee03d66d2
We saw the little game Marmot made for Mole's lunch. Now it's Marmot's dinner time and, as we all know, Marmot eats flowers. At every dinner he eats some red and white flowers. Therefore a dinner can be represented as a sequence of several flowers, some of them white and some of them red. But, for a dinner to be tasty...
[["3 2\n1 3\n2 3\n4 4\n", "6\n5\n5\n"], ["1 2\n64329 79425\n", "0\n"], ["1 1\n1 3\n", "14\n"], ["1 1\n2 3\n", "12\n"], ["3 1\n1 3\n2 3\n4 4\n", "14\n12\n16\n"], ["1 2\n2 3\n", "5\n"], ["3 1\n1 3\n1 3\n4 4\n", "14\n14\n16\n"], ["1 1\n3 3\n", "8\n"], ["1 2\n2 4\n", "10\n"], ["3 2\n1 3\n1 3\n4 4\n", "6\n6\n5\n"], ["1 2\n3...
1
{"source": "deepcoder/primeintellect", "upstream_id": "primeintellect/train-00001-of-00005.parquet#1297"}
272e8c5165c78f9f
Every summer Vitya comes to visit his grandmother in the countryside. This summer, he got a huge wart. Every grandma knows that one should treat warts when the moon goes down. Thus, Vitya has to catch the moment when the moon is down. Moon cycle lasts 30 days. The size of the visible part of the moon (in Vitya's units...
[["5\n3 4 5 6 7\n", "UP\n"], ["7\n12 13 14 15 14 13 12\n", "DOWN\n"], ["1\n8\n", "-1\n"], ["44\n7 8 9 10 11 12 13 14 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 14 13 12 11 10\n", "DOWN\n"], ["92\n3 4 5 6 7 8 9 10 11 12 13 14 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 1 2 3 4 5 6 7 8 9 10 11 12...
1
{"source": "deepcoder/taco", "upstream_id": "taco/train-00000-of-00004.parquet#12"}
273633b7eab3fa0e
There is a grid of size W × H surrounded by walls. Some cells in the grid are occupied by slimes. The slimes want to unite with each other and become a "King Slime". In each move, a slime can move to east, west, south and north direction until it enters a cell occupied by another slime or hit the surrounding wall. If ...
[["2 3 3\n2 4\n3 3", "2\n"], ["4 3 3\n1 1\n0 3\n3 1\n3 3", "3\n"], ["2 4 6\n2 2\n2 3", "1\n"], ["1 4 4\n2 2\n3 3", "0\n"], ["4 3 3\n1 1\n1 3\n6 1\n3 2", "4\n"], ["2 4 6\n2 2\n0 3", "3\n"], ["4 3 3\n1 1\n1 3\n3 1\n3 6", "3\n"], ["4 6 3\n1 1\n0 3\n3 1\n3 3", "3\n"], ["2 4 3\n2 2\n2 3", "1\n"], ["4 3 3\n1 1\n1 3\n3 1\n3 2...
1
{"source": "deepcoder/taco", "upstream_id": "taco/train-00003-of-00004.parquet#1151"}
273ad709a1cf31e8
You are given two arrays: an array $a$ consisting of $n$ zeros and an array $b$ consisting of $n$ integers. You can apply the following operation to the array $a$ an arbitrary number of times: choose some subsegment of $a$ of length $k$ and add the arithmetic progression $1, 2, \ldots, k$ to this subsegment — i. e. ad...
[["3 3\n5 4 6\n", "5\n"], ["6 3\n1 2 3 2 2 3\n", "3\n"], ["6 3\n1 2 4 1 2 3\n", "3\n"], ["7 3\n50 17 81 25 42 39 96\n", "92\n"], ["1 1\n1\n", "1\n"], ["1 1\n1000000000000\n", "1000000000000\n"], ["3 3\n14159 26535 89793\n", "29931\n"], ["7 4\n1 10000 1 1 1 1 10000\n", "7500\n"], ["17 10\n465 868 29 633 291 357 62 929 2...
1
{"source": "deepcoder/taco", "upstream_id": "taco/train-00000-of-00004.parquet#921"}
27433770f3497bba
We have N cards. A number a_i is written on the i-th card. Alice and Bob will play a game using these cards. In this game, Alice and Bob alternately take one card. Alice goes first. The game ends when all the cards are taken by the two players, and the score of each player is the sum of the numbers written on the cards...
[["4\n20 18 2 18", "18"], ["2\n3 1", "2"], ["3\n2 7 4", "5"], ["4\n20 18 2 12", "12\n"], ["2\n2 1", "1\n"], ["3\n3 7 4", "6\n"], ["4\n20 1 2 12", "9\n"], ["2\n2 0", "2\n"], ["3\n3 9 4", "8\n"], ["4\n20 1 4 12", "11\n"], ["2\n2 -1", "3\n"], ["2\n4 -1", "5\n"], ["4\n20 2 0 12", "10\n"], ["2\n5 -2", "7\n"], ["4\n23 4 0 12...
1
{"source": "deepcoder/primeintellect", "upstream_id": "primeintellect/train-00001-of-00005.parquet#451"}
27497e66d87ec021
As you very well know, this year's funkiest numbers are so called triangular numbers (that is, integers that are representable as <image>, where k is some positive integer), and the coolest numbers are those that are representable as a sum of two triangular numbers. A well-known hipster Andrew adores everything funky ...
[["512\n", "NO\n"], ["256\n", "YES\n"], ["39210\n", "YES\n"], ["187719774\n", "NO\n"], ["999999190\n", "YES\n"], ["15\n", "NO\n"], ["999999940\n", "YES\n"], ["828\n", "YES\n"], ["3761248\n", "YES\n"], ["296798673\n", "NO\n"], ["18\n", "YES\n"], ["5\n", "NO\n"], ["85\n", "NO\n"], ["11\n", "YES\n"], ["82\n", "NO\n"], ["7...
1
{"source": "deepcoder/primeintellect", "upstream_id": "primeintellect/train-00002-of-00005.parquet#1751"}
276bbbf29b455279
Your task is to calculate the number of arrays such that: each array contains $n$ elements; each element is an integer from $1$ to $m$; for each array, there is exactly one pair of equal elements; for each array $a$, there exists an index $i$ such that the array is strictly ascending before the $i$-th element and s...
[["3 4\n", "6\n"], ["3 5\n", "10\n"], ["42 1337\n", "806066790\n"], ["100000 200000\n", "707899035\n"], ["150000 200000\n", "270223789\n"], ["2 2\n", "0\n"], ["3 3\n", "3\n"], ["3 200000\n", "35012940\n"], ["200000 200000\n", "668956439\n"], ["20 20\n", "47185920\n"], ["2 3\n", "0\n"], ["1000 200000\n", "664520775\n"],...
1
{"source": "deepcoder/taco", "upstream_id": "taco/train-00000-of-00004.parquet#1578"}
276f1a4699ca5753
n robots have escaped from your laboratory! You have to find them as soon as possible, because these robots are experimental, and their behavior is not tested yet, so they may be really dangerous! Fortunately, even though your robots have escaped, you still have some control over them. First of all, you know the locat...
[["4\n2\n-1 -2 0 0 0 0\n-1 -2 0 0 0 0\n3\n1 5 1 1 1 1\n2 5 0 1 0 1\n3 5 1 0 0 0\n2\n1337 1337 0 1 1 1\n1336 1337 1 1 0 1\n1\n3 5 1 1 1 1\n", "1 -1 -2\n1 2 5\n0\n1 -100000 -100000\n"], ["4\n2\n-1 -2 0 0 0 0\n-1 -2 0 0 0 0\n3\n1 5 1 1 1 1\n2 5 0 0 0 1\n3 5 1 0 0 0\n2\n1337 1337 0 1 1 1\n1336 1337 1 1 0 1\n1\n3 5 1 1 1 1\...
1
{"source": "deepcoder/primeintellect", "upstream_id": "primeintellect/train-00001-of-00005.parquet#1611"}
277c926f1eca8806
There are N observatories in AtCoder Hill, called Obs. 1, Obs. 2, ..., Obs. N. The elevation of Obs. i is H_i. There are also M roads, each connecting two different observatories. Road j connects Obs. A_j and Obs. B_j. Obs. i is said to be good when its elevation is higher than those of all observatories that can be re...
[["4 3\n1 2 3 4\n1 3\n2 3\n2 4\n", "2\n"], ["6 5\n8 6 9 1 2 1\n1 3\n4 2\n4 3\n4 6\n4 6\n", "3\n"], ["6 5\n8 6 9 1 2 1\n1 3\n4 2\n4 0\n4 6\n4 6", "3\n"], ["4 3\n1 2 3 4\n1 3\n3 3\n2 4", "1\n"], ["4 2\n2 4 3 5\n1 3\n3 3\n2 4", "2\n"], ["4 0\n2 4 3 5\n1 3\n3 3\n4 4", "4\n"], ["6 0\n9 6 8 1 1 1\n0 3\n3 0\n4 1\n4 2\n1 6", "...
1
{"source": "deepcoder/taco", "upstream_id": "taco/train-00002-of-00004.parquet#1407"}
2781927b76534b3b
problem During this time of winter in Japan, hot days continue in Australia in the Southern Hemisphere. IOI, who lives in Australia, decided to plan what clothes to wear based on the weather forecast for a certain D day. The maximum temperature on day i (1 ≤ i ≤ D) is predicted to be Ti degrees. IOI has N kinds of cl...
[["3 4\n34\n27\n35\n20 25 30\n23 29 90\n21 35 60\n28 33 40", "60\n"], ["3 4\n31\n27\n35\n20 25 30\n35 29 90\n21 35 60\n28 33 40", "20\n"], ["3 4\n34\n40\n35\n20 25 30\n23 29 90\n21 69 60\n28 33 40", "0\n"], ["3 4\n31\n27\n35\n20 25 30\n23 29 90\n21 35 60\n28 48 40", "100\n"], ["3 4\n31\n27\n35\n20 25 30\n35 29 90\n21 3...
1
{"source": "deepcoder/taco", "upstream_id": "taco/train-00001-of-00004.parquet#381"}
27921f4a99d5b43e
Carol is currently curling. She has n disks each with radius r on the 2D plane. Initially she has all these disks above the line y = 10100. She then will slide the disks towards the line y = 0 one by one in order from 1 to n. When she slides the i-th disk, she will place its center at the point (xi, 10100). She w...
[["6 2\n5 5 6 8 3 12\n", "2 6.0 9.872983346207416 13.33708496134517 12.518734657272006 13.33708496134517\n"], ["1 1\n5\n", "1\n"], ["3 10\n1 100 1000\n", "10 10 10\n"], ["5 300\n939 465 129 611 532\n", "300 667.8641053432639 1164.9596695962555 1522.2774553276686 2117.0538839123933\n"], ["5 1\n416 387 336 116 81\n", "1 ...
1
{"source": "deepcoder/primeintellect", "upstream_id": "primeintellect/train-00002-of-00005.parquet#3013"}
279564e07c965135
Let's denote correct match equation (we will denote it as CME) an equation $a + b = c$ there all integers $a$, $b$ and $c$ are greater than zero. For example, equations $2 + 2 = 4$ (||+||=||||) and $1 + 2 = 3$ (|+||=|||) are CME but equations $1 + 2 = 4$ (|+||=||||), $2 + 2 = 3$ (||+||=|||), and $0 + 1 = 1$ (+|=|) are...
[["4\n2\n5\n8\n11\n", "2\n1\n0\n1\n"], ["100\n101\n60\n16\n78\n37\n22\n24\n63\n65\n57\n31\n46\n62\n50\n40\n79\n93\n97\n41\n64\n52\n30\n48\n95\n44\n9\n33\n15\n4\n59\n69\n56\n67\n73\n87\n17\n71\n23\n55\n18\n43\n80\n94\n58\n26\n90\n6\n96\n27\n10\n45\n75\n72\n82\n11\n3\n5\n85\n2\n14\n53\n36\n39\n99\n89\n20\n81\n61\n12\n29\...
1
{"source": "deepcoder/taco", "upstream_id": "taco/train-00002-of-00004.parquet#1608"}
27a70dedd28a04d1
$2^n$ teams participate in a playoff tournament. The tournament consists of $2^n - 1$ games. They are held as follows: in the first phase of the tournament, the teams are split into pairs: team $1$ plays against team $2$, team $3$ plays against team $4$, and so on (so, $2^{n-1}$ games are played in that phase). When a ...
[["3\n101\n", "4 5 6 7 "], ["1\n1\n", "2 "], ["2\n01\n", "2 3 "], ["2\n00\n", "1 "], ["1\n0\n", "1 "], ["2\n11\n", "4 "], ["3\n000\n", "1 "], ["3\n010\n", "2 3 4 5 "], ["3\n111\n", "8 "], ["4\n0000\n", "1 "], ["4\n0100\n", "2 3 4 5 6 7 8 9 "], ["4\n0110\n", "4 5 6 7 8 9 10 11 12 13 "], ["4\n1011\n", "8 9 10 11 12 13 14...
1
{"source": "deepcoder/taco", "upstream_id": "taco/train-00000-of-00004.parquet#194"}
27af18a76b5430a2
Polycarp has a string $s[1 \dots n]$ of length $n$ consisting of decimal digits. Polycarp performs the following operation with the string $s$ no more than once (i.e. he can perform operation $0$ or $1$ time): Polycarp selects two numbers $i$ and $j$ ($1 \leq i \leq j \leq n$) and removes characters from the $s$ strin...
[["6\n8\n20192020\n8\n22019020\n4\n2020\n5\n20002\n6\n729040\n6\n200200\n", "YES\nYES\nYES\nNO\nNO\nNO\n"], ["1\n4\n2021\n", "NO\n"], ["1\n4\n2029\n", "NO\n"], ["1\n4\n2030\n", "NO\n"], ["1\n4\n2040\n", "NO\n"], ["1\n4\n2050\n", "NO\n"], ["1\n4\n2090\n", "NO\n"], ["1\n4\n2080\n", "NO\n"], ["1\n4\n2070\n", "NO\n"], ["1\...
1
{"source": "deepcoder/taco", "upstream_id": "taco/train-00003-of-00004.parquet#681"}
27b04d01b0491e50
You are given three strings A, B and C. Check whether they form a word chain. More formally, determine whether both of the following are true: - The last character in A and the initial character in B are the same. - The last character in B and the initial character in C are the same. If both are true, print YES. Othe...
[["rng gorilla apple\n", "YES\n"], ["yakiniku unagi sushi\n", "NO\n"], ["a a a\n", "YES\n"], ["aaaaaaaaab aaaaaaaaaa aaaaaaaaab\n", "NO\n"], ["a a `", "NO\n"], ["baaaa`aaaa aabaaaaaaa aaaaa`aaab", "YES\n"], ["rnh gorilla apple", "NO\n"], ["aaaaaaaaab aaaaaaaaaa aaaaa`aaab", "NO\n"], ["ybkiniku unagi sushi", "NO\n"], ["...
1
{"source": "deepcoder/taco", "upstream_id": "taco/train-00003-of-00004.parquet#322"}
27b32d987dd0ab38
Given are positive integers N, M, Q, and Q quadruples of integers ( a_i , b_i , c_i , d_i ). Consider a sequence A satisfying the following conditions: * A is a sequence of N positive integers. * 1 \leq A_1 \leq A_2 \le \cdots \leq A_N \leq M. Let us define a score of this sequence as follows: * The score is the ...
[["3 4 3\n1 3 3 100\n1 2 2 10\n2 3 2 10", "110"], ["10 10 1\n1 10 9 1", "1"], ["4 6 10\n2 4 1 86568\n1 4 0 90629\n2 3 0 90310\n3 4 1 29211\n3 4 3 78537\n3 4 2 8580\n1 2 1 96263\n1 4 2 2156\n1 2 0 94325\n1 4 3 94328", "357500"], ["10 10 1\n1 10 12 1", "0\n"], ["4 6 10\n2 4 1 86568\n1 4 0 90629\n2 3 0 90310\n3 4 1 29211\...
1
{"source": "deepcoder/primeintellect", "upstream_id": "primeintellect/train-00001-of-00005.parquet#2626"}
27b6dbeb787ebf84
Takahashi received otoshidama (New Year's money gifts) from N of his relatives. You are given N values x_1, x_2, ..., x_N and N strings u_1, u_2, ..., u_N as input. Each string u_i is either `JPY` or `BTC`, and x_i and u_i represent the content of the otoshidama from the i-th relative. For example, if x_1 = `10000` a...
[["2\n10000 JPY\n0.10000000 BTC", "48000.0"], ["3\n100000000 JPY\n100.00000000 BTC\n0.00000001 BTC", "138000000.0038"], ["2\n00000 JPY\n0.10000000 BTC", "38000.0\n"], ["2\n00000 JPY\n0.7411383442474536 BTC", "281632.570814\n"], ["2\n10000 JPY\n0.7411383442474536 BTC", "291632.570814\n"], ["2\n01000 JPY\n0.10000000 BTC"...
1
{"source": "deepcoder/primeintellect", "upstream_id": "primeintellect/train-00001-of-00005.parquet#1834"}
27b88e8144dffa12
Heidi found out that the Daleks have created a network of bidirectional Time Corridors connecting different destinations (at different times!). She suspects that they are planning another invasion on the entire Space and Time. In order to counter the invasion, she plans to deploy a trap in the Time Vortex, along a care...
[["10 10\n9 10 1000000000\n10 2 1000000000\n6 3 1000000000\n8 6 1000000000\n4 8 1000000000\n7 5 1000000000\n9 7 1000000000\n1 3 1000000000\n1 5 1000000000\n4 2 1000000000\n", "1000000000\n"], ["10 21\n10 2 500000000\n8 7 500000000\n9 1 0\n9 8 1000000000\n3 4 1000000000\n2 4 1000000000\n5 4 500000000\n1 8 500000000\n2 9...
1
{"source": "deepcoder/taco", "upstream_id": "taco/train-00002-of-00004.parquet#1800"}
27ba2e62299a4996
Gaurang has grown up in a mystical universe. He is faced by n consecutive 2D planes. He shoots a particle of decay age k at the planes. A particle can pass through a plane directly, however, every plane produces an identical copy of the particle going in the opposite direction with a decay age k-1. If a particle has d...
[["6\n103 39\n161 13\n177 45\n116 34\n193 28\n172 35\n", "425822080\n290931466\n447348855\n601276541\n399768990\n498063852\n"], ["1\n1000 999\n", "444664353\n"], ["37\n30 16\n22 37\n37 43\n25 31\n12 12\n15 30\n42 11\n29 28\n26 32\n12 32\n18 12\n11 48\n24 25\n15 40\n40 38\n17 12\n22 27\n35 32\n11 29\n35 24\n42 35\n21 14...
3.91
{"source": "deepcoder/primeintellect", "upstream_id": "primeintellect/train-00002-of-00005.parquet#930"}
27c14d8809cfe2cd
Taro is addicted to a novel. The novel has n volumes in total, and each volume has a different thickness. Taro likes this novel so much that he wants to buy a bookshelf dedicated to it. However, if you put a large bookshelf in the room, it will be quite small, so you have to devise to make the width of the bookshelf as...
[["3 9\n500\n300\n800\n200\n100\n600\n900\n700\n400\n4 3\n1000\n1000\n1010\n0 0", "1800\n1010\n"], ["3 9\n500\n311\n800\n335\n100\n600\n900\n700\n400\n4 3\n1000\n1000\n1010\n0 0", "1935\n1010\n"], ["3 9\n559\n311\n800\n335\n100\n563\n900\n700\n400\n4 3\n1000\n1000\n1010\n0 0", "1898\n1010\n"], ["3 9\n500\n300\n800\n200...
1
{"source": "deepcoder/taco", "upstream_id": "taco/train-00001-of-00004.parquet#1598"}
27e68a4be792166c
As AtCoder Beginner Contest 100 is taking place, the office of AtCoder, Inc. is decorated with a sequence of length N, a = {a_1, a_2, a_3, ..., a_N}. Snuke, an employee, would like to play with this sequence. Specifically, he would like to repeat the following operation as many times as possible: For every i satisfy...
[["10\n2184 2126 1721 1800 1024 2528 3360 1945 1280 1776", "39"], ["4\n631 577 243 199", "0"], ["3\n5 2 4", "3"], ["10\n2184 2126 1721 1800 1480 2528 3360 1945 1280 1776", "32\n"], ["4\n631 846 243 199", "1\n"], ["10\n2184 2126 1721 1800 1480 2850 3360 1945 1280 1776", "28\n"], ["4\n631 846 218 199", "2\n"], ["3\n5 2 8...
1
{"source": "deepcoder/primeintellect", "upstream_id": "primeintellect/train-00002-of-00005.parquet#1775"}
27e8de4bbfa8c76b
On March 14, the day of the number $\pi$ is celebrated all over the world. This is a very important mathematical constant equal to the ratio of the circumference of a circle to its diameter. Polycarp was told at school that the number $\pi$ is irrational, therefore it has an infinite number of digits in decimal notati...
[["9\n000\n3\n4141592653\n141592653589793238462643383279\n31420\n31415\n314159265358\n27182\n314159265358979323846264338327\n", "0\n1\n0\n0\n3\n5\n12\n0\n30\n"], ["1\n00\n", "0\n"], ["1\n1\n", "0\n"], ["1\n3444\n", "1\n"], ["1\n31\n", "2\n"], ["1\n3\n", "1\n"], ["3\n314\n315\n314\n", "3\n2\n3\n"], ["2\n0\n0\n", "0\n0\n...
1
{"source": "deepcoder/taco", "upstream_id": "taco/train-00002-of-00004.parquet#1491"}
27f1cec04e1e923b
There is an integer sequence A of length N whose values are unknown. Given is an integer sequence B of length N-1 which is known to satisfy the following: B_i \geq \max(A_i, A_{i+1}) Find the maximum possible sum of the elements of A. -----Constraints----- - All values in input are integers. - 2 \leq N \leq 100 -...
[["3\n2 5\n", "9\n"], ["2\n3\n", "6\n"], ["6\n0 153 10 10 23\n", "53\n"], ["2\n0\n", "0\n"], ["99\n0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0\n", "0\n"], ["100\n1 0 1 ...
1
{"source": "deepcoder/taco", "upstream_id": "taco/train-00001-of-00004.parquet#132"}
27f77d3a6c493245
[Chopsticks (singular: chopstick) are short, frequently tapered sticks used in pairs of equal length, which are used as the traditional eating utensils of China, Japan, Korea and Vietnam. Originated in ancient China, they can also be found in some areas of Tibet and Nepal that are close to Han Chinese populations, as w...
[["5 2\n1\n3\n3\n9\n4\n", "2\n"], ["5 2\n2\n3\n3\n9\n4", "2\n"], ["5 2\n6\n0\n3\n9\n6", "1\n"], ["5 0\n6\n0\n3\n5\n4", "0\n"], ["5 2\n3\n3\n3\n9\n4", "2\n"], ["5 2\n6\n3\n3\n9\n4", "2\n"], ["5 2\n6\n3\n3\n9\n6", "2\n"], ["5 2\n0\n3\n3\n9\n4", "1\n"], ["5 2\n2\n3\n3\n9\n3", "2\n"], ["5 2\n6\n3\n3\n7\n4", "2\n"], ["5 2\n...
1
{"source": "deepcoder/primeintellect", "upstream_id": "primeintellect/train-00003-of-00005.parquet#2999"}
27fe2f29c5ff23c4
A plurality of trampolines are arranged in a line at 10 m intervals. Each trampoline has its own maximum horizontal distance within which the jumper can jump safely. Starting from the left-most trampoline, the jumper jumps to another trampoline within the allowed jumping range. The jumper wants to repeat jumping until ...
[["4\n20\n51\n1\n20", "yes\n"], ["4\n20\n5\n17\n1", "no\n"], ["3\n12\n5\n10", "no\n"], ["4\n37\n51\n1\n20", "yes\n"], ["4\n20\n5\n5\n1", "no\n"], ["3\n20\n5\n10", "no\n"], ["4\n54\n51\n1\n20", "yes\n"], ["4\n35\n5\n5\n1", "no\n"], ["3\n20\n5\n5", "no\n"], ["4\n84\n51\n1\n20", "yes\n"], ["4\n29\n5\n5\n1", "no\n"], ["3\n...
1
{"source": "deepcoder/taco", "upstream_id": "taco/train-00001-of-00004.parquet#748"}
27ff814e1197c111
Folding a Ribbon Think of repetitively folding a very long and thin ribbon. First, the ribbon is spread out from left to right, then it is creased at its center, and one half of the ribbon is laid over the other. You can either fold it from the left to the right, picking up the left end of the ribbon and laying it ove...
[["3 3 2\n12 578 1435\n59 471605241352156968 431565444592236940\n0 0 0", "LRR\nLRLRRRLRLLRR\nLRRRLRRLLRRRRLLLLRLLRRRLRRLLRLLLLLLRLRLLRLRLLLRLRLLRLLRRRLL\n"], ["3 3 2\n12 578 1954\n59 471605241352156968 431565444592236940\n0 0 0", "LRR\nLRRRRRRLRLLL\nLRRRLRRLLRRRRLLLLRLLRRRLRRLLRLLLLLLRLRLLRLRLLLRLRLLRLLRRRLL\n"], ["3 3...
1
{"source": "deepcoder/taco", "upstream_id": "taco/train-00003-of-00004.parquet#1189"}
28039476e2aa7f09
You have a list of numbers from 1 to n written from left to right on the blackboard. You perform an algorithm consisting of several steps (steps are 1-indexed). On the i-th step you wipe the i-th number (considering only remaining numbers). You wipe the whole number (not one digit). <image> When there are less than ...
[["3\n3 1\n4 2\n69 6\n", "2\n4\n12\n"], ["1\n241139 1\n", "2\n"], ["1\n2441139 10\n", "20\n"], ["1\n2452199 2\n", "4\n"], ["1\n244139 1\n", "2\n"], ["1\n2451199 2\n", "4\n"], ["1\n244119 1\n", "2\n"], ["1\n2441139 12\n", "24\n"], ["1\n2441139 2\n", "4\n"], ["2\n1000000000 1\n1000000000 500000000\n", "2\n1000000000\n"],...
1
{"source": "deepcoder/primeintellect", "upstream_id": "primeintellect/train-00001-of-00005.parquet#1961"}
280c1b9ccb47b131
problem There are $ N $ islands numbered from $ 1 $ to $ N $. Each island has $ N-1 $ bridges, allowing any $ 2 $ island to move to each other across several bridges. Each bridge has durability, and the durability of the $ i $ th bridge given the input is $ w_i $. There are $ 1 $ treasures on each island, and you can ...
[["4 10 1 4\n1 2 52\n1 3 68\n3 4 79", "Yes\n"], ["4 10 1 4\n1 2 52\n1 3 0\n3 4 79", "No\n"], ["4 10 1 4\n1 2 52\n2 3 68\n3 4 79", "Yes\n"], ["4 10 1 4\n1 2 52\n1 3 68\n3 4 74", "Yes\n"], ["4 10 1 4\n1 2 52\n1 3 68\n3 4 17", "Yes\n"], ["4 10 1 4\n1 2 93\n1 3 68\n3 4 74", "Yes\n"], ["4 10 2 4\n1 2 52\n1 3 68\n3 4 17", "Y...
1
{"source": "deepcoder/taco", "upstream_id": "taco/train-00000-of-00004.parquet#141"}
28327ef3635b732e
Mishka has got n empty boxes. For every i (1 ≤ i ≤ n), i-th box is a cube with side length ai. Mishka can put a box i into another box j if the following conditions are met: * i-th box is not put into another box; * j-th box doesn't contain any other boxes; * box i is smaller than box j (ai < aj). Mishka ...
[["3\n1 2 3\n", "1\n"], ["4\n4 2 4 3\n", "2\n"], ["10\n58 58 58 58 58 58 58 58 58 58\n", "10\n"], ["8\n1 2 3 4 5 6 7 8\n", "1\n"], ["1\n2\n", "1\n"], ["1\n131\n", "1\n"], ["11\n1 1 1 1 1 1 1 1 1 1 1\n", "11\n"], ["10\n86 89 89 86 86 89 86 86 89 89\n", "5\n"], ["8\n1 1 1 1 1 1 1 1\n", "8\n"], ["1\n1\n", "1\n"], ["1\n5\n...
1
{"source": "deepcoder/primeintellect", "upstream_id": "primeintellect/train-00001-of-00005.parquet#245"}
2833a0b097cc9418
You manage 4 buildings, each of which has 3 floors, each of which consists of 10 rooms. Write a program which reads a sequence of tenant/leaver notices, and reports the number of tenants for each room. For each notice, you are given four integers b, f, r and v which represent that v persons entered to room r of fth fl...
[["3\n1 1 3 16\n3 2 2 7\n4 3 8 1", " 0 0 16 0 0 0 0 0 0 0\n 0 0 0 0 0 0 0 0 0 0\n 0 0 0 0 0 0 0 0 0 0\n####################\n 0 0 0 0 0 0 0 0 0 0\n 0 0 0 0 0 0 0 0 0 0\n 0 0 0 0 0 0 0 0 0 0\n####################\n 0 0 0 0 0 0 0 0 0 0\n 0 7 0 0 0 0 0 0 0 0\n 0 0 0 0 0 0 0 0 0 0\n####################\n 0 0 0 0 0 0 0 0 0 ...
1
{"source": "deepcoder/taco", "upstream_id": "taco/train-00002-of-00004.parquet#866"}
28424277df5b5469
The Travelling Salesman spends a lot of time travelling so he tends to get bored. To pass time, he likes to perform operations on numbers. One such operation is to take a positive integer x and reduce it to the number of bits set to 1 in the binary representation of x. For example for number 13 it's true that 13_10 = 1...
[["111111011\n2\n", "169\n"], ["10000000000000000000000000000000000000000000\n2\n", "79284496\n"], ["100000000000000000000100000000000010100100001001000010011101010\n3\n", "35190061\n"], ["101010110000\n3\n", "1563\n"], ["100\n6\n", "0\n"], ["10\n868\n", "0\n"], ["1\n0\n", "1\n"], ["101110011101100100010010101001010111...
1
{"source": "deepcoder/taco", "upstream_id": "taco/train-00001-of-00004.parquet#1850"}
2843fb4a006a8ee9
Dreamoon has a string s and a pattern string p. He first removes exactly x characters from s obtaining string s' as a result. Then he calculates $\operatorname{occ}(s^{\prime}, p)$ that is defined as the maximal number of non-overlapping substrings equal to p that can be found in s'. He wants to make this number as big...
[["aaaaa\naa\n", "2 2 1 1 0 0\n"], ["axbaxxb\nab\n", "0 1 1 2 1 1 0 0\n"], ["aabb\nab\n", "1 1 1 0 0\n"], ["aaaaaaaaaaaaaaa\na\n", "15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0\n"], ["aaaaaaaaaaa\nb\n", "0 0 0 0 0 0 0 0 0 0 0 0\n"], ["ababababababababa\naba\n", "4 4 4 4 4 4 3 3 3 2 2 2 1 1 1 0 0 0\n"], ["axxbaxxbaxxb\nab\n", ...
1
{"source": "deepcoder/taco", "upstream_id": "taco/train-00001-of-00004.parquet#346"}
284d37f2655a1a79
Training is indispensable for achieving good results at ICPC. Rabbit wants to win at ICPC, so he decided to practice today as well. Today's training is to gain dexterity that never mistypes by carefully stacking blocks. Since there are many building blocks, let's build a tall tower. There are N blocks, and the i-th (...
[["3\n10 40\n15 40\n20 30", "110\n"], ["4\n1 2\n3 3\n3 4\n4 1", "11\n"], ["3\n10 40\n15 40\n40 30", "120\n"], ["4\n1 2\n3 3\n3 7\n4 1", "12\n"], ["4\n2 2\n3 3\n3 7\n4 1", "13\n"], ["3\n10 40\n15 40\n20 32", "112\n"], ["4\n2 4\n3 3\n3 7\n4 1", "15\n"], ["3\n10 36\n15 40\n20 32", "108\n"], ["3\n10 42\n6 40\n20 32", "114\...
1
{"source": "deepcoder/taco", "upstream_id": "taco/train-00002-of-00004.parquet#1341"}
286416ba96cfa029
Leha somehow found an array consisting of n integers. Looking at it, he came up with a task. Two players play the game on the array. Players move one by one. The first player can choose for his move a subsegment of non-zero length with an odd sum of numbers and remove it from the array, after that the remaining parts a...
[["4\n1 3 2 3\n", "First\n"], ["2\n2 2\n", "Second\n"], ["4\n2 4 6 8\n", "Second\n"], ["5\n1 1 1 1 1\n", "First\n"], ["4\n720074544 345031254 849487632 80870826\n", "Second\n"], ["1\n0\n", "Second\n"], ["1\n999999999\n", "First\n"], ["2\n1 999999999\n", "First\n"], ["4\n3 3 4 4\n", "First\n"], ["2\n1 2\n", "First\n"], ...
1
{"source": "deepcoder/taco", "upstream_id": "taco/train-00001-of-00004.parquet#1265"}
287065ae26dacd25
Pasha got a very beautiful string s for his birthday, the string consists of lowercase Latin letters. The letters in the string are numbered from 1 to |s| from left to right, where |s| is the length of the given string. Pasha didn't like his present very much so he decided to change it. After his birthday Pasha spent ...
[["abcdef\n1\n2\n", "aedcbf\n"], ["vwxyz\n2\n2 2\n", "vwxyz\n"], ["abcdef\n3\n1 2 3\n", "fbdcea\n"], ["jc\n5\n1 1 1 1 1\n", "cj\n"], ["wljqgdlxyc\n13\n3 4 3 3 5 4 4 2 4 4 5 3 3\n", "wyjldgqxlc\n"], ["keicnqmuqinhsmtudqcilocxkbqgzhbkitmqwttdyoyvcbxincwjryzknubpacsngorexaldfurondbednowemnnlphhboycfavs\n2\n5 12\n", "keicc...
1
{"source": "deepcoder/taco", "upstream_id": "taco/train-00003-of-00004.parquet#904"}
2875ecb8d608832d
Two boys decided to compete in text typing on the site "Key races". During the competition, they have to type a text consisting of s characters. The first participant types one character in v_1 milliseconds and has ping t_1 milliseconds. The second participant types one character in v_2 milliseconds and has ping t_2 mi...
[["5 1 2 1 2\n", "First\n"], ["3 3 1 1 1\n", "Second\n"], ["4 5 3 1 5\n", "Friendship\n"], ["1000 1000 1000 1000 1000\n", "Friendship\n"], ["1 1 1 1 1\n", "Friendship\n"], ["8 8 1 1 1\n", "Second\n"], ["15 14 32 65 28\n", "First\n"], ["894 197 325 232 902\n", "First\n"], ["1 2 8 8 5\n", "Friendship\n"], ["37 261 207 1 ...
1
{"source": "deepcoder/taco", "upstream_id": "taco/train-00002-of-00004.parquet#263"}
28784c7889da21cb
Given are integers L and R. Find the number, modulo 10^9 + 7, of pairs of integers (x, y) (L \leq x \leq y \leq R) such that the remainder when y is divided by x is equal to y \mbox{ XOR } x. What is \mbox{ XOR }? The XOR of integers A and B, A \mbox{ XOR } B, is defined as follows: * When A \mbox{ XOR } B is writte...
[["2 3", "3"], ["10 100", "604"], ["1 1000000000000000000", "68038601"], ["3 3", "1\n"], ["10 110", "712\n"], ["1 1000000100000000000", "802094787\n"], ["3 0", "0\n"], ["10 111", "744\n"], ["4 110", "733\n"], ["4 100", "625\n"], ["6 110", "727\n"], ["6 111", "759\n"], ["5 111", "761\n"], ["9 111", "748\n"], ["16 111", ...
1
{"source": "deepcoder/primeintellect", "upstream_id": "primeintellect/train-00002-of-00005.parquet#2048"}
288ae444f4f87df6
Palindrome Problem Statement Find the number of palindromes closest to the integer n. Note that the non-negative integer x is the number of palindromes, which means that the character string in which x is expressed in decimal notation and the character string in which it is inverted are equal. For example, 0,7,33,10...
[["4", "4\n"], ["8", "8\n"], ["4752", "4774\n"], ["7", "7\n"], ["23", "22\n"], ["8517", "8558\n"], ["6", "6\n"], ["39", "44\n"], ["3483", "3443\n"], ["5", "5\n"], ["1868", "1881\n"], ["1", "1\n"], ["2667", "2662\n"], ["92", "88\n"], ["3332", "3333\n"], ["61", "66\n"], ["4989", "4994\n"], ["2", "2\n"], ["5975", "5995\n"...
1
{"source": "deepcoder/taco", "upstream_id": "taco/train-00000-of-00004.parquet#962"}
2895187122a29bda
Let's consider a table consisting of n rows and n columns. The cell located at the intersection of i-th row and j-th column contains number i × j. The rows and columns are numbered starting from 1. You are given a positive integer x. Your task is to count the number of cells in a table that contain number x. -----In...
[["10 5\n", "2\n"], ["6 12\n", "4\n"], ["5 13\n", "0\n"], ["1 1\n", "1\n"], ["2 1\n", "1\n"], ["100000 1\n", "1\n"], ["1 1000000000\n", "0\n"], ["100000 1000000000\n", "16\n"], ["100000 362880\n", "154\n"], ["1 4\n", "0\n"], ["9 12\n", "4\n"], ["10 123\n", "0\n"], ["9551 975275379\n", "0\n"], ["17286 948615687\n", "0\n...
1
{"source": "deepcoder/taco", "upstream_id": "taco/train-00002-of-00004.parquet#300"}
289c67f790615be9
Little town Nsk consists of n junctions connected by m bidirectional roads. Each road connects two distinct junctions and no two roads connect the same pair of junctions. It is possible to get from any junction to any other junction by these roads. The distance between two junctions is equal to the minimum possible num...
[["5 4 1 5\n1 2\n2 3\n3 4\n4 5\n", "0\n"], ["5 4 3 5\n1 2\n2 3\n3 4\n4 5\n", "5\n"], ["5 6 1 5\n1 2\n1 3\n1 4\n4 5\n3 5\n2 5\n", "3\n"], ["2 1 2 1\n1 2\n", "0\n"], ["3 2 2 3\n1 2\n2 3\n", "1\n"], ["3 2 1 3\n1 2\n2 3\n", "0\n"], ["3 3 2 3\n1 2\n2 3\n1 3\n", "0\n"], ["3 3 2 3\n1 2\n2 3\n1 3\n", "0\n"], ["2 1 2 1\n1 2\n",...
1
{"source": "deepcoder/taco", "upstream_id": "taco/train-00000-of-00004.parquet#416"}
289fe222d49dd5f1
You gave the twins Ai and Zu a program of games using strings. In this game, Ai and Zu each select a substring from the character string, compare them, and the person who chooses the smaller one will get points. The two competed and played the game many times. However, I got tired of playing games for the same string m...
[["13\naizualgorithm\n9\ncomp 1 1 4 5\ncomp 2 6 1 5\nset 15 12 b\ncomp 9 9 10 10\ncomp 5 8 1 4\nset 1 10 z\nset 11 13 x\ncomp 8 10 1 5\ncomp 1 5 1 5", "s\nt\nt\nt\ns\ne\n"], ["13\naizualgorithm\n9\ncomp 1 1 4 5\ncomp 2 6 1 5\nset 9 12 b\ncomp 9 9 10 10\ncomp 5 8 1 4\nset 1 10 z\nset 11 6 x\ncomp 8 10 1 5\ncomp 1 5 1 5"...
1
{"source": "deepcoder/taco", "upstream_id": "taco/train-00000-of-00004.parquet#1411"}
28abffcc70c5b989
Iahub and Sorin are the best competitive programmers in their town. However, they can't both qualify to an important contest. The selection will be made with the help of a single problem. Blatnatalag, a friend of Iahub, managed to get hold of the problem before the contest. Because he wants to make sure Iahub will be t...
[["4\n1 0 0 -1\n", "1\n"], ["2\n1 -1\n", "2\n"], ["100\n-57 -64 83 76 80 27 60 76 -80 -56 52 72 -17 92 -96 87 41 -88 94 89 12 42 36 34 -100 -43 -42 62 3 87 -69 -6 -27 -59 -7 5 -90 -23 63 -87 -60 -92 -40 54 -16 -47 67 -64 10 33 -19 53 -7 -62 16 -74 -36 4 -75 -55 92 3 -22 43 -30 48 -27 88 -58 41 36 8 -40 -30 -18 16 22 -6...
1
{"source": "deepcoder/taco", "upstream_id": "taco/train-00003-of-00004.parquet#907"}
28b02219c55480eb
Billy investigates the question of applying greedy algorithm to different spheres of life. At the moment he is studying the application of greedy algorithm to the problem about change. There is an amount of n coins of different face values, and the coins of each value are not limited in number. The task is to collect t...
[["9\n487264 453898 452366 383095 172725 168148 164570 141228 1\n", "282456\n"], ["28\n434419 433070 431479 424448 423449 392416 368998 367310 329030 316399 311541 302510 283863 262469 257928 248272 242310 217371 183364 172064 164154 131734 131169 117466 23544 19990 11006 1\n", "22012\n"], ["58\n3000000 2511334 2511333...
1
{"source": "deepcoder/taco", "upstream_id": "taco/train-00001-of-00004.parquet#1637"}
28b0ea810cfe05f9
<!-- Problem B --> On-Screen Keyboard You are to input a string with an OSK (on-screen keyboard). A remote control with five buttons, four arrows and an OK (Fig. B-1), is used for the OSK. Find the minimum number of button presses required to input a given string with the given OSK. <image> Fig. B-1 Remote control...
[["3 9\nABCDEFGHI\nJKLMNOPQR\nSTUVWXYZ_\nICPC\n5 11\n___________\n____A______\n________M__\n___________\n_C_________\nACM\n4 21\n1_2_3_4_5_6_7_8_9_0_-\nQqWwEeRrTtYyUuIiOoPp@\nAaSsDdFfGgHhJjKkLl;^:\nZzXxCcVvBbNnMm,_._/__\nICPC2019,AsiaYokohamaRegional,QualificationRound\n0 0", "28\n23\n493\n"], ["3 9\nABCDEFGHI\nJKLMNOP...
1
{"source": "deepcoder/taco", "upstream_id": "taco/train-00000-of-00004.parquet#1762"}
28c030e3b3b88d61
If you draw a few infinitely long straight lines on an infinitely wide plane, this plane will be divided into several areas. For example, if you draw a straight line, the plane will be divided into two areas. Even if you draw the same number of straight lines, the number of areas obtained will differ depending on how y...
[["1\n5", "2\n16\n"], ["1\n0", "2\n1\n"], ["1\n1", "2\n2\n"], ["1\n2", "2\n4\n"], ["1\n4", "2\n11\n"], ["1\n8", "2\n37\n"], ["1\n13", "2\n92\n"], ["1\n6", "2\n22\n"], ["1\n25", "2\n326\n"], ["1\n9", "2\n46\n"], ["1\n45", "2\n1036\n"], ["1\n14", "2\n106\n"], ["1\n24", "2\n301\n"], ["1\n27", "2\n379\n"], ["1\n12", "2\n79...
1
{"source": "deepcoder/taco", "upstream_id": "taco/train-00002-of-00004.parquet#795"}
28c868cc603393d1
Vasya goes to visit his classmate Petya. Vasya knows that Petya's apartment number is $n$. There is only one entrance in Petya's house and the distribution of apartments is the following: the first floor contains $2$ apartments, every other floor contains $x$ apartments each. Apartments are numbered starting from one...
[["4\n7 3\n1 5\n22 5\n987 13\n", "3\n1\n5\n77\n"], ["7\n7 3\n1 5\n22 5\n987 13\n7 3\n1 5\n22 5\n", "3\n1\n5\n77\n3\n1\n5\n"], ["7\n7 3\n1 5\n22 5\n987 13\n7 3\n1 5\n22 5\n", "3\n1\n5\n77\n3\n1\n5\n"], ["7\n7 3\n1 5\n12 5\n987 13\n7 3\n1 5\n22 5\n", "3\n1\n3\n77\n3\n1\n5\n"], ["4\n8 3\n1 5\n22 5\n987 13\n", "3\n1\n5\n77...
1
{"source": "deepcoder/taco", "upstream_id": "taco/train-00001-of-00004.parquet#1837"}
28c8caa843d4989d
There are N people standing on the x-axis. Let the coordinate of Person i be x_i. For every i, x_i is an integer between 0 and 10^9 (inclusive). It is possible that more than one person is standing at the same coordinate. You will given M pieces of information regarding the positions of these people. The i-th piece of...
[["000 0", "Yes\n"], ["10 3\n8 7 000\n7 9 100\n9 8 100", "No\n"], ["4 3\n2 1 1\n2 3 3\n3 4 2", "Yes\n"], ["10 3\n8 7 000\n7 9 110\n9 8 100", "No\n"], ["4 3\n1 1 1\n2 3 3\n3 4 2", "No\n"], ["10 3\n9 7 000\n7 9 110\n9 8 100", "No\n"], ["4 3\n1 1 1\n2 3 3\n4 4 2", "No\n"], ["10 3\n9 2 000\n7 9 110\n9 8 100", "Yes\n"], ["4...
1
{"source": "deepcoder/taco", "upstream_id": "taco/train-00002-of-00004.parquet#1788"}
28ccf498e18a7f59
A dice is a cube, its faces contain distinct integers from 1 to 6 as black points. The sum of numbers at the opposite dice faces always equals 7. Please note that there are only two dice (these dices are mirror of each other) that satisfy the given constraints (both of them are shown on the picture on the left). <imag...
[["2\n4\n2 6\n5 4\n", "NO\n"], ["96\n4\n1 5\n5 1\n6 5\n2 1\n2 1\n2 6\n6 5\n6 5\n6 2\n2 6\n1 5\n6 5\n1 5\n2 6\n6 5\n5 6\n2 1\n2 6\n1 2\n1 5\n2 6\n2 6\n2 1\n1 5\n5 1\n1 2\n2 6\n2 6\n6 5\n1 5\n2 1\n2 6\n1 2\n5 6\n1 5\n2 6\n6 2\n2 6\n6 5\n1 5\n6 5\n6 5\n1 5\n5 1\n6 2\n5 1\n5 1\n1 5\n2 6\n5 1\n1 5\n2 1\n1 2\n6 2\n6 2\n5 6\n...
1
{"source": "deepcoder/taco", "upstream_id": "taco/train-00000-of-00004.parquet#1676"}
28cd3670f3664a5b
The king Copa often has been reported about the Codeforces site, which is rapidly getting more and more popular among the brightest minds of the humanity, who are using it for training and competing. Recently Copa understood that to conquer the world he needs to organize the world Codeforces tournament. He hopes that a...
[["02.05.90\n08.03.50\n", "YES\n"], ["29.02.80\n29.02.60\n", "YES\n"], ["15.12.62\n17.12.21\n", "YES\n"], ["08.07.20\n27.01.01\n", "YES\n"], ["09.05.55\n25.09.42\n", "NO\n"], ["28.02.20\n11.01.29\n", "YES\n"], ["06.08.91\n05.12.73\n", "YES\n"], ["31.05.20\n02.12.04\n", "YES\n"], ["31.10.41\n27.12.13\n", "YES\n"], ["12....
1
{"source": "deepcoder/taco", "upstream_id": "taco/train-00002-of-00004.parquet#1806"}
28da2907ee748563
There are n lights aligned in a row. These lights are numbered 1 to n from left to right. Initially some of the lights are switched on. Shaass wants to switch all the lights on. At each step he can switch a light on (this light should be switched off at that moment) if there's at least one adjacent light which is alrea...
[["3 1\n1\n", "1\n"], ["4 2\n1 4\n", "2\n"], ["11 2\n4 8\n", "6720\n"], ["4 2\n1 3\n", "2\n"], ["4 4\n1 2 3 4\n", "1\n"], ["4 2\n1 3\n", "2\n"], ["4 4\n1 2 3 4\n", "1\n"], ["1000 3\n100 900 10\n", "727202008\n"], ["74 13\n6 14 19 20 21 24 30 43 58 61 69 70 73\n", "16623551\n"], ["74 13\n6 14 19 20 21 24 30 43 58 61 69 ...
1
{"source": "deepcoder/taco", "upstream_id": "taco/train-00003-of-00004.parquet#230"}
28e84b351d4828a2
A substring of some string is called the most frequent, if the number of its occurrences is not less than number of occurrences of any other substring. You are given a set of strings. A string (not necessarily from this set) is called good if all elements of the set are the most frequent substrings of this string. Res...
[["4\nmail\nai\nlru\ncf\n", "cfmailru\n"], ["3\nkek\npreceq\ncheburek\n", "NO\n"], ["1\nz\n", "z\n"], ["2\nab\nba\n", "NO\n"], ["2\nac\nbc\n", "NO\n"], ["2\ncd\nce\n", "NO\n"], ["2\nca\ncb\n", "NO\n"], ["2\ndc\nec\n", "NO\n"], ["26\nhw\nwb\nba\nax\nxl\nle\neo\nod\ndj\njt\ntm\nmq\nqf\nfk\nkn\nny\nyz\nzr\nrg\ngv\nvc\ncs\...
1
{"source": "deepcoder/taco", "upstream_id": "taco/train-00001-of-00004.parquet#1073"}
28e9fe26ef91048e
The athletics competition 200M semi-final three races were held. Eight players (24 players in total) will participate in each group. A total of eight players, including the top two players in each group and the top two players from all the players in each group who are third or lower, will advance to the final. Create...
[["18 25.46\n16 26.23\n3 23.00\n10 24.79\n5 22.88\n11 23.87\n19 23.90\n1 25.11\n23 23.88\n4 23.46\n7 24.12\n12 22.91\n13 21.99\n14 22.86\n21 23.12\n9 24.09\n17 22.51\n22 23.49\n6 23.02\n20 22.23\n8 21.89\n15 24.14\n8 23.77\n2 23.42", "5 22.88\n3 23.00\n13 21.99\n14 22.86\n8 21.89\n20 22.23\n17 22.51\n12 22.91\n"], ["18...
1
{"source": "deepcoder/taco", "upstream_id": "taco/train-00001-of-00004.parquet#1139"}
28eccab83fcf8c4c
Some time ago Leonid have known about idempotent functions. Idempotent function defined on a set {1, 2, ..., n} is such function $g : \{1,2, \ldots, n \} \rightarrow \{1,2, \ldots, n \}$, that for any $x \in \{1,2, \ldots, n \}$ the formula g(g(x)) = g(x) holds. Let's denote as f^{(}k)(x) the function f applied k time...
[["4\n1 2 2 4\n", "1\n"], ["3\n2 3 3\n", "2\n"], ["3\n2 3 1\n", "3\n"], ["1\n1\n", "1\n"], ["16\n1 4 13 9 11 16 14 6 5 12 7 8 15 2 3 10\n", "105\n"], ["20\n1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20\n", "1\n"], ["20\n11 14 2 10 17 5 9 6 18 3 17 7 4 15 17 1 4 14 10 11\n", "7\n"], ["100\n46 7 63 48 75 82 85 90 65...
1
{"source": "deepcoder/taco", "upstream_id": "taco/train-00002-of-00004.parquet#1449"}
28f589b179e18b2a
Gildong has an interesting machine that has an array a with n integers. The machine supports two kinds of operations: 1. Increase all elements of a suffix of the array by 1. 2. Decrease all elements of a suffix of the array by 1. A suffix is a subsegment (contiguous elements) of the array that contains a_n. I...
[["7\n2\n1 1\n3\n-1 0 2\n4\n99 96 97 95\n4\n-3 -5 -2 1\n6\n1 4 3 2 4 1\n5\n5 0 0 0 5\n9\n-367741579 319422997 -415264583 -125558838 -300860379 420848004 294512916 -383235489 425814447\n", "\n0\n1\n3\n4\n6\n5\n2847372102\n"], ["1\n2\n9 -10\n", "0\n"], ["1\n2\n9 -7\n", "0\n"], ["7\n2\n1 1\n3\n-1 0 2\n4\n110 96 97 95\n4\n...
1
{"source": "deepcoder/primeintellect", "upstream_id": "primeintellect/train-00001-of-00005.parquet#1127"}
290f185a16b5c9f3
We have N bulbs arranged on a number line, numbered 1 to N from left to right. Bulb i is at coordinate i. Each bulb has a non-negative integer parameter called intensity. When there is a bulb of intensity d at coordinate x, the bulb illuminates the segment from coordinate x-d-0.5 to x+d+0.5. Initially, the intensity o...
[["5 1\n0 0 0 1 0", "1 1 2 1 2\n"], ["5 2\n0 0 0 1 0", "3 3 4 3 3\n"], ["5 2\n0 0 0 0 0", "2 3 3 3 2\n"], ["5 2\n1 0 0 0 0", "2 3 3 4 2\n"], ["5 2\n0 0 0 0 1", "2 4 3 3 2\n"], ["5 0\n0 0 0 0 1", "0 0 0 0 1\n"], ["5 2\n1 0 0 2 0", "3 3 4 4 4\n"], ["5 2\n0 0 0 2 0", "3 3 4 4 3\n"], ["5 3\n0 0 0 0 0", "4 4 5 4 4\n"], ["5 ...
1
{"source": "deepcoder/taco", "upstream_id": "taco/train-00002-of-00004.parquet#1047"}
2929b54712aceae4
You've got array a[1], a[2], ..., a[n], consisting of n integers. Count the number of ways to split all the elements of the array into three contiguous parts so that the sum of elements in each part is the same. More formally, you need to find the number of such pairs of indices i, j (2 ≤ i ≤ j ≤ n - 1), that $\sum_{...
[["5\n1 2 3 0 3\n", "2\n"], ["4\n0 1 -1 0\n", "1\n"], ["2\n4 1\n", "0\n"], ["9\n0 0 0 0 0 0 0 0 0\n", "28\n"], ["10\n2 5 -2 2 -3 -2 3 5 -5 -2\n", "0\n"], ["1\n1\n", "0\n"], ["3\n1 2 3\n", "0\n"], ["100\n1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0...
1
{"source": "deepcoder/primeintellect", "upstream_id": "primeintellect/train-00000-of-00005.parquet#1320"}
293fcf3409ddc5a1
This morning, Roman woke up and opened the browser with $n$ opened tabs numbered from $1$ to $n$. There are two kinds of tabs: those with the information required for the test and those with social network sites. Roman decided that there are too many tabs open so he wants to close some of them. He decided to accomplis...
[["4 2\n1 1 -1 1\n", "2\n"], ["14 3\n-1 1 -1 -1 1 -1 -1 1 -1 -1 1 -1 -1 1\n", "9\n"], ["4 2\n1 1 1 -1\n", "2\n"], ["4 2\n-1 1 -1 -1\n", "2\n"], ["3 2\n1 1 -1\n", "1\n"], ["20 2\n-1 1 -1 1 -1 -1 -1 1 -1 -1 -1 1 -1 -1 1 -1 -1 -1 1 1\n", "6\n"], ["20 19\n-1 -1 1 1 -1 1 1 -1 1 1 -1 1 -1 1 1 1 -1 1 -1 1\n", "5\n"], ["20 7\n...
1
{"source": "deepcoder/taco", "upstream_id": "taco/train-00001-of-00004.parquet#640"}
294821c99408f13d
A large banner with word CODEFORCES was ordered for the 1000-th onsite round of Codeforces^{ω} that takes place on the Miami beach. Unfortunately, the company that made the banner mixed up two orders and delivered somebody else's banner that contains someone else's word. The word on the banner consists only of upper-ca...
[["CODEWAITFORITFORCES\n", "YES\n"], ["BOTTOMCODER\n", "NO\n"], ["DECODEFORCES\n", "YES\n"], ["DOGEFORCES\n", "NO\n"], ["ABACABA\n", "NO\n"], ["CODEFORCE\n", "NO\n"], ["C\n", "NO\n"], ["NQTSMZEBLY\n", "NO\n"], ["CODEFZORCES\n", "YES\n"], ["EDYKHVZCNTLJUUOQGHPTIOETQNFLLWEKZOHIUAXELGECABVSBIBGQODQXVYFKBYJWTGBYHVSSNTINKWS...
1
{"source": "deepcoder/taco", "upstream_id": "taco/train-00002-of-00004.parquet#75"}
295b97add8e46cb1
For a given array $a_1, a_2, a_3, ... , a_N$ of $N$ elements and $Q$ integers $x_i$ as queries, for each query, print the number of combinations of two integers $(l, r)$ which satisfies the condition: $1 \leq l \leq r \leq N$ and $a_l + a_{l+1} + ... + a_{r-1} + a_r \leq x_i$. Constraints * $1 \leq N \leq 10^5$ * $1 ...
[["6 5\n1 2 3 4 7 6\n6 9 12 21 15", "8\n11\n13\n19\n15\n"], ["6 5\n1 2 3 2 7 6\n6 9 12 21 15", "9\n13\n14\n21\n18\n"], ["6 5\n1 2 3 2 7 6\n6 12 12 21 15", "9\n14\n14\n21\n18\n"], ["6 5\n1 2 3 2 7 6\n0 12 12 21 15", "0\n14\n14\n21\n18\n"], ["6 5\n1 2 3 5 5 6\n6 9 12 21 15", "9\n10\n14\n20\n16\n"], ["6 5\n1 2 3 4 7 6\n6 ...
1
{"source": "deepcoder/taco", "upstream_id": "taco/train-00003-of-00004.parquet#911"}
295f885ccc5a936a
Pak 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 onto card $p_i$ ($p_i < i$). In the very beginning, Pak Chanek must write one integer number on e...
[["6\n1 2 1 4 2\n", "4\n"], ["2\n1\n", "2\n"], ["15\n1 1 2 2 3 4 4 5 6 7 7 8 9 10\n", "11\n"], ["7\n1 1 3 3 5 5\n", "4\n"], ["8\n1 1 3 3 5 5 7\n", "5\n"]]
1
{"source": "deepcoder/primeintellect", "upstream_id": "primeintellect/train-00003-of-00005.parquet#2257"}
296eb6a8678c3c0b
After their adventure with the magic mirror Kay and Gerda have returned home and sometimes give free ice cream to kids in the summer. At the start of the day they have x ice cream packs. Since the ice cream is free, people start standing in the queue before Kay and Gerda's house even in the night. Each person in the q...
[["5 7\n+ 5\n- 10\n- 20\n+ 40\n- 20\n", "22 1\n"], ["5 17\n- 16\n- 2\n- 98\n+ 100\n- 98\n", "3 2\n"], ["6 1000000000\n+ 1000000000\n+ 1000000000\n+ 1000000000\n+ 1000000000\n+ 1000000000\n+ 1000000000\n", "7000000000 0\n"], ["5 12\n- 12\n+ 7\n- 6\n- 1\n+ 46\n", "46 0\n"], ["11 1000\n- 100\n+ 100\n+ 100\n+ 100\n+ 100\n-...
1
{"source": "deepcoder/taco", "upstream_id": "taco/train-00003-of-00004.parquet#1821"}
296f2a9c2a22b868
The educational program (AHK Education) of the Aiz Broadcasting Association broadcasts a handicraft program for children, "Play with Tsukuro". Today is the time to make a rectangle with sticks, but I would like to see if I can make a rectangle using the four sticks I prepared. However, the stick must not be cut or brok...
[["0 1 2 2", "no\n"], ["0 0 2 2", "yes\n"], ["0 4 4 10", "no\n"], ["2 0 1 2", "no\n"], ["1 1 0 4", "no\n"], ["-1 1 2 2", "no\n"], ["1 4 4 10", "no\n"], ["2 0 2 2", "no\n"], ["1 1 0 6", "no\n"], ["-1 4 4 10", "no\n"], ["2 0 2 4", "no\n"], ["0 1 0 6", "no\n"], ["-1 0 2 2", "no\n"], ["-1 1 4 10", "no\n"], ["2 0 3 4", "no\...
1
{"source": "deepcoder/taco", "upstream_id": "taco/train-00003-of-00004.parquet#1451"}
2978b3cf23281d2e
The only difference between easy and hard versions is the constraints. Vova likes pictures with kittens. The news feed in the social network he uses can be represented as an array of $n$ consecutive pictures (with kittens, of course). Vova likes all these pictures, but some are more beautiful than the others: the $i$-...
[["5 2 3\n5 1 3 10 1\n", "18\n"], ["6 1 5\n10 30 30 70 10 10\n", "-1\n"], ["4 3 1\n1 100 1 1\n", "100\n"], ["10 8 2\n842853295 227407393 999938308 145896203 715701127 207783929 574007784 731415993 466538642 880026774\n", "1879965082\n"], ["9 3 4\n397498491 235015416 20938619 357998172 883949649 813139123 596681571 7166...
1
{"source": "deepcoder/taco", "upstream_id": "taco/train-00000-of-00004.parquet#780"}
29797a69901f9884
You are given two arrays $a$ and $b$, each consisting of $n$ positive integers, and an integer $x$. Please determine if one can rearrange the elements of $b$ so that $a_i + b_i \leq x$ holds for each $i$ ($1 \le i \le n$). -----Input----- The first line of input contains one integer $t$ ($1 \leq t \leq 100$) — the n...
[["4\n3 4\n1 2 3\n1 1 2\n\n2 6\n1 4\n2 5\n\n4 4\n1 2 3 4\n1 2 3 4\n\n1 5\n5\n5\n", "Yes\nYes\nNo\nNo\n"], ["1\n1 1\n1\n1\n", "No\n"], ["1\n1 1\n1\n1\n", "NO\n"], ["1\n1 5\n1\n1\n", "YES\n"], ["1\n1 1\n0\n1\n", "Yes\n"], ["1\n1 0\n0\n1\n", "No\n"], ["4\n3 4\n0 2 3\n1 1 2\n\n2 6\n1 4\n2 5\n\n4 4\n1 2 3 4\n1 2 3 4\n\n1 5\...
1
{"source": "deepcoder/primeintellect", "upstream_id": "primeintellect/train-00003-of-00005.parquet#2234"}
2996e68e5c83f7f5
You have N coins each of which has a value ai. Find the number of combinations that result when you choose K different coins in such a way that the total value of the coins is greater than or equal to L and less than or equal to R. Constraints * 1 ≤ K ≤ N ≤ 40 * 1 ≤ ai ≤ 1016 * 1 ≤ L ≤ R ≤ 1016 * All input values are...
[["5 2 7 19\n6 5 4 2 2", "7\n"], ["2 2 2 9\n5 1", "1\n"], ["5 2 7 19\n2 5 4 2 2", "4\n"], ["2 2 2 9\n9 1", "0\n"], ["5 4 7 19\n2 5 4 2 2", "5\n"], ["5 2 7 19\n3 5 4 2 3", "6\n"], ["5 3 7 19\n6 5 1 2 2", "9\n"], ["5 4 7 19\n1 5 1 2 -1", "3\n"], ["5 3 7 17\n0 5 4 2 3", "8\n"], ["2 1 1 9\n6 1", "2\n"], ["2 2 2 9\n9 2", "0...
1
{"source": "deepcoder/taco", "upstream_id": "taco/train-00001-of-00004.parquet#881"}
299853f12bb36bb5
Given a complete binary tree with the height of H, we index the nodes respectively top-down and left-right from 1. The i-th node stores a positive integer V_{i}. Define P_{i} as follows: P_{i}=V_{i} if the i-th node is a leaf, otherwise P_{i}=max(V_{i}*P_{L}, V_{i}*P_{R}), where L and R are the indices of the left and ...
[["2\n1 2 3\n3\n3 1 5 2 6 4 7\n0", "3\n105"], ["2\n1 2 3\n3\n3 1 1 2 6 4 7\n0", "3\n21\n"], ["2\n1 2 3\n3\n3 1 1 2 6 1 8\n0", "3\n24\n"], ["2\n1 2 1\n3\n3 1 1 2 3 1 8\n0", "2\n24\n"], ["2\n1 2 3\n3\n3 1 5 2 12 4 7\n0", "3\n105\n"], ["2\n1 2 3\n3\n3 2 1 2 6 1 7\n0", "3\n36\n"], ["2\n1 2 1\n3\n4 1 1 2 3 1 8\n0", "2\n32\n...
1
{"source": "deepcoder/taco", "upstream_id": "taco/train-00002-of-00004.parquet#960"}