info large_stringlengths 279 33.9k | question large_stringlengths 548 5.15k | avg@8_qwen3_4b_instruct_2507 float64 0 0 | original_problem_id int64 1 499 | problem_id int64 0 399 |
|---|---|---|---|---|
{"tests": "{\"inputs\": [\"\\\"accca\\\"\\n2\", \"\\\"aabaab\\\"\\n3\", \"\\\"xxyz\\\"\\n1\", \"\\\"abcde\\\"\\n5\", \"\\\"aaaaaa\\\"\\n2\", \"\\\"wjlcta\\\"\\n5\", \"\\\"eictzzwx\\\"\\n1\", \"\\\"fvcalcqn\\\"\\n3\", \"\\\"zcjvkodq\\\"\\n5\", \"\\\"eifhjtmuj\\\"\\n7\", \"\\\"cxdzvmcbcv\\\"\\n3\", \"\\\"rnqrabcxrh\\\"\\... | You are given a 0-indexed string s and an integer k.
You are to perform the following partitioning operations until s is empty:
Choose the longest prefix of s containing at most k distinct characters.
Delete the prefix from s and increase the number of partitions by one. The remaining characters (if any) in s maintain... | 0 | 2 | 0 |
{"tests": "{\"inputs\": [\"3\\n3 5 10\\n4 3 3\\n2 2 6\\n\", \"3\\n3 5 10\\n4 3 3\\n2 2 3\\n\", \"2\\n4 8\\n3 1 100\\n4 10000 100\\n\", \"1\\n1\\n1 1 1\\n1 1 1\\n\", \"1\\n1328\\n1 73192516 779\\n1 468279677 682\\n\", \"1\\n1093\\n1 150127956 237\\n1 905660966 894\\n\", \"1\\n14807\\n43 583824808 729\\n15 917174828 159\... | As the factory manager of Keyence, you want to monitor several sections on a conveyor belt. There are a total of N sections you want to monitor, and the length of the i-th section is D_i meters.
There are two types of sensors to choose from, and below is some information about each sensor.
- Type-j sensor (1\leq j \le... | 0 | 3 | 1 |
{"tests": "{\"inputs\": [\"3 1\\n\", \"2 1\\n\", \"2 2\\n\", \"3 1\\n\", \"3 3\\n\", \"4 1\\n\", \"4 2\\n\", \"4 3\\n\", \"4 4\\n\", \"100 30\\n\", \"100 93\\n\", \"100 89\\n\", \"100 100\\n\"], \"outputs\": [\"2\\n1 2 \\n1 3 \\n2\\n\", \"1\\n1 2 \\n2\\n\", \"1\\n1 2 \\n1\\n\", \"2\\n1 2 \\n1 3 \\n2\\n\", \"2\\n1 2 \\n... | This is an interactive problem (a type of problem where your program interacts with the judge program through Standard Input and Output).
There are N bottles of juice, numbered 1 to N. It has been discovered that exactly one of these bottles has gone bad. Even a small sip of the spoiled juice will cause stomach upset t... | 0 | 4 | 2 |
{"tests": "{\"inputs\": [\"3 4\\n1 2 5\\n2 1 -3\\n2 3 -4\\n3 1 100\\n\", \"3 2\\n1 2 0\\n2 1 0\\n\", \"5 9\\n1 2 -246288\\n4 5 -222742\\n3 1 246288\\n3 4 947824\\n5 2 -178721\\n4 3 -947824\\n5 4 756570\\n2 5 707902\\n5 1 36781\\n\", \"2 1\\n2 1 0\\n\", \"6 8\\n1 5 -4\\n2 1 -803\\n3 1 -1595\\n3 4 -5960\\n3 5 -1599\\n5 2... | There is a weighted simple directed graph with N vertices and M edges.
The vertices are numbered 1 to N, and the i-th edge has a weight of W_i and extends from vertex U_i to vertex V_i.
The weights can be negative, but the graph does not contain negative cycles.
Determine whether there is a walk that visits each vert... | 0 | 5 | 3 |
{"tests": "{\"inputs\": [\"2 5\\n\", \"0 0\\n\", \"7 1\\n\", \"1 0\\n\", \"2 0\\n\", \"2 1\\n\", \"1 3\\n\", \"2 3\\n\", \"0 6\\n\", \"3 4\\n\", \"0 8\\n\", \"5 4\\n\"], \"outputs\": [\"2\\n\", \"9\\n\", \"4\\n\", \"2\\n\", \"3\\n\", \"4\\n\", \"5\\n\", \"6\\n\", \"7\\n\", \"8\\n\", \"9\\n\", \"0\\n\"], \"fn_name\": nu... | You are given two integers A and B, each between 0 and 9, inclusive.
Print any integer between 0 and 9, inclusive, that is not equal to A + B.
Input
The input is given from Standard Input in the following format:
A B
Output
Print any integer between 0 and 9, inclusive, that is not equal to A + B.
Constraints
- 0... | 0 | 6 | 4 |
{"tests": "{\"inputs\": [\"840 84 7\\n\", \"343 34 3\\n\", \"0 0 0\\n\", \"951 154 495\\n\", \"744 621 910\\n\", \"866 178 386\\n\", \"1029 1029 1029\\n\", \"0 0 343\\n\", \"915 51 4\\n\", \"596 176 27\\n\", \"339 210 90\\n\", \"359 245 60\\n\", \"546 210 21\\n\", \"343 343 0\\n\"], \"outputs\": [\"Yes\\n0 0 0 0 6 0 6 ... | In a coordinate space, we want to place three cubes with a side length of 7 so that the volumes of the regions contained in exactly one, two, three cube(s) are V_1, V_2, V_3, respectively.
For three integers a, b, c, let C(a,b,c) denote the cubic region represented by (a\leq x\leq a+7) \land (b\leq y\leq b+7) \land (c... | 0 | 7 | 5 |
{"tests": "{\"inputs\": [\"0 0 3 3\\n\", \"-1 -2 1 3\\n\", \"-1000000000 -1000000000 1000000000 1000000000\\n\", \"593578395 -294607744 709130348 746175204\\n\", \"-678601079 -990141434 909949145 506736933\\n\", \"-420376129 -732520502 229097481 -243073819\\n\", \"-1 -1 0 0\\n\", \"-880976965 -698845539 -841240811 7992... | The pattern of AtCoder's wallpaper can be represented on the xy-plane as follows:
-
The plane is divided by the following three types of lines:
-
x = n (where n is an integer)
-
y = n (where n is an even number)
-
x + y = n (where n is an even number)
-
Each region is painted black or white. Any two regions... | 0 | 8 | 6 |
{"tests": "{\"inputs\": [\"5 0\\n2 5\\n\", \"3 1\\n4 1\\n\", \"2552608206527595 5411232866732612\\n771856005518028 7206210729152763\\n\", \"4781732879448891 183482112471753\\n4781732879448891 9644257416479985\\n\", \"6544605838412317 5090865519680273\\n3731935893323877 2278195574591833\\n\", \"0 0\\n10000000000000000 0... | The coordinate plane is covered with 2\times1 tiles. The tiles are laid out according to the following rules:
- For an integer pair (i,j), the square A _ {i,j}=\lbrace(x,y)\mid i\leq x\leq i+1\wedge j\leq y\leq j+1\rbrace is contained in one tile.
- When i+j is even, A _ {i,j} and A _ {i + 1,j} are contained in the sa... | 0 | 9 | 7 |
{"tests": "{\"inputs\": [\"363\\n\", \"101\\n\", \"3154625100\\n\", \"146659312800\\n\", \"248961081600\\n\", \"963761198400\\n\", \"936888861285\\n\", \"637822752336\\n\", \"549755813888\\n\", \"240940299600\\n\", \"442597478400\\n\", \"110649369600\\n\", \"39571817593\\n\", \"771852316660\\n\", \"607588581600\\n\", \... | You are given an integer N. Print a string S that satisfies all of the following conditions. If no such string exists, print -1.
- S is a string of length between 1 and 1000, inclusive, consisting of the characters 1, 2, 3, 4, 5, 6, 7, 8, 9, and * (multiplication symbol).
- S is a palindrome.
- The first character of ... | 0 | 10 | 8 |
{"tests": "{\"inputs\": [\"4 8 4\\n1 5\\n3 2\\n4 1\\n5 3\\n\", \"2 1 1\\n3 2\\n3 2\\n\", \"2 100 100\\n3 2\\n3 2\\n\", \"6 364 463\\n230 381\\n154 200\\n328 407\\n339 94\\n193 10\\n115 309\\n\", \"18 10000 10000\\n5790 8778\\n9995 9908\\n9016 2300\\n2633 3650\\n2312 5582\\n8853 6097\\n8881 8620\\n6427 3925\\n9355 5240\... | Takahashi has prepared N dishes for Snuke.
The dishes are numbered from 1 to N, and dish i has a sweetness of A_i and a saltiness of B_i.
Takahashi can arrange these dishes in any order he likes.
Snuke will eat the dishes in the order they are arranged, but if at any point the total sweetness of the dishes he has eaten... | 0 | 11 | 9 |
{"tests": "{\"inputs\": [\"3\\n2\\n[1, 3]\\n[5]\", \"2\\n2\\n[7]\\n[4]\", \"10\\n10\\n[420, 1, 597, 1, 905, 1, 261, 1, 681]\\n[101, 1, 333, 1, 502, 1, 409, 1, 787]\", \"6\\n2\\n[1,3,2,3,1]\\n[1]\", \"17\\n18\\n[781, 307, 573, 596, 536, 761, 591, 848, 858, 302, 652, 540, 770, 607, 809, 322]\\n[841, 828, 682, 480, 391, 9... | There is an m x n cake that needs to be cut into 1 x 1 pieces.
You are given integers m, n, and two arrays:
horizontalCut of size m - 1, where horizontalCut[i] represents the cost to cut along the horizontal line i.
verticalCut of size n - 1, where verticalCut[j] represents the cost to cut along the vertical line j.
... | 0 | 12 | 10 |
{"tests": "{\"inputs\": [\"10\\nhttp://abacaba.ru/test\\nhttp://abacaba.ru/\\nhttp://abacaba.com\\nhttp://abacaba.com/test\\nhttp://abacaba.de/\\nhttp://abacaba.ru/test\\nhttp://abacaba.de/test\\nhttp://abacaba.com/\\nhttp://abacaba.com/t\\nhttp://abacaba.com/test\\n\", \"14\\nhttp://c\\nhttp://ccc.bbbb/aba..b\\nhttp:/... | There are some websites that are accessible through several different addresses. For example, for a long time Codeforces was accessible with two hostnames codeforces.com and codeforces.ru.
You are given a list of page addresses being queried. For simplicity we consider all addresses to have the form http://<hostname>[... | 0 | 14 | 11 |
{"tests": "{\"inputs\": [\"10 5\\n\", \"4 2\\n\", \"4 1\\n\", \"1 1\\n\", \"63 1\\n\", \"98 88\\n\", \"746 173\\n\", \"890 553\\n\", \"883 1000\\n\", \"1 1000\\n\", \"695 188\\n\", \"2060 697\\n\", \"70 3321\\n\", \"6358 1646\\n\", \"15000 1\\n\", \"1048576 1\\n\", \"1000000 1\\n\", \"10009 1\\n\", \"10001 1\\n\"], \"o... | Pikachu had an array with him. He wrote down all the non-empty subsequences of the array on paper. Note that an array of size n has 2^{n} - 1 non-empty subsequences in it.
Pikachu being mischievous as he always is, removed all the subsequences in which Maximum_element_of_the_subsequence - Minimum_element_of_subsequ... | 0 | 16 | 12 |
{"tests": "{\"inputs\": [\"3 4\\n2 5 6\\n1 3 6 8\\n\", \"3 3\\n1 2 3\\n1 2 3\\n\", \"1 2\\n165\\n142 200\\n\", \"1 2\\n5000000000\\n1 10000000000\\n\", \"2 4\\n3 12\\n1 7 8 14\\n\", \"3 3\\n1 2 3\\n2 3 4\\n\", \"2 1\\n1 10\\n9\\n\", \"3 19\\n7 10 13\\n1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19\\n\", \"3 3\\n2 3 4\... | Mad scientist Mike does not use slow hard disks. His modification of a hard drive has not one, but n different heads that can read data in parallel.
When viewed from the side, Mike's hard drive is an endless array of tracks. The tracks of the array are numbered from left to right with integers, starting with 1. In the... | 0 | 19 | 13 |
{"tests": "{\"inputs\": [\"3\\n999999 0\\n0 999999\\n999999 0\\n\", \"1\\n-824590 246031\\n\", \"8\\n-67761 603277\\n640586 -396671\\n46147 -122580\\n569609 -2112\\n400 914208\\n131792 309779\\n-850150 -486293\\n5272 721899\\n\", \"6\\n1000000 0\\n1000000 0\\n-1000000 0\\n0 1000000\\n0 -1000000\\n0 -1000000\\n\", \"8\\... | For a vector $\vec{v} = (x, y)$, define $|v| = \sqrt{x^2 + y^2}$.
Allen had a bit too much to drink at the bar, which is at the origin. There are $n$ vectors $\vec{v_1}, \vec{v_2}, \cdots, \vec{v_n}$. Allen will make $n$ moves. As Allen's sense of direction is impaired, during the $i$-th move he will either move in th... | 0 | 20 | 14 |
{"tests": "{\"inputs\": [\"6\\n2 1 4 6 2 2\\n\", \"7\\n3 3 3 1 3 3 3\\n\", \"7\\n5128 5672 5805 5452 5882 5567 5032\\n\", \"10\\n1 2 2 3 5 5 5 4 2 1\\n\", \"14\\n20 20 20 20 20 20 3 20 20 20 20 20 20 20\\n\", \"50\\n3 2 4 3 5 3 4 5 3 2 3 3 3 4 5 4 2 2 3 3 4 4 3 2 3 3 2 3 4 4 5 2 5 2 3 5 4 4 2 2 3 5 2 5 2 2 5 4 5 4\\n\"... | Limak is a little bear who loves to play. Today he is playing by destroying block towers. He built n towers in a row. The i-th tower is made of h_{i} identical blocks. For clarification see picture for the first sample.
Limak will repeat the following operation till everything is destroyed.
Block is called internal i... | 0 | 21 | 15 |
{"tests": "{\"inputs\": [\"3 2\\n1 2 3\\n\", \"5 10\\n0 1 0 2 1\\n\", \"9 0\\n11 22 33 44 55 66 77 88 99\\n\", \"10 100\\n2705446 2705444 2705446 2705445 2705448 2705447 2705444 2705448 2705448 2705449\\n\", \"10 5\\n5914099 5914094 5914099 5914097 5914100 5914101 5914097 5914095 5914101 5914102\\n\", \"12 3\\n7878607 ... | This problem is the most boring one you've ever seen.
Given a sequence of integers a_1, a_2, ..., a_{n} and a non-negative integer h, our goal is to partition the sequence into two subsequences (not necessarily consist of continuous elements). Each element of the original sequence should be contained in exactly one o... | 0 | 22 | 16 |
{"tests": "{\"inputs\": [\"3\\n4 2 1\\n\", \"1\\n4\\n\", \"2\\n1 1\\n\", \"1\\n2\\n\", \"1\\n3\\n\", \"1\\n5\\n\", \"2\\n2 2\\n\", \"3\\n1 2 4\\n\", \"3\\n3 3 3\\n\", \"3\\n3 3 6\\n\", \"3\\n6 6 6\\n\", \"3\\n6 6 9\\n\", \"26\\n1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1\\n\", \"3\\n7 7 21\\n\", \"2\\n95 50\\n\... | Ivan wants to make a necklace as a present to his beloved girl. A necklace is a cyclic sequence of beads of different colors. Ivan says that necklace is beautiful relative to the cut point between two adjacent beads, if the chain of beads remaining after this cut is a palindrome (reads the same forward and backward).
... | 0 | 23 | 17 |
{"tests": "{\"inputs\": [\"4 2\\n1 2\\n2 3\\n\", \"3 3\\n1 2\\n2 3\\n1 3\\n\", \"5 7\\n3 2\\n5 4\\n3 4\\n1 3\\n1 5\\n1 4\\n2 5\\n\", \"10 11\\n4 10\\n8 10\\n2 3\\n2 4\\n7 1\\n8 5\\n2 8\\n7 2\\n1 2\\n2 9\\n6 8\\n\", \"10 9\\n2 5\\n2 4\\n2 7\\n2 9\\n2 3\\n2 8\\n2 6\\n2 10\\n2 1\\n\", \"10 16\\n6 10\\n5 2\\n6 4\\n6 8\\n5 ... | Recently, Pari and Arya did some research about NP-Hard problems and they found the minimum vertex cover problem very interesting.
Suppose the graph G is given. Subset A of its vertices is called a vertex cover of this graph, if for each edge uv there is at least one endpoint of it in this set, i.e. $u \in A$ or $v \i... | 0 | 24 | 18 |
{"tests": "{\"inputs\": [\"2 4\\n\", \"2 1\\n\", \"1 1\\n\", \"1 2\\n\", \"1 3\\n\", \"2 2\\n\", \"2 3\\n\", \"3 1\\n\", \"3 2\\n\", \"3 3\\n\", \"1 4\\n\", \"4 1\\n\", \"4 2\\n\", \"100 1\\n\", \"1 100\\n\", \"101 1\\n\", \"1 101\\n\", \"2 20\\n\"], \"outputs\": [\"YES\\n5 4 7 2 \\n3 6 1 8 \\n\", \"NO\\n\", \"YES\\n1\... | Students went into a class to write a test and sat in some way. The teacher thought: "Probably they sat in this order to copy works of each other. I need to rearrange them in such a way that students that were neighbors are not neighbors in a new seating."
The class can be represented as a matrix with n rows and m col... | 0 | 25 | 19 |
{"tests": "{\"inputs\": [\"4\\n\", \"2\\n\", \"1\\n\", \"3\\n\", \"5\\n\", \"6\\n\", \"7\\n\", \"8\\n\", \"9\\n\", \"10\\n\", \"20\\n\", \"21\\n\", \"22\\n\", \"23\\n\", \"24\\n\", \"25\\n\", \"100\\n\", \"108\\n\"], \"outputs\": [\"3 4 1 2\\n\", \"2 1\\n\", \"1\\n\", \"3 2 1\\n\", \"4 5 2 3 1\\n\", \"5 6 3 4 1 2\\n\",... | Mrs. Smith is trying to contact her husband, John Smith, but she forgot the secret phone number!
The only thing Mrs. Smith remembered was that any permutation of $n$ can be a secret phone number. Only those permutations that minimize secret value might be the phone of her husband.
The sequence of $n$ integers is call... | 0 | 26 | 20 |
{"tests": "{\"inputs\": [\"5 2 3\\n1 2\\n1 3\\n3 4\\n5 3\\n\", \"5 3 2\\n1 2\\n1 3\\n3 4\\n5 3\\n\", \"50 23129 410924\\n18 28\\n17 23\\n21 15\\n18 50\\n50 11\\n32 3\\n44 41\\n50 31\\n50 34\\n5 14\\n36 13\\n22 40\\n20 9\\n9 43\\n19 47\\n48 40\\n20 22\\n33 45\\n35 22\\n33 24\\n9 6\\n13 1\\n13 24\\n49 20\\n1 20\\n29 38\\... | A group of n cities is connected by a network of roads. There is an undirected road between every pair of cities, so there are $\frac{n \cdot(n - 1)}{2}$ roads in total. It takes exactly y seconds to traverse any single road.
A spanning tree is a set of roads containing exactly n - 1 roads such that it's possible to t... | 0 | 27 | 21 |
{"tests": "{\"inputs\": [\"5 3\\n3 2 2\\n\", \"10 1\\n1\\n\", \"1 1\\n1\\n\", \"2 2\\n1 2\\n\", \"200 50\\n49 35 42 47 134 118 14 148 58 159 33 33 8 123 99 126 75 94 1 141 61 79 122 31 48 7 66 97 141 43 25 141 7 56 120 55 49 37 154 56 13 59 153 133 18 1 141 24 151 125\\n\", \"3 3\\n3 3 1\\n\", \"100000 1\\n100000\\n\",... | Dreamoon likes coloring cells very much.
There is a row of $n$ cells. Initially, all cells are empty (don't contain any color). Cells are numbered from $1$ to $n$.
You are given an integer $m$ and $m$ integers $l_1, l_2, \ldots, l_m$ ($1 \le l_i \le n$)
Dreamoon will perform $m$ operations.
In $i$-th operation, Dre... | 0 | 28 | 22 |
{"tests": "{\"inputs\": [\"6\\n1 2\\n2 3\\n2 4\\n4 5\\n1 6\\n\", \"7\\n1 2\\n1 3\\n3 4\\n1 5\\n5 6\\n6 7\\n\", \"2\\n1 2\\n\", \"3\\n3 1\\n1 2\\n\", \"10\\n5 10\\n7 8\\n8 3\\n2 6\\n3 2\\n9 7\\n4 5\\n10 1\\n6 4\\n\", \"11\\n11 9\\n6 7\\n7 1\\n8 11\\n5 6\\n3 5\\n9 3\\n10 8\\n2 4\\n4 10\\n\", \"10\\n4 2\\n7 4\\n2 6\\n2 5\... | Vanya wants to minimize a tree. He can perform the following operation multiple times: choose a vertex v, and two disjoint (except for v) paths of equal length a_0 = v, a_1, ..., a_{k}, and b_0 = v, b_1, ..., b_{k}. Additionally, vertices a_1, ..., a_{k}, b_1, ..., b_{k} must not have any neighbours in the tree other t... | 0 | 29 | 23 |
{"tests": "{\"inputs\": [\"2\\n1 1 1\\n\", \"2\\n1 2 2\\n\", \"10\\n1 1 1 1 1 1 1 1 1 1 1\\n\", \"10\\n1 1 1 1 1 2 1 1 1 1 1\\n\", \"10\\n1 1 1 1 2 2 1 1 1 1 1\\n\", \"10\\n1 1 1 1 1 1 1 2 1 1 2\\n\", \"10\\n1 1 1 3 2 1 2 4 1 3 1\\n\", \"10\\n1 1 1 4 1 1 2 1 5 1 2\\n\", \"10\\n1 1 21 1 20 1 14 1 19 1 20\\n\", \"10\\n1 ... | Sasha is taking part in a programming competition. In one of the problems she should check if some rooted trees are isomorphic or not. She has never seen this problem before, but, being an experienced participant, she guessed that she should match trees to some sequences and then compare these sequences instead of tree... | 0 | 30 | 24 |
{"tests": "{\"inputs\": [\"3 1\\n6\\n\", \"3 3\\n1 7 8\\n\", \"3 4\\n1 3 5 7\\n\", \"10 10\\n334 588 666 787 698 768 934 182 39 834\\n\", \"2 4\\n3 2 4 1\\n\", \"3 4\\n3 4 1 6\\n\", \"2 0\\n\", \"2 1\\n1\\n\", \"17 0\\n\", \"17 1\\n95887\\n\", \"2 2\\n4 2\\n\", \"2 3\\n2 1 3\\n\", \"3 5\\n7 2 1 4 8\\n\", \"3 6\\n5 4 1 ... | The biggest event of the year – Cota 2 world championship "The Innernational" is right around the corner. $2^n$ teams will compete in a double-elimination format (please, carefully read problem statement even if you know what is it) to identify the champion.
Teams are numbered from $1$ to $2^n$ and will play games on... | 0 | 32 | 25 |
End of preview. Expand in Data Studio
README.md exists but content is empty.
- Downloads last month
- 4