problem_id stringlengths 6 9 | task_type stringclasses 1
value | prompt stringlengths 29 7.23k | verification_info stringlengths 160 78.7M |
|---|---|---|---|
taco_7400 | deepcoder | You are given an array $a$ of length $n$ consisting of integers. You can apply the following operation, consisting of several steps, on the array $a$ zero or more times:
you select two different numbers in the array $a_i$ and $a_j$;
you remove $i$-th and $j$-th elements from the array.
For example, if $n=6$ and $a=[... | {"ground_truth": "{\"inputs\": [\"5\\n6\\n1 6 1 1 4 4\\n2\\n1 2\\n2\\n1 1\\n5\\n4 5 4 5 4\\n6\\n2 3 2 1 3 1\\n\", \"1\\n12\\n2 2 2 2 4 4 4 4 6 6 6 6\\n\", \"1\\n12\\n2 2 2 2 4 4 4 4 6 6 6 6\\n\", \"1\\n12\\n1 2 2 2 4 4 4 4 6 6 6 6\\n\", \"5\\n6\\n2 6 1 1 4 4\\n2\\n1 2\\n2\\n1 1\\n5\\n4 5 4 5 4\\n6\\n2 3 2 1 3 1\\n\", \... |
taco_7401 | deepcoder | You are given n patterns p_1, p_2, ..., p_n and m strings s_1, s_2, ..., s_m. Each pattern p_i consists of k characters that are either lowercase Latin letters or wildcard characters (denoted by underscores). All patterns are pairwise distinct. Each string s_j consists of k lowercase Latin letters.
A string a matches ... | {"ground_truth": "{\"inputs\": [\"10 10 3\\ncaa\\nc_c\\nba_\\naca\\nabb\\n_cc\\n_ba\\nbac\\nccb\\n_ab\\nabb 1\\ncca 8\\nacb 4\\ncbb 2\\nbaa 10\\nbba 8\\nbca 1\\ncab 8\\naaa 2\\nccb 6\\n\", \"5 10 1\\n_\\nb\\nc\\nd\\na\\nc 2\\na 5\\nb 5\\nb 2\\nd 5\\na 3\\nd 5\\nc 2\\nb 2\\nd 2\\n\", \"5 5 3\\ncaa\\nabb\\ncbb\\naac\\ncb... |
taco_7402 | deepcoder | You are given a set of points on a straight line. Each point has a color assigned to it. For point a, its neighbors are the points which don't have any other points between them and a. Each point has at most two neighbors - one from the left and one from the right.
You perform a sequence of operations on this set of p... | {"ground_truth": "{\"inputs\": [\"aabb\\n\", \"aabcaa\\n\", \"abbcccbba\\n\", \"aaaaaaaaaaa\\n\", \"aaaaaaaaabbbbbaaaabaaaaaaaaaaaaaaaaabaaaaaabbbbbbbaaabbbbbbbbbbbbbbbbbbbbbaaaaaaaaaaaaaaaaaaaaaaaaaa\\n\", \"abc\\n\", \"a\\n\", \"ab\\n\", \"ba\\n\", \"aaabbb\\n\", \"abababababab\\n\", \"aaabbbbbbaaa\\n\", \"bbbbbbbbbb... |
taco_7403 | deepcoder | Given is a positive integer N.
We will choose an integer K between 2 and N (inclusive), then we will repeat the operation below until N becomes less than K.
- Operation: if K divides N, replace N with N/K; otherwise, replace N with N-K.
In how many choices of K will N become 1 in the end?
-----Constraints-----
- 2 \... | {"ground_truth": "{\"inputs\": [\"6\\n\", \"3141\\n\", \"314159265358\\n\", \"1000000000000\\n\", \"642507465600\\n\", \"2\\n\", \"4294967296\\n\", \"260522\\n\", \"914575\\n\", \"436426\\n\", \"540024979445\\n\", \"917861648772\\n\", \"962623690081\\n\", \"523968956449\\n\", \"145329450841\\n\", \"2106351025\\n\", \"1... |
taco_7404 | deepcoder | During a New Year special offer the "Sudislavl Bars" offered n promo codes. Each promo code consists of exactly six digits and gives right to one free cocktail at the bar "Mosquito Shelter". Of course, all the promocodes differ.
As the "Mosquito Shelter" opens only at 9, and partying in Sudislavl usually begins at as ... | {"ground_truth": "{\"inputs\": [\"2\\n000000\\n999999\\n\", \"6\\n211111\\n212111\\n222111\\n111111\\n112111\\n121111\\n\", \"1\\n123456\\n\", \"2\\n000000\\n099999\\n\", \"2\\n000000\\n009999\\n\", \"2\\n000000\\n000999\\n\", \"2\\n000000\\n000099\\n\", \"2\\n000000\\n000009\\n\", \"1\\n000000\\n\", \"1\\n999999\\n\",... |
taco_7405 | deepcoder | For a given sequence $A = \\{a_0, a_1, ..., a_{n-1}\\}$ which is sorted by ascending order, find a specific value $k$ given as a query.
Constraints
* $1 \leq n \leq 100,000$
* $1 \leq q \leq 200,000$
* $0 \leq a_0 \leq a_1 \leq ... \leq a_{n-1} \leq 1,000,000,000$
* $0 \leq k_i \leq 1,000,000,000$
Input
The input i... | {"ground_truth": "{\"inputs\": [\"4\\n1 2 2 4\\n3\\n2\\n3\\n6\", \"4\\n1 1 2 4\\n3\\n0\\n3\\n8\", \"4\\n0 1 2 7\\n3\\n0\\n7\\n10\", \"4\\n0 1 2 6\\n3\\n0\\n3\\n6\", \"4\\n1 2 1 4\\n2\\n0\\n3\\n8\", \"4\\n0 1 2 7\\n1\\n0\\n5\\n3\", \"4\\n0 2 3 4\\n3\\n2\\n3\\n4\", \"4\\n0 1 2 7\\n1\\n-1\\n5\\n3\", \"4\\n0 2 1 3\\n3\\n-1... |
taco_7406 | deepcoder | Squirrel Liss is interested in sequences. She also has preferences of integers. She thinks n integers a1, a2, ..., an are good.
Now she is interested in good sequences. A sequence x1, x2, ..., xk is called good if it satisfies the following three conditions:
* The sequence is strictly increasing, i.e. xi < xi + 1 f... | {"ground_truth": "{\"inputs\": [\"2\\n1009 2018\\n\", \"7\\n1 2 3 4 7 9 10\\n\", \"2\\n601 1202\\n\", \"8\\n3 4 5 6 7 8 9 10\\n\", \"2\\n5101 10202\\n\", \"3\\n21 67 243\\n\", \"5\\n2 3 7 9 10\\n\", \"1\\n99991\\n\", \"3\\n1 4 7\\n\", \"3\\n3 14 22\\n\", \"10\\n2 4 8 67 128 324 789 1296 39877 98383\\n\", \"10\\n2 3 45 ... |
taco_7407 | deepcoder | Polycarp knows that if the sum of the digits of a number is divisible by $3$, then the number itself is divisible by $3$. He assumes that the numbers, the sum of the digits of which is divisible by $4$, are also somewhat interesting. Thus, he considers a positive integer $n$ interesting if its sum of digits is divisibl... | {"ground_truth": "{\"inputs\": [\"432\\n\", \"99\\n\", \"237\\n\", \"42\\n\", \"1\\n\", \"2\\n\", \"1000\\n\", \"898\\n\", \"997\\n\", \"999\\n\", \"399\\n\", \"8\\n\", \"120\\n\", \"909\\n\", \"9\\n\", \"398\\n\", \"7\\n\", \"799\\n\", \"970\\n\", \"188\\n\", \"4\\n\", \"38\\n\", \"12\\n\", \"3\\n\", \"518\\n\", \"6\\... |
taco_7408 | deepcoder | Takahashi has A untasty cookies containing antidotes, B tasty cookies containing antidotes and C tasty cookies containing poison.
Eating a cookie containing poison results in a stomachache, and eating a cookie containing poison while having a stomachache results in a death. As he wants to live, he cannot eat one in su... | {"ground_truth": "{\"inputs\": [\"0 1 4\", \"14 8 1\", \"9 2 9\", \"0 0 4\", \"14 8 2\", \"3 2 9\", \"11 15 2\", \"11 15 4\", \"3 0 12\", \"0 2 0\", \"11 15 0\", \"0 0 0\", \"16 5 0\", \"-2 0 0\", \"3 1 27\", \"-1 1 -4\", \"6 -2 0\", \"-1 -2 0\", \"-2 -2 -1\", \"-4 -2 -1\", \"0 -2 -4\", \"0 -2 -6\", \"1 -8 7\", \"1 -10... |
taco_7409 | deepcoder | In the Kingdom of AtCoder, only banknotes are used as currency. There are 10^{100}+1 kinds of banknotes, with the values of 1, 10, 10^2, 10^3, \dots, 10^{(10^{100})}. You have come shopping at a mall and are now buying a takoyaki machine with a value of N. (Takoyaki is the name of a Japanese snack.)
To make the payment... | {"ground_truth": "{\"inputs\": [\"36\\n\", \"91\\n\", \"314159265358979323846264338327950288419716939937551058209749445923078164062862089986280348253421170\\n\", \"30\", \"476640020082194381531155118436783393866726953614433851622190777875571135215042541028243752681838573\", \"22\", \"41\", \"402419059500366785869358882... |
taco_7410 | deepcoder | Bob has a favorite number k and ai of length n. Now he asks you to answer m queries. Each query is given by a pair li and ri and asks you to count the number of pairs of integers i and j, such that l ≤ i ≤ j ≤ r and the xor of the numbers ai, ai + 1, ..., aj is equal to k.
Input
The first line of the input contains i... | {"ground_truth": "{\"inputs\": [\"6 2 4\\n1 2 1 1 0 3\\n1 6\\n3 5\\n\", \"5 3 1\\n0 1 1 1 1\\n1 5\\n2 4\\n1 3\\n\", \"6 2 3\\n1 4 1 1 0 3\\n1 6\\n3 5\\n\", \"5 3 1\\n0 1 1 1 1\\n1 5\\n2 4\\n1 2\\n\", \"5 3 0\\n0 1 1 1 1\\n1 5\\n2 4\\n1 2\\n\", \"6 2 4\\n1 2 1 1 1 5\\n1 6\\n3 5\\n\", \"5 3 1\\n0 1 2 1 1\\n1 5\\n2 4\\n1 ... |
taco_7411 | deepcoder | Let's denote a function $f(x)$ in such a way: we add $1$ to $x$, then, while there is at least one trailing zero in the resulting number, we remove that zero. For example, $f(599) = 6$: $599 + 1 = 600 \rightarrow 60 \rightarrow 6$; $f(7) = 8$: $7 + 1 = 8$; $f(9) = 1$: $9 + 1 = 10 \rightarrow 1$; $f(10099) = 101$: ... | {"ground_truth": "{\"inputs\": [\"1098\\n\", \"10\\n\", \"1000000000\\n\", \"1\\n\", \"9\\n\", \"10119\\n\", \"1337\\n\", \"51\\n\", \"99\\n\", \"79\\n\", \"29\\n\", \"633\\n\", \"9000\\n\", \"99999999\\n\", \"932415950\\n\", \"90\\n\", \"45\\n\", \"22\\n\", \"987654321\\n\", \"599\\n\", \"54\\n\", \"73180\\n\", \"9392... |
taco_7412 | deepcoder | Implement the function which should return `true` if given object is a vowel (meaning `a, e, i, o, u`), and `false` otherwise. | {"ground_truth": "{\"fn_name\": \"is_vowel\", \"inputs\": [[\"\"], [\"a\"], [\"E\"], [\"ou\"], [\"z\"], [\"lol\"]], \"outputs\": [[false], [true], [true], [false], [false], [false]]}", "dataset_type": "taco"} |
taco_7413 | deepcoder | Vasya's bicycle chain drive consists of two parts: n stars are attached to the pedal axle, m stars are attached to the rear wheel axle. The chain helps to rotate the rear wheel by transmitting the pedal rotation.
We know that the i-th star on the pedal axle has ai (0 < a1 < a2 < ... < an) teeth, and the j-th star on t... | {"ground_truth": "{\"inputs\": [\"1\\n1\\n2\\n1 2\\n\", \"50\\n17 20 22 28 36 38 46 47 48 50 52 57 58 62 63 69 70 74 75 78 79 81 82 86 87 90 93 95 103 202 292 442 1756 1769 2208 2311 2799 2957 3483 4280 4324 4932 5109 5204 6225 6354 6561 7136 8754 9670\\n40\\n68 214 957 1649 1940 2078 2134 2716 3492 3686 4462 4559 4656... |
taco_7414 | deepcoder | Consider the following process. You have a binary string (a string where each character is either 0 or 1) $w$ of length $n$ and an integer $x$. You build a new binary string $s$ consisting of $n$ characters. The $i$-th character of $s$ is chosen as follows:
if the character $w_{i-x}$ exists and is equal to 1, then $... | {"ground_truth": "{\"inputs\": [\"3\\n101110\\n2\\n01\\n1\\n110\\n1\\n\", \"3\\n100110\\n2\\n01\\n1\\n110\\n1\\n\", \"3\\n100110\\n2\\n01\\n1\\n111\\n1\\n\", \"3\\n100110\\n2\\n01\\n2\\n011\\n1\\n\", \"3\\n000110\\n2\\n01\\n2\\n011\\n1\\n\", \"3\\n001110\\n2\\n01\\n2\\n111\\n1\\n\", \"3\\n001110\\n2\\n01\\n2\\n101\\n1\... |
taco_7415 | deepcoder | A number is called powerful if it is a power of two or a factorial. In other words, the number $m$ is powerful if there exists a non-negative integer $d$ such that $m=2^d$ or $m=d!$, where $d!=1\cdot 2\cdot \ldots \cdot d$ (in particular, $0! = 1$). For example $1$, $4$, and $6$ are powerful numbers, because $1=1!$, $4... | {"ground_truth": "{\"inputs\": [\"4\\n7\\n11\\n240\\n17179869184\\n\", \"100\\n1\\n2\\n3\\n4\\n5\\n6\\n7\\n8\\n9\\n10\\n11\\n12\\n13\\n14\\n15\\n16\\n17\\n18\\n19\\n20\\n21\\n22\\n23\\n24\\n25\\n26\\n27\\n28\\n29\\n30\\n31\\n32\\n33\\n34\\n35\\n36\\n37\\n38\\n39\\n40\\n41\\n42\\n43\\n44\\n45\\n46\\n47\\n48\\n49\\n50\\n... |
taco_7416 | deepcoder | Theatre Square in the capital city of Berland has a rectangular shape with the size n × m meters. On the occasion of the city's anniversary, a decision was taken to pave the Square with square granite flagstones. Each flagstone is of the size a × a.
What is the least number of flagstones needed to pave the Square? It'... | {"ground_truth": "{\"inputs\": [\"1 1 3\\n\", \"1000000000 1000000000 1\\n\", \"2 1 2\\n\", \"222 332 5\\n\", \"2 2 1\\n\", \"456784567 1000000000 51\\n\", \"1001 1000 10\\n\", \"2 3 4\\n\", \"1000000000 1000000000 999999999\\n\", \"2 1 1\\n\", \"100 10001 1000000000\\n\", \"39916800 134217728 40320\\n\", \"12 13 4\\n\... |
taco_7417 | deepcoder | You're given an array $b$ of length $n$. Let's define another array $a$, also of length $n$, for which $a_i = 2^{b_i}$ ($1 \leq i \leq n$).
Valerii says that every two non-intersecting subarrays of $a$ have different sums of elements. You want to determine if he is wrong. More formally, you need to determine if there... | {"ground_truth": "{\"inputs\": [\"2\\n6\\n4 3 0 1 2 0\\n2\\n2 5\\n\", \"1\\n3\\n1 1 2\\n\", \"1\\n3\\n1 1 1\\n\", \"1\\n3\\n1 2 3\\n\", \"1\\n3\\n1 2 3\\n\", \"1\\n3\\n1 1 1\\n\", \"1\\n3\\n1 1 2\\n\", \"1\\n3\\n1 2 2\\n\", \"2\\n6\\n0 3 0 1 2 0\\n2\\n2 5\\n\", \"1\\n3\\n0 2 1\\n\", \"1\\n3\\n0 1 1\\n\", \"1\\n3\\n0 2 ... |
taco_7418 | deepcoder | F: Tea Party
Yun decided to hold a tea party at the company.
The shop sells $ N $ sets of bread, each containing $ A_1, A_2, A_3, \ dots, A_N $.
Yun decided to make a sandwich by combining two breads into a pair.
Yun-san is very careful, so I want to make sure that I don't have any leftover bread.
Calculate how ma... | {"ground_truth": "{\"inputs\": [\"5\\n4 3 5 6 7\", \"5\\n4 3 5 10 7\", \"5\\n4 3 5 10 9\", \"5\\n4 6 5 10 9\", \"5\\n4 12 5 10 9\", \"5\\n4 12 5 0 9\", \"5\\n4 12 5 0 3\", \"5\\n1 12 5 0 3\", \"5\\n2 3 3 6 7\", \"5\\n4 3 5 10 17\", \"5\\n4 6 9 10 9\", \"5\\n6 12 5 0 9\", \"5\\n6 2 5 0 3\", \"5\\n2 12 7 0 0\", \"5\\n4 0... |
taco_7419 | deepcoder | On the Planet AtCoder, there are four types of bases: A, C, G and T. A bonds with T, and C bonds with G.
You are given a letter b as input, which is A, C, G or T. Write a program that prints the letter representing the base that bonds with the base b.
-----Constraints-----
- b is one of the letters A, C, G and T.
--... | {"ground_truth": "{\"inputs\": [\"A\\n\", \"G\\n\", \"C\\n\", \"T\\n\", \"C\", \"T\", \"C\", \"T\", \"G\", \"A\"], \"outputs\": [\"T\\n\", \"C\\n\", \"G\\n\", \"A\\n\", \"G\\n\", \"A\\n\", \"G\\n\", \"A\\n\", \"C\", \"T\"]}", "dataset_type": "taco"} |
taco_7420 | deepcoder | When Mr. Kay was browsing a certain SNS as usual, the problem that "there are people who can solve IQ150 or more" came to the timeline. Mr. Kay has an IQ of over 150, so he solved the problem in an instant without even looking at it. For him, he doesn't have to work on such a mystery. It is enough to leave it to the co... | {"ground_truth": "{\"inputs\": [\"5\", \"2\", \"68\", \"2286\", \"7\", \"1\", \"4\", \"27\", \"8\", \"3\", \"49\", \"6\", \"82\", \"75\", \"123\", \"188\", \"13\", \"12\", \"14\", \"24\", \"9\", \"10\", \"15\", \"11\", \"48\", \"18\", \"50\", \"45\", \"31\", \"194\", \"310\", \"30\", \"17\", \"16\", \"28\", \"70\", \"2... |
taco_7421 | deepcoder | You've gotten an n × m sheet of squared paper. Some of its squares are painted. Let's mark the set of all painted squares as A. Set A is connected. Your task is to find the minimum number of squares that we can delete from set A to make it not connected.
A set of painted squares is called connected, if for every two s... | {"ground_truth": "{\"inputs\": [\"3 3\\n###\\n#.#\\n###\\n\", \"2 2\\n.#\\n.#\\n\", \"2 2\\n.#\\n##\\n\", \"2 5\\n#####\\n##.##\\n\", \"2 2\\n##\\n#.\\n\", \"5 3\\n###\\n###\\n.#.\\n###\\n###\\n\", \"1 2\\n##\\n\", \"5 7\\n.#####.\\n.#...#.\\n###.###\\n#.#.#.#\\n###.###\\n\", \"5 5\\n#####\\n#####\\n#....\\n#####\\n###... |
taco_7422 | deepcoder | Takahashi has A cookies, and Aoki has B cookies.
Takahashi will do the following action K times:
- If Takahashi has one or more cookies, eat one of his cookies.
- Otherwise, if Aoki has one or more cookies, eat one of Aoki's cookies.
- If they both have no cookies, do nothing.
In the end, how many cookies will Takah... | {"ground_truth": "{\"inputs\": [\"2 3 3\\n\", \"500000000000 500000000000 1000000000000\\n\", \"500000000000 500000000001 1000000000000\\n\", \"500000000000 499999999999 1000000000000\\n\", \"0 0 0\\n\", \"0 0 1000000000000\\n\", \"0 1000000000000 0\\n\", \"0 1000000000000 1000000000000\\n\", \"1000000000000 0 0\\n\", ... |
taco_7423 | deepcoder | Write a program which prints $n$-th fibonacci number for a given integer $n$. The $n$-th fibonacci number is defined by the following recursive formula:
\begin{equation*} fib(n)= \left \\{ \begin{array}{ll} 1 & (n = 0) \\\ 1 & (n = 1) \\\ fib(n - 1) + fib(n - 2) & \\\ \end{array} \right. \end{equation*}
Constraints
... | {"ground_truth": "{\"inputs\": [\"1\", \"2\", \"4\", \"8\", \"6\", \"15\", \"7\", \"24\", \"14\", \"5\", \"13\", \"11\", \"22\", \"9\", \"29\", \"12\", \"10\", \"41\", \"16\", \"30\", \"21\", \"28\", \"17\", \"34\", \"18\", \"38\", \"31\", \"44\", \"36\", \"32\", \"33\", \"23\", \"19\", \"27\", \"20\", \"37\", \"25\", ... |
taco_7424 | deepcoder | # Task
You are given a decimal number `n` as a **string**. Transform it into an array of numbers (given as **strings** again), such that each number has only one nonzero digit and their sum equals n.
Each number in the output array should be written without any leading and trailing zeros.
# Input/Output
- `[inpu... | {"ground_truth": "{\"fn_name\": \"split_exp\", \"inputs\": [[\"7970521.5544\"], [\"7496314\"], [\"0\"], [\"6\"], [\"1.0000000000\"], [\"0000000000.1\"], [\"1010101\"], [\"1234567890.1234567890\"]], \"outputs\": [[[\"7000000\", \"900000\", \"70000\", \"500\", \"20\", \"1\", \".5\", \".05\", \".004\", \".0004\"]], [[\"70... |
taco_7425 | deepcoder | Everlasting Sa-Ga, a new, hot and very popular role-playing game, is out on October 19, 2008. Fans have been looking forward to a new title of Everlasting Sa-Ga.
Little Jimmy is in trouble. He is a seven-year-old boy, and he obtained the Everlasting Sa-Ga and is attempting to reach the end of the game before his frien... | {"ground_truth": "{\"inputs\": [\"10 3\\n30 20\\n0 0\", \"9 15\\n30 20\\n0 0\", \"10 3\\n44 33\\n0 0\", \"10 4\\n11 70\\n0 0\", \"10 3\\n8 20\\n0 0\", \"4 3\\n8 20\\n0 0\", \"4 3\\n12 20\\n0 0\", \"10 3\\n30 33\\n0 0\", \"10 3\\n8 35\\n0 0\", \"8 3\\n8 20\\n0 0\", \"4 5\\n12 20\\n0 0\", \"9 15\\n30 3\\n0 0\", \"2 3\\n4... |
taco_7426 | deepcoder | Tanechka is shopping in the toy shop. There are exactly $n$ toys in the shop for sale, the cost of the $i$-th toy is $i$ burles. She wants to choose two toys in such a way that their total cost is $k$ burles. How many ways to do that does she have?
Each toy appears in the shop exactly once. Pairs $(a, b)$ and $(b, a)$... | {"ground_truth": "{\"inputs\": [\"8 5\\n\", \"8 15\\n\", \"7 20\\n\", \"1000000000000 1000000000001\\n\", \"1 1\\n\", \"44999999999177 100000000000000\\n\", \"100000000000000 100000000000000\\n\", \"100000000000 130000000001\\n\", \"99999999999999 65536\\n\", \"1010101010 1010101010\\n\", \"100000000000000 999999999999... |
taco_7427 | deepcoder | There are N integers written on a blackboard. The i-th integer is A_i, and the greatest common divisor of these integers is 1.
Takahashi and Aoki will play a game using these integers. In this game, starting from Takahashi the two player alternately perform the following operation:
* Select one integer on the blackbo... | {"ground_truth": "{\"inputs\": [\"3\\n3 9 7\", \"4\\n1 2 1 9\", \"4\\n1 2 1 8\", \"5\\n7 2 8 8 8\", \"3\\n3 9 9\", \"3\\n3 1 9\", \"4\\n1 2 1 13\", \"3\\n1 1 9\", \"4\\n1 2 1 22\", \"3\\n0 1 9\", \"4\\n1 1 1 22\", \"3\\n0 1 5\", \"4\\n0 1 1 22\", \"4\\n0 0 1 22\", \"4\\n0 -1 1 22\", \"4\\n0 0 1 1\", \"4\\n0 0 1 2\", \"... |
taco_7428 | deepcoder | In this Kata, you will be given a number `n` (`n > 0`) and your task will be to return the smallest square number `N` (`N > 0`) such that `n + N` is also a perfect square. If there is no answer, return `-1` (`nil` in Clojure, `Nothing` in Haskell, `None` in Rust).
```clojure
solve 13 = 36
; because 36 is the smalles... | {"ground_truth": "{\"fn_name\": \"solve\", \"inputs\": [[1], [2], [3], [4], [5], [7], [8], [9], [10], [11], [13], [17], [88901], [290101]], \"outputs\": [[-1], [-1], [1], [-1], [4], [9], [1], [16], [-1], [25], [36], [64], [5428900], [429235524]]}", "dataset_type": "taco"} |
taco_7429 | deepcoder | A game is played on a strip consisting of N cells consecutively numbered from 1 to N.
Alice has her token on cell A. Borys has his token on a different cell B.
Players take turns, Alice moves first. The moving player must shift his or her token from its current cell X to the neighboring cell on the left, cell X-1, or... | {"ground_truth": "{\"inputs\": [\"9 23 42\", \"8 2 4\", \"3 1 2\", \"9 23 18\", \"3 2 2\", \"8 2 3\", \"9 23 23\", \"0 2 2\", \"7 2 3\", \"9 44 23\", \"0 2 1\", \"7 2 5\", \"9 44 0\", \"0 0 1\", \"7 1 5\", \"9 38 0\", \"0 1 1\", \"7 1 4\", \"1 38 0\", \"0 1 0\", \"8 1 4\", \"1 38 1\", \"0 2 0\", \"8 1 7\", \"1 31 0\", ... |
taco_7430 | deepcoder | You have an array a of length n. For every positive integer x you are going to perform the following operation during the x-th second:
* Select some distinct indices i_{1}, i_{2}, …, i_{k} which are between 1 and n inclusive, and add 2^{x-1} to each corresponding position of a. Formally, a_{i_{j}} := a_{i_{j}} + 2^{... | {"ground_truth": "{\"inputs\": [\"6\\n3\\n1000000000 0 -1000000000\\n1\\n6\\n2\\n-1000000000 1000000000\\n2\\n1000000000 -1000000000\\n2\\n1000000000 1000000000\\n2\\n-1000000000 -1000000000\\n\", \"6\\n3\\n1000000000 0 -1000000000\\n1\\n6\\n2\\n-1000000000 1000000000\\n2\\n1000000000 -1000000000\\n2\\n1000000000 10000... |
taco_7431 | deepcoder | Captain Flint and his crew keep heading to a savage shore of Byteland for several months already, drinking rum and telling stories. In such moments uncle Bogdan often remembers his nephew Denis. Today, he has told a story about how Denis helped him to come up with an interesting problem and asked the crew to solve it.
... | {"ground_truth": "{\"inputs\": [\"2\\n1\\n3\\n\", \"1\\n2\\n\", \"1\\n2\\n\", \"2\\n87911\\n94124\\n\", \"20\\n1057\\n7092\\n1990\\n3013\\n7002\\n18597\\n2726\\n6319\\n1248\\n5690\\n3467\\n4270\\n6973\\n2935\\n100000\\n19329\\n1836\\n1100\\n2599\\n2579\\n\", \"5\\n46809\\n40813\\n42036\\n43977\\n24229\\n\", \"2\\n10000... |
taco_7432 | deepcoder | Monocarp has forgotten the password to his mobile phone. The password consists of $4$ digits from $0$ to $9$ (note that it can start with the digit $0$).
Monocarp remembers that his password had exactly two different digits, and each of these digits appeared exactly two times in the password. Monocarp also remembers s... | {"ground_truth": "{\"inputs\": [\"2\\n8\\n0 1 2 4 5 6 8 9\\n1\\n8\\n\", \"7\\n1\\n8\\n1\\n8\\n1\\n8\\n1\\n8\\n1\\n8\\n1\\n8\\n1\\n8\\n\", \"7\\n1\\n1\\n1\\n1\\n1\\n1\\n1\\n1\\n1\\n1\\n1\\n1\\n1\\n1\\n\", \"1\\n8\\n0 1 2 4 5 6 8 9\\n\", \"3\\n8\\n0 1 2 4 5 6 8 9\\n1\\n8\\n1\\n8\\n\", \"1\\n1\\n8\\n\", \"1\\n4\\n0 1 4 7\... |
taco_7433 | deepcoder | The Hedgehog recently remembered one of his favorite childhood activities, — solving puzzles, and got into it with new vigor. He would sit day in, day out with his friend buried into thousands of tiny pieces of the picture, looking for the required items one by one.
Soon the Hedgehog came up with a brilliant idea: ins... | {"ground_truth": "{\"inputs\": [\"12 18\\nCBBCAACABACCACABBC\\nABCAACABAABCBCBCCC\\nBCAACCCBBBABBACBBA\\nACCBCBBBAABACCACCC\\nCAABCCCACACCBACACC\\nBBBCBCACCABCCBCBBB\\nBAABBCACAAAAACCBCB\\nBAABAABACBCABACBCA\\nAABCBCCBCCABACCCAC\\nCCBBBAACCCBCACCCBB\\nCBABACBBBABCBACCCB\\nAABACCCBCCACBCACCB\\n\", \"10 11\\nABBBAABABBB\... |
taco_7434 | deepcoder | Nastya owns too many arrays now, so she wants to delete the least important of them. However, she discovered that this array is magic! Nastya now knows that the array has the following properties:
In one second we can add an arbitrary (possibly negative) integer to all elements of the array that are not equal to zer... | {"ground_truth": "{\"inputs\": [\"5\\n1 1 1 1 1\\n\", \"3\\n2 0 -1\\n\", \"4\\n5 -6 -5 1\\n\", \"1\\n0\\n\", \"2\\n21794 -79194\\n\", \"3\\n-63526 95085 -5239\\n\", \"3\\n0 53372 -20572\\n\", \"13\\n-2075 -32242 27034 -37618 -96962 82203 64846 48249 -71761 28908 -21222 -61370 46899\\n\", \"5\\n806 0 1308 1954 683\\n\",... |
taco_7435 | deepcoder | problem
There are $ N $ propositions, named $ 1, 2, \ cdots, N $, respectively. Also, $ M $ information about the propositions is given. The $ i $ th information is "$ a_i $$". Given in the form "b_i $", which means that $ a_i $ is $ b_i $. ("If" is a logical conditional and the transition law holds.) $ For each propo... | {"ground_truth": "{\"inputs\": [\"5 2\\n1 2\\n2 2\", \"3 2\\n1 2\\n2 1\", \"3 2\\n1 2\\n3 1\", \"6 2\\n1 2\\n2 1\", \"9 2\\n1 2\\n2 4\", \"6 2\\n1 1\\n2 1\", \"17 2\\n1 2\\n2 4\", \"4 2\\n2 2\\n3 1\", \"26 2\\n2 2\\n4 4\", \"12 2\\n2 2\\n4 4\", \"1 0\\n2 2\\n1 1\", \"17 2\\n1 2\\n2 1\", \"7 1\\n2 1\\n3 0\", \"28 2\\n1 ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.