Problem ID
stringlengths
2
6
Problem Description
stringlengths
0
7.52k
Rating
float64
800
3.5k
math
bool
2 classes
greedy
bool
2 classes
implementation
bool
2 classes
dp
bool
2 classes
data structures
bool
2 classes
constructive algorithms
bool
2 classes
brute force
bool
2 classes
binary search
bool
2 classes
sortings
bool
2 classes
graphs
bool
2 classes
__index_level_0__
int64
3
9.98k
817C
Problem - 817C - Codeforces =============== xa0 is not less than _s_. To prove that these numbers may have different special properties, he wants to know how rare (or not rare) they are — in fact, he needs to calculate the quantity of really big numbers that are not greater than _n_. Ivan tried to do the ...
1,600
true
false
false
true
false
false
true
true
false
false
6,491
427B
The prison of your city has _n_ prisoners. As the prison can't accommodate all of them, the city mayor has decided to transfer _c_ of the prisoners to a prison located in another city. For this reason, he made the _n_ prisoners to stand in a line, with a number written on their chests. The number is the severity of the...
1,100
false
false
true
false
true
false
false
false
false
false
8,130
343B
Mad scientist Mike has just finished constructing a new device to search for extraterrestrial intelligence! He was in such a hurry to launch it for the first time that he plugged in the power wires without giving it a proper glance and started experimenting right away. After a while Mike observed that the wires ended u...
1,600
false
true
true
false
true
false
false
false
false
false
8,462
457B
Piegirl was asked to implement two table join operation for distributed database system, minimizing the network traffic. Suppose she wants to join two tables, _A_ and _B_. Each of them has certain number of rows which are distributed on different number of partitions. Table _A_ is distributed on the first cluster consi...
1,900
false
true
false
false
false
false
false
false
false
false
8,011
659D
Maria participates in a bicycle race. The speedway takes place on the shores of Lake Lucerne, just repeating its contour. As you know, the lake shore consists only of straight sections, directed to the north, south, east or west. Let's introduce a system of coordinates, directing the _Ox_ axis from west to east, and th...
1,500
true
false
true
false
false
false
false
false
false
false
7,186
1515E
There are $$$n$$$ computers in a row, all originally off, and Phoenix wants to turn all of them on. He will manually turn on computers one at a time. At any point, if computer $$$i-1$$$ and computer $$$i+1$$$ are both on, computer $$$i$$$ $$$(2 le i le n-1)$$$ will turn on automatically if it is not already on. Note th...
2,200
true
false
false
true
false
false
false
false
false
false
3,087
354A
Vasya has _n_ items lying in a line. The items are consecutively numbered by numbers from 1 to _n_ in such a way that the leftmost item has number 1, the rightmost item has number _n_. Each item has a weight, the _i_-th item weights _w__i_ kilograms. Vasya needs to collect all these items, however he won't do it by him...
1,500
true
true
false
false
false
false
true
false
false
false
8,418
1120E
Problem - 1120E - Codeforces =============== xa0 ]( --- Finished → Virtual participation Virtual contest is a way to take part in past contest, as close as possible to participation on time. It is supported only ICPC mode for virtual contests. If you've seen these problems, a virtual contest is not for you - ...
2,600
false
false
false
false
false
false
true
false
false
false
5,082
175F
Vasya plays a popular game the Gnomes of Might and Magic. In this game Vasya manages the kingdom of gnomes, consisting of several castles, connected by bidirectional roads. The kingdom road network has a special form. The kingdom has _m_ main castles _a_1,u2009_a_2,u2009...,u2009_a__m_, which form the Good Path. This p...
3,000
false
false
true
false
true
false
false
false
false
true
9,160
1406C
Fishing Prince loves trees, and he especially loves trees with only one centroid. The tree is a connected graph without cycles. A vertex is a centroid of a tree only when you cut this vertex (remove it and remove all edges from this vertex), the size of the largest connected component of the remaining graph is the smal...
1,700
false
false
false
false
false
true
false
false
false
true
3,644
895C
Problem - 895C - Codeforces =============== xa0 ]( --- Finished → Virtual participation Virtual contest is a way to take part in past contest, as close as possible to participation on time. It is supported only ICPC mode for virtual contests. If you've seen these problems, a virtual contest is not for you - s...
2,000
true
false
false
true
false
false
false
false
false
false
6,168
858C
Beroffice text editor has a wide range of features that help working with text. One of the features is an automatic search for typos and suggestions of how to fix them. Beroffice works only with small English letters (i.e. with 26 letters from a to z). Beroffice thinks that a word is typed with a typo if there are thre...
1,500
false
true
true
true
false
false
false
false
false
false
6,312
955F
Problem - 955F - Codeforces =============== xa0 ]( --- Finished → Virtual participation Virtual contest is a way to take part in past contest, as close as possible to participation on time. It is supported only ICPC mode for virtual contests. If you've seen these problems, a virtual contest is not for you - s...
2,600
false
false
false
true
false
false
false
false
false
false
5,895
1045F
Ani and Borna are playing a short game on a two-variable polynomial. It's a special kind of a polynomial: the monomials are fixed, but all of its coefficients are fill-in-the-blanks dashes, e.g. $$$$$$ _ xy + _ x^4 y^7 + _ x^8 y^3 + ldots $$$$$$ Borna will fill in the blanks with positive integers. He wants the polynom...
3,400
true
false
false
false
false
false
false
false
false
false
5,465
830D
Problem - 830D - Codeforces =============== xa0 ]( --- Finished → Virtual participation Virtual contest is a way to take part in past contest, as close as possible to participation on time. It is supported only ICPC mode for virtual contests. If you've seen these problems, a virtual contest is not for you - s...
2,800
false
false
false
true
false
false
false
false
false
true
6,444
1696B
For a collection of integers $$$S$$$, define $$$operatorname{mex}(S)$$$ as the smallest non-negative integer that does not appear in $$$S$$$. NIT, the cleaver, decides to destroy the universe. He is not so powerful as Thanos, so he can only destroy the universe by snapping his fingers several times. The universe can be...
900
false
true
false
false
false
false
false
false
false
false
2,107
433A
Problem - 433A - Codeforces =============== xa0 ]( --- Finished → Virtual participation Virtual contest is a way to take part in past contest, as close as possible to participation on time. It is supported only ICPC mode for virtual contests. If you've seen these problems, a virtual contest is not for you - s...
1,100
false
false
true
false
false
false
true
false
false
false
8,109
1895E
Monocarp and Bicarp are playing a card game. Each card has two parameters: an attack value and a defence value. A card $$$s$$$ beats another card $$$t$$$ if the attack of $$$s$$$ is strictly greater than the defence of $$$t$$$. Monocarp has $$$n$$$ cards, the $$$i$$$-th of them has an attack value of $$$mathit{ax}_i$$$...
2,300
false
true
false
true
true
false
true
true
true
true
940
1985C
Alex thinks some array is good if there exists some element that can be represented as the sum of all other elements (the sum of all other elements is $$$0$$$ if there are no other elements). For example, the array $$$[1,6,3,2]$$$ is good since $$$1+3+2=6$$$. Furthermore, the array $$$[0]$$$ is also good. However, the ...
1,000
false
true
false
false
false
false
false
false
false
false
372
413D
The programmers from the R2 company love playing 2048. One day, they decided to invent their own simplified version of this game — 2_k_ on a stripe. Imagine an infinite in one direction stripe, consisting of unit squares (the side of each square is equal to the height of the stripe). Each square can either be empty or ...
2,000
false
false
false
true
false
false
false
false
false
false
8,171
743B
Chloe, the same as Vladik, is a competitive programmer. She didn't have any problems to get to the olympiad like Vladik, but she was confused by the task proposed on the olympiad. Let's consider the following algorithm of generating a sequence of integers. Initially we have a sequence consisting of a single element equ...
1,200
false
false
true
false
false
true
false
true
false
false
6,828
1821D
You are playing with a really long strip consisting of $$$10^{18}$$$ white cells, numbered from left to right as $$$0$$$, $$$1$$$, $$$2$$$ and so on. You are controlling a special pointer that is initially in cell $$$0$$$. Also, you have a "Shift" button you can press and hold. In one move, you can do one of three acti...
1,900
true
true
false
false
false
false
true
true
false
false
1,354
1714F
A tree is a connected undirected graph without cycles. Note that in this problem, we are talking about not rooted trees. You are given four positive integers $$$n, d_{12}, d_{23}$$$ and $$$d_{31}$$$. Construct a tree such that: it contains $$$n$$$ vertices numbered from $$$1$$$ to $$$n$$$, the distance (length of the...
1,900
false
false
true
false
false
true
false
false
false
false
1,995
379F
You are a programmer and you have a New Year Tree (not the traditional fur tree, though) — a tree of four vertices: one vertex of degree three (has number 1), connected with three leaves (their numbers are from 2 to 4). On the New Year, programmers usually have fun. You decided to have fun as well by adding vertices to...
2,400
false
false
false
false
true
false
false
false
false
false
8,312
639C
Limak is a little polar bear. He doesn't have many toys and thus he often plays with polynomials. He considers a polynomial valid if its degree is _n_ and its coefficients are integers not exceeding _k_ by the absolute value. More formally: Let _a_0,u2009_a_1,u2009...,u2009_a__n_ denote the coefficients, so . Then, a p...
2,200
true
false
true
false
false
false
false
false
false
false
7,255
4A
Problem - 4A - Codeforces =============== xa0 ]( --- Finished → Virtual participation Virtual contest is a way to take part in past contest, as close as possible to participation on time. It is supported only ICPC mode for virtual contests. If you've seen these problems, a virtual contest is not for you - sol...
800
true
false
false
false
false
false
true
false
false
false
9,974
1375D
1,900
false
false
false
false
false
true
true
false
true
false
3,784
1070C
Buber is a Berland technology company that specializes in waste of investor's money. Recently Buber decided to transfer its infrastructure to a cloud. The company decided to rent CPU cores in the cloud for $$$n$$$ consecutive days, which are numbered from $$$1$$$ to $$$n$$$. Buber requires $$$k$$$ CPU cores each day. T...
2,000
false
true
false
false
true
false
false
false
false
false
5,365
618F
You are given two multisets _A_ and _B_. Each multiset has exactly _n_ integers each between 1 and _n_ inclusive. Multisets may contain multiple copies of the same number. You would like to find a nonempty subset of _A_ and a nonempty subset of _B_ such that the sum of elements in these subsets are equal. Subsets are a...
3,000
false
false
false
false
false
true
false
false
false
false
7,359
1619H
You are given a permutation $$$p$$$ of $$$n$$$ elements. A permutation of $$$n$$$ elements is an array of length $$$n$$$ containing each integer from $$$1$$$ to $$$n$$$ exactly once. For example, $$$[1, 2, 3]$$$ and $$$[4, 3, 5, 1, 2]$$$ are permutations, but $$$[1, 2, 4]$$$ and $$$[4, 3, 2, 1, 2]$$$ are not permutatio...
2,400
false
false
false
false
true
false
true
false
false
false
2,528
1326C
You are given a permutation $$$p_1, p_2, ldots, p_n$$$ of integers from $$$1$$$ to $$$n$$$ and an integer $$$k$$$, such that $$$1 leq k leq n$$$. A permutation means that every number from $$$1$$$ to $$$n$$$ is contained in $$$p$$$ exactly once. Let's consider all partitions of this permutation into $$$k$$$ disjoint se...
1,300
true
true
false
false
false
false
false
false
false
false
4,085
362B
Problem - 362B - Codeforces =============== xa0 ]( --- Finished → Virtual participation Virtual contest is a way to take part in past contest, as close as possible to participation on time. It is supported only ICPC mode for virtual contests. If you've seen these problems, a virtual contest is not for you - s...
1,100
false
false
true
false
false
false
false
false
true
false
8,386
543D
The country has _n_ cities and _n_u2009-u20091 bidirectional roads, it is possible to get from every city to any other one if you move only along the roads. The cities are numbered with integers from 1 to _n_ inclusive. All the roads are initially bad, but the government wants to improve the state of some roads. We wil...
2,300
false
false
false
true
false
false
false
false
false
false
7,666
1430B
You have $$$n$$$ barrels lined up in a row, numbered from left to right from one. Initially, the $$$i$$$-th barrel contains $$$a_i$$$ liters of water. You can pour water from one barrel to another. In one act of pouring, you can choose two different barrels $$$x$$$ and $$$y$$$ (the $$$x$$$-th barrel shouldn't be empty)...
800
false
true
true
false
false
false
false
false
true
false
3,515
346E
In Doodle Jump the aim is to guide a four-legged creature called "The Doodler" up a never-ending series of platforms without falling. — Wikipedia. It is a very popular game and xiaodao likes it very much. One day when playing the game she wondered whether there exists a platform that the doodler couldn't reach due to t...
3,000
true
false
false
false
false
false
false
false
false
false
8,445
1391C
A permutation of length $$$n$$$ is an array consisting of $$$n$$$ distinct integers from $$$1$$$ to $$$n$$$ in arbitrary order. For example, $$$[2,3,1,5,4]$$$ is a permutation, but $$$[1,2,2]$$$ is not a permutation ($$$2$$$ appears twice in the array) and $$$[1,3,4]$$$ is also not a permutation ($$$n=3$$$ but there is...
1,500
true
false
false
true
false
false
false
false
false
true
3,719
679C
You have a grid with _n_ rows and _n_ columns. Each cell is either empty (denoted by '.') or blocked (denoted by 'X'). Two empty cells are directly connected if they share a side. Two cells (_r_1,u2009_c_1) (located in the row _r_1 and column _c_1) and (_r_2,u2009_c_2) are connected if there exists a sequence of empty ...
2,400
false
false
true
false
false
false
false
false
false
false
7,108
1848C
Vika came to her favorite cosmetics store "Golden Pear". She noticed that the prices of $$$n$$$ items have changed since her last visit. She decided to analyze how much the prices have changed and calculated the difference between the old and new prices for each of the $$$n$$$ items. Vika enjoyed calculating the price ...
1,800
true
false
false
false
false
false
false
false
false
false
1,192
29B
Problem - 29B - Codeforces =============== xa0 ]( --- Finished → Virtual participation Virtual contest is a way to take part in past contest, as close as possible to participation on time. It is supported only ICPC mode for virtual contests. If you've seen these problems, a virtual contest is not for you - so...
1,500
false
false
true
false
false
false
false
false
false
false
9,852
336D
Vasily the Bear loves beautiful strings. String _s_ is beautiful if it meets the following criteria: 1. String _s_ only consists of characters 0 and 1, at that character 0 must occur in string _s_ exactly _n_ times, and character 1 must occur exactly _m_ times. 2. We can obtain character _g_ from string _s_ with some (...
2,100
true
false
false
false
false
false
false
false
false
false
8,489
837D
Problem - 837D - Codeforces =============== xa0 . The second line contains _n_ space-separated integer numbers _a_1,u2009_a_2,u2009...,u2009_a__n_ (1u2009≤u2009_a__i_u2009≤u20091018). Output Print maximal roundness of product of the chosen subset of length _k_. Examples Input 3 2 50 4 20 Output 3 Input...
2,100
true
false
false
true
false
false
false
false
false
false
6,418
623B
You are given array _a__i_ of length _n_. You may consecutively apply two operations to this array: remove some subsegment (continuous subsequence) of length _m_u2009<u2009_n_ and pay for it _m_·_a_ coins; change some elements of the array by at most 1, and pay _b_ coins for each change. Please note that each of oper...
2,300
false
true
false
true
false
false
false
false
false
false
7,339
689B
Recently, Mike was very busy with studying for exams and contests. Now he is going to chill a bit by doing some sight seeing in the city. City consists of _n_ intersections numbered from 1 to _n_. Mike starts walking from his house located at the intersection number 1 and goes along some sequence of intersections. Walk...
1,600
false
true
false
false
false
false
false
false
false
true
7,068
1362C
The last contest held on Johnny's favorite competitive programming platform has been received rather positively. However, Johnny's rating has dropped again! He thinks that the presented tasks are lovely, but don't show the truth about competitors' skills. The boy is now looking at the ratings of consecutive participant...
1,400
true
true
false
false
false
false
false
false
false
false
3,869
1600E
Problem - 1600E - Codeforces =============== xa0 ]( --- Finished → Virtual participation Virtual contest is a way to take part in past contest, as close as possible to participation on time. It is supported only ICPC mode for virtual contests. If you've seen these problems, a virtual contest is not for you - ...
1,900
false
true
false
false
false
false
false
false
false
false
2,654
131B
Everybody knows that opposites attract. That is the key principle of the "Perfect Matching" dating agency. The "Perfect Matching" matchmakers have classified each registered customer by his interests and assigned to the _i_-th client number _t__i_ (u2009-u200910u2009≤u2009_t__i_u2009≤u200910). Of course, one number can...
1,200
true
false
true
false
false
false
false
false
false
false
9,352
1538F
Problem - 1538F - Codeforces =============== xa0 ]( --- Finished → Virtual participation Virtual contest is a way to take part in past contest, as close as possible to participation on time. It is supported only ICPC mode for virtual contests. If you've seen these problems, a virtual contest is not for you - ...
1,500
true
false
false
true
false
false
false
true
false
false
2,950
1328B
For the given integer $$$n$$$ ($$$n > 2$$$) let's write down all the strings of length $$$n$$$ which contain $$$n-2$$$ letters 'a' and two letters 'b' in lexicographical (alphabetical) order. Recall that the string $$$s$$$ of length $$$n$$$ is lexicographically less than string $$$t$$$ of length $$$n$$$, if there exist...
1,300
true
false
true
false
false
false
true
true
false
false
4,070
959A
Problem - 959A - Codeforces =============== xa0 ]( --- Finished → Virtual participation Virtual contest is a way to take part in past contest, as close as possible to participation on time. It is supported only ICPC mode for virtual contests. If you've seen these problems, a virtual contest is not for you - s...
800
true
false
false
false
false
false
false
false
false
false
5,877
411C
Kicker (table football) is a board game based on football, in which players control the footballers' figures mounted on rods by using bars to get the ball into the opponent's goal. When playing two on two, one player of each team controls the goalkeeper and the full-backs (plays defence), the other player controls the ...
1,700
false
false
true
false
false
false
false
false
false
false
8,180
722E
Unfortunately, the formal description of the task turned out to be too long, so here is the legend. Research rover finally reached the surface of Mars and is ready to complete its mission. Unfortunately, due to the mistake in the navigation system design, the rover is located in the wrong place. The rover will operate ...
2,900
false
false
false
true
false
false
false
false
false
false
6,922
1747E
For given integers $$$n$$$ and $$$m$$$, let's call a pair of arrays $$$a$$$ and $$$b$$$ of integers good, if they satisfy the following conditions: $$$a$$$ and $$$b$$$ have the same length, let their length be $$$k$$$. $$$k ge 2$$$ and $$$a_1 = 0, a_k = n, b_1 = 0, b_k = m$$$. For each $$$1 < i le k$$$ the following...
2,900
true
false
false
true
false
false
false
false
false
false
1,798
846A
Hideo Kojima has just quit his job at Konami. Now he is going to find a new place to work. Despite being such a well-known person, he still needs a CV to apply for a job. During all his career Hideo has produced _n_ games. Some of them were successful, some were not. Hideo wants to remove several of them (possibly zero...
1,500
false
false
true
false
false
false
true
false
false
false
6,377
1686A
You are given an array of $$$n$$$ integers $$$a_1, a_2, ldots, a_n$$$. After you watched the amazing film "Everything Everywhere All At Once", you came up with the following operation. In one operation, you choose $$$n-1$$$ elements of the array and replace each of them with their arithmetic mean (which doesn't have to...
800
false
true
false
false
false
false
false
false
false
false
2,159
1735B
There are $$$n$$$ pieces of tangerine peel, the $$$i$$$-th of them has size $$$a_i$$$. In one step it is possible to divide one piece of size $$$x$$$ into two pieces of positive integer sizes $$$y$$$ and $$$z$$$ so that $$$y + z = x$$$. You want that for each pair of pieces, their sizes differ strictly less than twice....
900
true
true
false
false
false
false
false
false
false
false
1,879
977A
Problem - 977A - Codeforces =============== xa0 ]( --- Finished → Virtual participation Virtual contest is a way to take part in past contest, as close as possible to participation on time. It is supported only ICPC mode for virtual contests. If you've seen these problems, a virtual contest is not for you - s...
800
false
false
true
false
false
false
false
false
false
false
5,824
1428D
To improve the boomerang throwing skills of the animals, Zookeeper has set up an $$$n imes n$$$ grid with some targets, where each row and each column has at most $$$2$$$ targets each. The rows are numbered from $$$1$$$ to $$$n$$$ from top to bottom, and the columns are numbered from $$$1$$$ to $$$n$$$ from left to ri...
1,900
false
true
true
false
false
true
false
false
false
false
3,522
1107A
You are given a sequence $$$s$$$ consisting of $$$n$$$ digits from $$$1$$$ to $$$9$$$. You have to divide it into at least two segments (segment — is a consecutive sequence of elements) (in other words, you have to place separators between some digits of the sequence) in such a way that each element belongs to exactly ...
900
false
true
false
false
false
false
false
false
false
false
5,169
95D
Petya likes horse racing very much. Horses numbered from _l_ to _r_ take part in the races. Petya wants to evaluate the probability of victory; for some reason, to do that he needs to know the amount of nearly lucky horses' numbers. A nearly lucky number is an integer number that has at least two lucky digits the dista...
2,500
true
false
false
true
false
false
false
false
false
false
9,505
922B
Problem - 922B - Codeforces =============== xa0 ]( --- Finished → Virtual participation Virtual contest is a way to take part in past contest, as close as possible to participation on time. It is supported only ICPC mode for virtual contests. If you've seen these problems, a virtual contest is not for you - s...
1,300
false
false
false
false
false
false
true
false
false
false
6,028
1768A
You are given an integer $$$k$$$. Find the largest integer $$$x$$$, where $$$1 le x < k$$$, such that $$$x! + (x - 1)!^dagger$$$ is a multiple of $$$^ddagger$$$ $$$k$$$, or determine that no such $$$x$$$ exists. $$$^dagger$$$ $$$y!$$$ denotes the factorial of $$$y$$$, which is defined recursively as $$$y! = y cdot (y-1...
800
true
true
false
false
false
false
false
false
false
false
1,691
1742F
Alperen has two strings, $$$s$$$ and $$$t$$$ which are both initially equal to "a". He will perform $$$q$$$ operations of two types on the given strings: $$$1 ;; k ;; x$$$ — Append the string $$$x$$$ exactly $$$k$$$ times at the end of string $$$s$$$. In other words, $$$s := s + underbrace{x + dots + x}_{k ext{ times...
1,500
false
true
false
false
false
true
false
false
false
false
1,826
327A
Problem - 327A - Codeforces =============== xa0 ]( --- Finished → Virtual participation Virtual contest is a way to take part in past contest, as close as possible to participation on time. It is supported only ICPC mode for virtual contests. If you've seen these problems, a virtual contest is not for you - s...
1,200
false
false
true
true
false
false
true
false
false
false
8,536
1017D
Childan is making up a legendary story and trying to sell his forgeryxa0— a necklace with a strong sense of "Wu" to the Kasouras. But Mr. Kasoura is challenging the truth of Childan's story. So he is going to ask a few questions about Childan's so-called "personal treasure" necklace. This "personal treasure" is a multi...
1,900
false
false
false
false
true
false
true
false
false
false
5,602
613A
Peter got a new snow blower as a New Year present. Of course, Peter decided to try it immediately. After reading the instructions he realized that it does not work like regular snow blowing machines. In order to make it work, you need to tie it to some point that it does not cover, and then switch it on. As a result it...
1,900
false
false
false
false
false
false
false
true
false
false
7,387
1966A
You have a hand of $$$n$$$ cards, where each card has a number written on it, and a fixed integer $$$k$$$. You can perform the following operation any number of times: Choose any $$$k$$$ cards from your hand that all have the same number. Exchange these cards for $$$k-1$$$ cards, each of which can have any number you...
800
false
true
false
false
false
true
false
false
false
false
510
193E
Problem - 193E - Codeforces =============== xa0 ]( --- Finished → Virtual participation Virtual contest is a way to take part in past contest, as close as possible to participation on time. It is supported only ICPC mode for virtual contests. If you've seen these problems, a virtual contest is not for you - s...
2,900
true
false
false
false
false
false
true
false
false
false
9,066
1393E1
This is an easier version of the problem E with smaller constraints. Twilight Sparkle has received a new task from Princess Celestia. This time she asked to decipher the ancient scroll containing important knowledge of pony origin. To hide the crucial information from evil eyes, pony elders cast a spell on the scroll. ...
2,800
false
false
true
true
false
false
false
false
false
false
3,703
1404D
This is an interactive problem. Consider a fixed positive integer $$$n$$$. Two players, First and Second play a game as follows: 1. First considers the $$$2n$$$ numbers $$$1, 2, dots, 2n$$$, and partitions them as he wants into $$$n$$$ disjoint pairs. 2. Then, Second chooses exactly one element from each of the pairs t...
2,800
true
false
false
false
false
true
false
false
false
false
3,650
1027G
The campus has $$$m$$$ rooms numbered from $$$0$$$ to $$$m - 1$$$. Also the $$$x$$$-mouse lives in the campus. The $$$x$$$-mouse is not just a mouse: each second $$$x$$$-mouse moves from room $$$i$$$ to the room $$$i cdot x mod{m}$$$ (in fact, it teleports from one room to another since it doesn't visit any intermediat...
2,600
true
false
false
false
false
false
false
false
false
false
5,570
741C
Note that girls in Arpa’s land are really attractive. Arpa loves overnight parties. In the middle of one of these parties Mehrdad suddenly appeared. He saw _n_ pairs of friends sitting around a table. _i_-th pair consisted of a boy, sitting on the _a__i_-th chair, and his girlfriend, sitting on the _b__i_-th chair. The...
2,600
false
false
false
false
false
true
false
false
false
true
6,834
2038K
Problem - 2038K - Codeforces =============== xa0 ]( --- Finished → Virtual participation Virtual contest is a way to take part in past contest, as close as possible to participation on time. It is supported only ICPC mode for virtual contests. If you've seen these problems, a virtual contest is not for you - ...
2,100
true
true
false
true
false
false
true
false
false
false
28
1388B
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. ...
1,000
true
true
false
false
false
false
false
false
false
false
3,732
1615H
There are $$$n$$$ reindeer at the North Pole, all battling for the highest spot on the "Top Reindeer" leaderboard on the front page of CodeNorses (a popular competitive reindeer gaming website). Interestingly, the "Top Reindeer" title is just a measure of upvotes and has nothing to do with their skill level in the rein...
3,000
false
false
false
false
true
true
false
true
false
true
2,557
1438D
Ksenia has an array $$$a$$$ consisting of $$$n$$$ positive integers $$$a_1, a_2, ldots, a_n$$$. In one operation she can do the following: choose three distinct indices $$$i$$$, $$$j$$$, $$$k$$$, and then change all of $$$a_i, a_j, a_k$$$ to $$$a_i oplus a_j oplus a_k$$$ simultaneously, where $$$oplus$$$ denotes the ...
2,200
true
false
false
false
false
true
false
false
false
false
3,475
1773I
Oh no, this wicked jury hides something from you again, and you need to guess it interactively. This time, you need to find an integer $$$n$$$. To do that, you can make at most 10 queries of the form "Whatxa0is the $$$k$$$-th decimal digit of the product of all integers from 1 to $$$n$$$ (also known as factorial and de...
2,500
false
false
true
false
false
false
true
false
false
false
1,648
177D1
The Smart Beaver from ABBYY invented a new message encryption method and now wants to check its performance. Checking it manually is long and tiresome, so he decided to ask the ABBYY Cup contestants for help. A message is a sequence of _n_ integers _a_1,u2009_a_2,u2009...,u2009_a__n_. Encryption uses a key which is a s...
1,200
false
false
false
false
false
false
true
false
false
false
9,148
137A
Polycarpus has postcards and photos hung in a row on the wall. He decided to put them away to the closet and hang on the wall a famous painter's picture. Polycarpus does it like that: he goes from the left to the right and removes the objects consecutively. As Polycarpus doesn't want any mix-ups to happen, he will not ...
900
false
false
true
false
false
false
false
false
false
false
9,330
1312D
Problem - 1312D - Codeforces =============== xa0 ]( --- Finished → Virtual participation Virtual contest is a way to take part in past contest, as close as possible to participation on time. It is supported only ICPC mode for virtual contests. If you've seen these problems, a virtual contest is not for you - ...
1,700
true
false
false
false
false
false
false
false
false
false
4,134
1411A
Problem - 1411A - Codeforces =============== xa0 and Technocup 2021 — Elimination Round 3") Editorial") '. The message is bad if the number of characters ')' at the end of the string strictly greater than the number of remaining characters. For example, the string ")bc)))" has three parentheses at the end...
800
false
false
true
false
false
false
false
false
false
false
3,621
1167A
A telephone number is a sequence of exactly 11 digits, where the first digit is 8. For example, the sequence 80011223388 is a telephone number, but the sequences 70011223388 and 80000011223388 are not. You are given a string $$$s$$$ of length $$$n$$$, consisting of digits. In one operation you can delete any character ...
800
false
true
false
false
false
false
true
false
false
false
4,883
1870G
Let's define $$$f(S)$$$. Let $$$S$$$ be a multiset (i.e., it can contain repeated elements) of non-negative integers. In one operation, you can choose any non-empty subset of $$$S$$$ (which can also contain repeated elements), remove this subset (all elements in it) from $$$S$$$, and add the MEX of the removed subset t...
3,300
false
false
false
false
true
false
false
false
false
false
1,053
1561D1
This version of the problem differs from the next one only in the constraint on $$$n$$$. Note that the memory limit in this problem is lower than in others. You have a vertical strip with $$$n$$$ cells, numbered consecutively from $$$1$$$ to $$$n$$$ from top to bottom. You also have a token that is initially placed in ...
1,700
true
false
false
true
true
false
true
false
false
false
2,821
1722B
Vasya has a grid with $$$2$$$ rows and $$$n$$$ columns. He colours each cell red, green, or blue. Vasya is colourblind and can't distinguish green from blue. Determine if Vasya will consider the two rows of the grid to be coloured the same. Input The input consists of multiple test cases. The first line contains an int...
800
false
false
true
false
false
false
false
false
false
false
1,952
689C
Bad news came to Mike's village, some thieves stole a bunch of chocolates from the local factory! Horrible! Aside from loving sweet things, thieves from this area are known to be very greedy. So after a thief takes his number of chocolates for himself, the next thief will take exactly _k_ times more than the previous o...
1,700
true
false
false
false
false
false
false
true
false
false
7,067
617E
Bob has a favorite number _k_ and _a__i_ of length _n_. Now he asks you to answer _m_ queries. Each query is given by a pair _l__i_ and _r__i_ and asks you to count the number of pairs of integers _i_ and _j_, such that _l_u2009≤u2009_i_u2009≤u2009_j_u2009≤u2009_r_ and the xor of the numbers _a__i_,u2009_a__i_u2009+u20...
2,200
false
false
false
false
true
false
false
false
false
false
7,365
848C
I won't feel lonely, nor will I be sorrowful... not before everything is buried. A string of _n_ beads is left as the message of leaving. The beads are numbered from 1 to _n_ from left to right, each having a shape numbered by integers between 1 and _n_ inclusive. Some beads may have the same shapes. The memory of a sh...
2,600
false
false
false
false
true
false
false
false
false
false
6,356
79A
Problem - 79A - Codeforces =============== xa0 ") and _y_ (0u2009≤u2009_y_u2009≤u2009106), separated by a single space. Output If Ciel wins, print "Ciel". Otherwise, print "Hanako". Examples Input 2 2 Output Ciel Input 3 22 Output Hanako Note In the first turn (Ciel's turn), she will choose 2 100-...
1,200
false
true
false
false
false
false
false
false
false
false
9,570
840A
Problem - 840A - Codeforces =============== xa0 ]( --- Finished → Virtual participation Virtual contest is a way to take part in past contest, as close as possible to participation on time. It is supported only ICPC mode for virtual contests. If you've seen these problems, a virtual contest is not for you - s...
1,300
true
true
false
false
false
false
false
false
true
false
6,403
1850E
Mircea has $$$n$$$ pictures. The $$$i$$$-th picture is a square with a side length of $$$s_i$$$ centimeters. He mounted each picture on a square piece of cardboard so that each picture has a border of $$$w$$$ centimeters of cardboard on all sides. In total, he used $$$c$$$ square centimeters of cardboard. Given the pic...
1,100
true
false
true
false
false
false
false
true
false
false
1,178
1437E
You are given an array of $$$n$$$ integers $$$a_1$$$, $$$a_2$$$, ..., $$$a_n$$$, and a set $$$b$$$ of $$$k$$$ distinct integers from $$$1$$$ to $$$n$$$. In one operation, you may choose two integers $$$i$$$ and $$$x$$$ ($$$1 le i le n$$$, $$$x$$$ can be any integer) and assign $$$a_i := x$$$. This operation can be done...
2,200
false
false
true
true
true
true
false
true
false
false
3,481
213B
Problem - 213B - Codeforces =============== xa0 ]( --- Finished → Virtual participation Virtual contest is a way to take part in past contest, as close as possible to participation on time. It is supported only ICPC mode for virtual contests. If you've seen these problems, a virtual contest is not for you - s...
1,900
false
false
false
true
false
false
false
false
false
false
8,987
443B
Problem - 443B - Codeforces =============== xa0 ]( --- Finished → Virtual participation Virtual contest is a way to take part in past contest, as close as possible to participation on time. It is supported only ICPC mode for virtual contests. If you've seen these problems, a virtual contest is not for you - s...
1,500
false
false
true
false
false
false
true
false
false
false
8,064
573C
Limak is a little bear who learns to draw. People usually start with houses, fences and flowers but why would bears do it? Limak lives in the forest and he decides to draw a tree. Recall that tree is a connected graph consisting of _n_ vertices and _n_u2009-u20091 edges. Limak chose a tree with _n_ vertices. He has inf...
2,300
false
false
false
false
false
true
false
false
false
false
7,557
1283A
Problem - 1283A - Codeforces =============== xa0 ]( --- Finished → Virtual participation Virtual contest is a way to take part in past contest, as close as possible to participation on time. It is supported only ICPC mode for virtual contests. If you've seen these problems, a virtual contest is not for you - ...
800
true
false
false
false
false
false
false
false
false
false
4,280
2008A
Today, Sakurako has a math exam. The teacher gave the array, consisting of $$$a$$$ ones and $$$b$$$ twos. In an array, Sakurako must place either a '+' or a '-' in front of each element so that the sum of all elements in the array equals $$$0$$$. Sakurako is not sure if it is possible to solve this problem, so determin...
800
true
true
false
false
false
true
true
false
false
false
208
1121B
Mike decided to teach programming to children in an elementary school. He knows that it is not an easy task to interest children in that age to code. That is why he decided to give each child two sweets. Mike has $$$n$$$ sweets with sizes $$$a_1, a_2, ldots, a_n$$$. All his sweets have different sizes. That is, there i...
1,200
false
false
true
false
false
false
true
false
false
false
5,079
1930H
This is an interactive problem. Alice has a tree $$$T$$$ consisting of $$$n$$$ nodes, numbered from $$$1$$$ to $$$n$$$. Alice will show $$$T$$$ to Bob. After observing $$$T$$$, Bob needs to tell Alice two permutations $$$p_1$$$ and $$$p_2$$$ of $$$[1, 2, ldots, n]$$$. Then, Alice will play $$$q$$$ rounds of the followi...
3,300
false
false
false
false
false
true
false
false
false
false
703
1436B
Problem - 1436B - Codeforces =============== xa0 ]( --- Finished → Virtual participation Virtual contest is a way to take part in past contest, as close as possible to participation on time. It is supported only ICPC mode for virtual contests. If you've seen these problems, a virtual contest is not for you - ...
900
true
false
false
false
false
true
false
false
false
false
3,490
1473A
You have an array $$$a_1, a_2, dots, a_n$$$. All $$$a_i$$$ are positive integers. In one step you can choose three distinct indices $$$i$$$, $$$j$$$, and $$$k$$$ ($$$i eq j$$$; $$$i eq k$$$; $$$j eq k$$$) and assign the sum of $$$a_j$$$ and $$$a_k$$$ to $$$a_i$$$, i.xa0e. make $$$a_i = a_j + a_k$$$. Can you make all...
800
true
true
true
false
false
false
false
false
true
false
3,317