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
729D
Galya is playing one-dimensional Sea Battle on a 1u2009×u2009_n_ grid. In this game _a_ ships are placed on the grid. Each of the ships consists of _b_ consecutive cells. No cell can be part of two ships, however, the ships can touch each other. Galya doesn't know the ships location. She can shoot to some cells and aft...
1,700
true
true
false
false
false
true
false
false
false
false
6,891
1051E
Vasya owns three big integers — $$$a, l, r$$$. Let's define a partition of $$$x$$$ such a sequence of strings $$$s_1, s_2, dots, s_k$$$ that $$$s_1 + s_2 + dots + s_k = x$$$, where $$$+$$$ is a concatanation of strings. $$$s_i$$$ is the $$$i$$$-th element of the partition. For example, number $$$12345$$$ has the follow...
2,600
false
false
false
true
true
false
false
true
false
false
5,451
1854C
You have a set $$$S$$$ of $$$n$$$ distinct integers between $$$1$$$ and $$$m$$$. Each second you do the following steps: 1. Pick an element $$$x$$$ in $$$S$$$ uniformly at random. 2. Remove $$$x$$$ from $$$S$$$. 3. If $$$x+1 leq m$$$ and $$$x+1$$$ is not in $$$S$$$, add $$$x+1$$$ to $$$S$$$. What is the expected number...
2,500
true
false
false
true
false
false
false
false
false
false
1,156
1213G
You are given a weighted tree consisting of $$$n$$$ vertices. Recall that a tree is a connected graph without cycles. Vertices $$$u_i$$$ and $$$v_i$$$ are connected by an edge with weight $$$w_i$$$. You are given $$$m$$$ queries. The $$$i$$$-th query is given as an integer $$$q_i$$$. In this query you need to calculate...
1,800
false
false
false
false
false
false
false
false
true
true
4,612
681D
Sasha lives in a big happy family. At the Man's Day all the men of the family gather to celebrate it following their own traditions. There are _n_ men in Sasha's family, so let's number them with integers from 1 to _n_. Each man has at most one father but may have arbitrary number of sons. Man number _A_ is considered ...
2,000
false
false
false
false
false
true
false
false
false
true
7,100
1679F
Yura is a mathematician, and his cognition of the world is so absolute as if he have been solving formal problems a hundred of trillions of billions of years. This problem is just that! Consider all non-negative integers from the interval $$$[0, 10^{n})$$$. For convenience we complement all numbers with leading zeros i...
2,600
true
false
false
true
false
false
false
false
false
false
2,192
1609F
Problem - 1609F - 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,800
false
false
false
false
true
false
false
false
false
false
2,603
1067C
Ivan places knights on infinite chessboard. Initially there are $$$n$$$ knights. If there is free cell which is under attack of at least $$$4$$$ knights then he places new knight in this cell. Ivan repeats this until there are no such free cells. One can prove that this process is finite. One can also prove that positi...
2,600
false
false
false
false
false
true
false
false
false
false
5,373
1692A
You are given four distinct integers $$$a$$$, $$$b$$$, $$$c$$$, $$$d$$$. Timur and three other people are running a marathon. The value $$$a$$$ is the distance that Timur has run and $$$b$$$, $$$c$$$, $$$d$$$ correspond to the distances the other three participants ran. Output the number of participants in front of Tim...
800
false
false
true
false
false
false
false
false
false
false
2,130
36E
Once archaeologists found _m_ mysterious papers, each of which had a pair of integers written on them. Ancient people were known to like writing down the indexes of the roads they walked along, as «_a_ _b_» or «_b_ _a_», where _a_,u2009_b_ are the indexes of two different cities joint by the road . It is also known tha...
2,600
false
false
true
false
false
true
false
false
false
true
9,814
241G
Martha — as a professional problemsetter — proposed a problem for a world-class contest. This is the problem statement: Tomorrow is Nadia's birthday, and Bardia (her brother) is assigned to make the balloons ready! There are _n_ balloons (initially empty) that are tied to a straight line on certain positions _x_1,u2009...
1,900
false
false
false
false
false
true
false
false
false
false
8,869
363C
Problem - 363C - 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,400
false
true
true
false
false
false
false
false
false
false
8,380
2002H
It's been a long summer's day, with the constant chirping of cicadas and the heat which never seemed to end. Finally, it has drawn to a close. The showdown has passed, the gates are open, and only a gentle breeze is left behind. Your predecessors had taken their final bow; it's your turn to take the stage. Sorting thro...
3,500
false
true
false
false
false
false
false
false
false
false
240
1866A
Chaneka, Pak Chanek's child, is an ambitious kid, so Pak Chanek gives her the following problem to test her ambition. Given an array of integers $$$[A_1, A_2, A_3, ldots, A_N]$$$. In one operation, Chaneka can choose one element, then increase or decrease the element's value by $$$1$$$. Chaneka can do that operation mu...
800
true
false
false
false
false
false
false
false
false
false
1,088
1707A
Doremy is asked to test $$$n$$$ contests. Contest $$$i$$$ can only be tested on day $$$i$$$. The difficulty of contest $$$i$$$ is $$$a_i$$$. Initially, Doremy's IQ is $$$q$$$. On day $$$i$$$ Doremy will choose whether to test contest $$$i$$$ or not. She can only test a contest if her current IQ is strictly greater than...
1,600
false
true
true
false
false
true
false
true
false
false
2,034
546A
Problem - 546A - 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
true
false
false
false
true
false
false
false
7,657
999D
You are given an array consisting of $$$n$$$ integers $$$a_1, a_2, dots, a_n$$$, and a positive integer $$$m$$$. It is guaranteed that $$$m$$$ is a divisor of $$$n$$$. In a single move, you can choose any position $$$i$$$ between $$$1$$$ and $$$n$$$ and increase $$$a_i$$$ by $$$1$$$. Let's calculate $$$c_r$$$ ($$$0 le ...
1,900
false
true
true
false
true
false
false
false
false
false
5,708
1797B
Li Hua has a pattern of size $$$n imes n$$$, each cell is either blue or red. He can perform exactly $$$k$$$ operations. In each operation, he chooses a cell and changes its color from red to blue or from blue to red. Each cell can be chosen as many times as he wants. Is it possible to make the pattern, that matches it...
1,100
false
true
false
false
false
true
false
false
false
false
1,495
1665A
You are given a positive integer $$$n$$$. You have to find $$$4$$$ positive integers $$$a, b, c, d$$$ such that $$$a + b + c + d = n$$$, and $$$gcd(a, b) = operatorname{lcm}(c, d)$$$. If there are several possible answers you can output any of them. It is possible to show that the answer always exists. In this proble...
800
true
false
false
false
false
true
false
false
false
false
2,290
1922A
You are given an integer $$$n$$$ and three strings $$$a, b, c$$$, each consisting of $$$n$$$ lowercase Latin letters. Let a template be a string $$$t$$$ consisting of $$$n$$$ lowercase and/or uppercase Latin letters. The string $$$s$$$ matches the template $$$t$$$ if the following conditions hold for all $$$i$$$ from $...
800
false
false
true
false
false
true
false
false
false
false
758
1847A
Kars is tired and resentful of the narrow mindset of his village since they are content with staying where they are and are not trying to become the perfect life form. Being a top-notch inventor, Kars wishes to enhance his body and become the perfect life form. Unfortunately, $$$n$$$ of the villagers have become suspic...
800
false
true
false
false
false
false
false
false
true
false
1,200
1305F
Kuroni is very angry at the other setters for using him as a theme! As a punishment, he forced them to solve the following problem: You have an array $$$a$$$ consisting of $$$n$$$ positive integers. An operation consists of choosing an element and either adding $$$1$$$ to it or subtracting $$$1$$$ from it, such that th...
2,500
true
false
false
false
false
false
false
false
false
false
4,159
149D
Once Petya read a problem about a bracket sequence. He gave it much thought but didn't find a solution. Today you will face it. You are given string _s_. It represents a correct bracket sequence. A correct bracket sequence is the sequence of opening ("(") and closing (")") brackets, such that it is possible to obtain a...
1,900
false
false
false
true
false
false
false
false
false
false
9,278
1033C
After a long day, Alice and Bob decided to play a little game. The game board consists of $$$n$$$ cells in a straight line, numbered from $$$1$$$ to $$$n$$$, where each cell contains a number $$$a_i$$$ between $$$1$$$ and $$$n$$$. Furthermore, no two cells contain the same number. A token is placed in one of the cells....
1,600
false
false
false
true
false
false
true
false
false
false
5,533
1734F
Enter Register HOME TOP CATALOG CONTESTS GYM PROBLEMSET GROUPS RATING EDU API CALENDAR HELP RAYAN Codeforces Round 822 (Div. 2) 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...
2,500
true
false
false
true
false
false
false
false
false
false
1,881
727C
This is an interactive problem. You should use flush operation after each printed line. For example, in C++ you should use fflush(stdout), in Java you should use System.out.flush(), and in Pascalxa0— flush(output). In this problem you should guess an array _a_ which is unknown for you. The only information you have ini...
1,400
true
false
false
false
false
true
false
false
false
false
6,898
1567E
Alice has recently received an array $$$a_1, a_2, dots, a_n$$$ for her birthday! She is very proud of her array, and when she showed her friend Bob the array, he was very happy with her present too! However, soon Bob became curious, and as any sane friend would do, asked Alice to perform $$$q$$$ operations of two types...
2,200
true
false
false
false
true
false
false
false
false
false
2,800
1392H
zscoder has a deck of $$$n+m$$$ custom-made cards, which consists of $$$n$$$ cards labelled from $$$1$$$ to $$$n$$$ and $$$m$$$ jokers. Since zscoder is lonely, he wants to play a game with himself using those cards. Initially, the deck is shuffled uniformly randomly and placed on the table. zscoder has a set $$$S$$$ w...
3,000
true
false
false
true
false
false
false
false
false
false
3,709
612B
HDD hard drives group data by sectors. All files are split to fragments and each of them are written in some sector of hard drive. Note the fragments can be written in sectors in arbitrary order. One of the problems of HDD hard drives is the following: the magnetic head should move from one sector to another to read so...
1,200
true
false
true
false
false
false
false
false
false
false
7,392
1862B
Tema and Vika are playing the following game. First, Vika comes up with a sequence of positive integers $$$a$$$ of length $$$m$$$ and writes it down on a piece of paper. Then she takes a new piece of paper and writes down the sequence $$$b$$$ according to the following rule: First, she writes down $$$a_1$$$. Then, sh...
800
false
false
false
false
false
true
false
false
false
false
1,112
788B
Little boy Igor wants to become a traveller. At first, he decided to visit all the cities of his motherlandxa0— Uzhlyandia. It is widely known that Uzhlyandia has _n_ cities connected with _m_ bidirectional roads. Also, there are no two roads in the country that connect the same pair of cities, but roads starting and e...
2,100
false
false
false
false
false
true
false
false
false
true
6,620
1646E
Problem - 1646E - 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,200
true
false
false
true
false
false
true
false
false
false
2,391
614B
It's the year 4527 and the tanks game that we all know and love still exists. There also exists Great Gena's code, written in 2016. The problem this code solves is: given the number of tanks that go into the battle from each country, find their product. If it is turns to be too large, then the servers might have not en...
1,400
true
false
true
false
false
false
false
false
false
false
7,381
1573A
You are given a digital clock with $$$n$$$ digits. Each digit shows an integer from $$$0$$$ to $$$9$$$, so the whole clock shows an integer from $$$0$$$ to $$$10^n-1$$$. The clock will show leading zeroes if the number is smaller than $$$10^{n-1}$$$. You want the clock to show $$$0$$$ with as few operations as possible...
800
false
true
false
false
false
false
false
false
false
false
2,776
1991A
You are given an array $$$a$$$ of $$$n$$$ integers, where $$$n$$$ is odd. In one operation, you will remove two adjacent elements from the array $$$a$$$, and then concatenate the remaining parts of the array. For example, given the array $$$[4,7,4,2,9]$$$, we can obtain the arrays $$$[4,2,9]$$$ and $$$[4,7,9]$$$ by the...
800
false
true
true
false
false
false
false
false
false
false
328
1562E
Morning desert sun horizonRise above the sands of time... Fates Warning, "Exodus" After crossing the Windswept Wastes, Ori has finally reached the Windtorn Ruins to find the Heart of the Forest! However, the ancient repository containing this priceless Willow light did not want to open! Ori was taken aback, but the Voi...
2,500
false
true
false
true
false
false
false
false
false
false
2,815
1637F
You are given a tree with $$$n$$$ vertices numbered from $$$1$$$ to $$$n$$$. The height of the $$$i$$$-th vertex is $$$h_i$$$. You can place any number of towers into vertices, for each tower you can choose which vertex to put it in, as well as choose its efficiency. Setting up a tower with efficiency $$$e$$$ costs $$$...
2,500
false
true
false
true
false
true
false
false
false
false
2,429
140E
As Gerald, Alexander, Sergey and Gennady are already busy with the usual New Year chores, Edward hastily decorates the New Year Tree. And any decent New Year Tree must be decorated with a good garland. Edward has lamps of _m_ colors and he wants to make a garland from them. That garland should represent a sequence whos...
2,600
false
false
false
true
false
false
false
false
false
false
9,314
1584E
Bob decided to take a break from calculus homework and designed a game for himself. The game is played on a sequence of piles of stones, which can be described with a sequence of integers $$$s_1, ldots, s_k$$$, where $$$s_i$$$ is the number of stones in the $$$i$$$-th pile. On each turn, Bob picks a pair of non-empty a...
2,300
false
true
false
false
true
false
false
true
false
false
2,705
926J
Problem - 926J - Codeforces =============== xa0 . → Problem tags data structures *2100 No tag edit access → Contest materials . In particular, if one segment ends in a point _x_, and another segment starts in the point _x_, these two segments belong to the same connected component. Input The first l...
2,100
false
false
false
false
true
false
false
false
false
false
5,996
1028H
We call an array $$$b_1, b_2, ldots, b_m$$$ good, if there exist two indices $$$i < j$$$ such that $$$b_i cdot b_j$$$ is a $$$ be the minimum number of actions needed to make the array $$$b$$$ good. You are given an array of $$$n$$$ integers $$$a_1, a_2, ldots, a_n$$$ and $$$q$$$ queries of the form $$$l_i, r_i$$$. For...
2,900
true
false
false
false
false
false
false
false
false
false
5,562
1668B
$$$m$$$ chairs are arranged in a circle sequentially. The chairs are numbered from $$$0$$$ to $$$m-1$$$. $$$n$$$ people want to sit in these chairs. The $$$i$$$-th of them wants at least $$$a[i]$$$ empty chairs both on his right and left side. More formally, if the $$$i$$$-th person sits in the $$$j$$$-th chair, then n...
900
true
true
false
false
false
false
false
false
true
false
2,266
1468N
The progress is not standing still in Berland. Recently all garbage containers in Bertown, the capital of Berland, were replaced by differentiated recycling bins, each accepting some category of waste. While this will definitely improve the ecological situation, for some citizens it's difficult to get used to the habit...
900
false
true
true
false
false
false
false
false
false
false
3,339
208D
Vasya, like many others, likes to participate in a variety of sweepstakes and lotteries. Now he collects wrappings from a famous chocolate bar "Jupiter". According to the sweepstake rules, each wrapping has an integer written on it — the number of points that the participant adds to his score as he buys the bar. After ...
1,200
false
false
true
false
false
false
false
false
false
false
8,998
847F
The elections to Berland parliament are happening today. Voting is in full swing! Totally there are _n_ candidates, they are numbered from 1 to _n_. Based on election results _k_ (1u2009≤u2009_k_u2009≤u2009_n_) top candidates will take seats in the parliament. After the end of the voting the number of votes for each ca...
2,100
false
true
false
false
false
false
false
false
true
false
6,366
1288B
Problem - 1288B - 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,100
true
false
false
false
false
false
false
false
false
false
4,251
1793A
The famous store "Second Food" sells groceries only two days a month. And the prices in each of days differ. You wanted to buy $$$n$$$ kilos of potatoes for a month. You know that on the first day of the month $$$1$$$ kilo of potatoes costs $$$a$$$ coins, and on the second day $$$b$$$ coins. In "Second Food" you can bu...
800
true
true
false
false
false
false
false
false
false
false
1,520
533D
We have an old building with _n_u2009+u20092 columns in a row. These columns support the ceiling. These columns are located in points with coordinates 0u2009=u2009_x_0u2009<u2009_x_1u2009<u2009...u2009<u2009_x__n_u2009<u2009_x__n_u2009+u20091. The leftmost and the rightmost columns are special, we will call them bearin...
3,000
false
false
false
true
true
false
false
false
false
false
7,704
1594B
Problem - 1594B - 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,100
true
false
false
false
false
false
false
false
false
false
2,677
718A
Efim just received his grade for the last test. He studies in a special school and his grade can be equal to any positive decimal fraction. First he got disappointed, as he expected a way more pleasant result. Then, he developed a tricky plan. Each second, he can ask his teacher to round the grade at any place after th...
1,700
true
false
true
true
false
false
false
false
false
false
6,943
493D
Vasya decided to learn to play chess. Classic chess doesn't seem interesting to him, so he plays his own sort of chess. The queen is the piece that captures all squares on its vertical, horizontal and diagonal lines. If the cell is located on the same vertical, horizontal or diagonal line with queen, and the cell conta...
1,700
true
false
false
false
false
true
false
false
false
false
7,860
452E
Problem - 452E - Codeforces =============== xa0 ]( "Announcement of Round 1") . For each integer _l_ (1u2009≤u2009_l_u2009≤u2009_min_(_s_1,u2009_s_2,u2009_s_3) you need to find how many triples (_i_1,u2009_i_2,u2009_i_3) exist such that three strings _s__k_
2,400
false
false
false
false
true
false
false
false
false
false
8,028
417D
A boy named Gena really wants to get to the "Russian Code Cup" finals, or at least get a t-shirt. But the offered problems are too complex, so he made an arrangement with his _n_ friends that they will solve the problems for him. The participants are offered _m_ problems on the contest. For each friend, Gena knows what...
1,900
false
true
false
true
false
false
false
false
true
false
8,154
910A
A frog lives on the axis _Ox_ and needs to reach home which is in the point _n_. She starts from the point 1. The frog can jump to the right at a distance not more than _d_. So, after she jumped from the point _x_ she can reach the point _x_u2009+u2009_a_, where _a_ is an integer from 1 to _d_. For each point from 1 to...
800
false
true
true
true
false
false
false
false
false
false
6,106
29A
Problem - 29A - 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,000
false
false
false
false
false
false
true
false
false
false
9,853
1971A
Problem - 1971A - 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
false
false
true
false
false
false
false
false
true
false
465
743C
Problem - 743C - 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
true
false
false
false
false
true
true
false
false
false
6,827
1819C
The fox Yae climbed the tree of the Sacred Sakura. A tree is a connected undirected graph that does not contain cycles. The fox uses her magical powers to move around the tree. Yae can jump from vertex $$$v$$$ to another vertex $$$u$$$ if and only if the distance between these vertices does not exceed $$$2$$$. In other...
2,400
true
false
true
true
false
true
false
false
false
false
1,363
811D
This is an interactive problem. Vladik has favorite game, in which he plays all his free time. Game field could be represented as _n_u2009×u2009_m_ matrix which consists of cells of three types: «.» — normal cell, player can visit it. «F» — finish cell, player has to finish his way there to win. There is exactly one ...
2,100
false
false
false
false
false
true
false
false
false
true
6,518
706E
Vasiliy finally got to work, where there is a huge amount of tasks waiting for him. Vasiliy is given a matrix consisting of _n_ rows and _m_ columns and _q_ tasks. Each task is to swap two submatrices of the given matrix. For each task Vasiliy knows six integers _a__i_, _b__i_, _c__i_, _d__i_, _h__i_, _w__i_, where _a_...
2,500
false
false
true
false
true
false
false
false
false
false
6,995
1346A
Hmm, how long has it been since the last color revolution? 5 years?! It's totally the time to make a new one! So the general idea is the following. Division $$$1$$$ should have $$$n_1$$$ participants. Division $$$2$$$ should have $$$n_2$$$ and be exactly $$$k$$$ times bigger than division $$$1$$$ ($$$n_2 = k cdot n_1$$...
1,000
true
false
false
false
false
false
false
false
false
false
3,979
1984F
There is a hidden array $$$a_1, a_2, ldots, a_n$$$ of length $$$n$$$ whose elements are integers between $$$-m$$$ and $$$m$$$, inclusive. You are given an array $$$b_1, b_2, ldots, b_n$$$ of length $$$n$$$ and a string $$$s$$$ of length $$$n$$$ consisting of the characters $$$ exttt{P}$$$, $$$ exttt{S}$$$, and $$$ extt...
2,500
true
false
false
true
false
false
true
false
false
false
377
1004F
Sonya has an array $$$a_1, a_2, ldots, a_n$$$ consisting of $$$n$$$ integers and also one non-negative integer $$$x$$$. She has to perform $$$m$$$ queries of two types: $$$1$$$ $$$i$$$ $$$y$$$: replace $$$i$$$-th element by value $$$y$$$, i.e. to perform an operation $$$a_{i}$$$ := $$$y$$$; $$$2$$$ $$$l$$$ $$$r$$$: f...
2,600
false
false
false
false
true
false
false
false
false
false
5,663
263B
Problem - 263B - 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...
900
false
true
true
false
false
false
false
false
true
false
8,782
285E
Problem - 285E - 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
true
false
false
true
false
false
false
false
false
false
8,692
750H
Pay attention to the output section below, where you will see the information about flushing the output. Bearland is a grid with _h_ rows and _w_ columns. Rows are numbered 1 through _h_ from top to bottom. Columns are numbered 1 through _w_ from left to right. Every cell is either allowed (denoted by '.' in the input)...
3,500
false
false
false
false
false
false
false
false
false
true
6,786
830B
Vasily has a deck of cards consisting of _n_ cards. There is an integer on each of the cards, this integer is between 1 and 100u2009000, inclusive. It is possible that some cards have the same integers on them. Vasily decided to sort the cards. To do this, he repeatedly takes the top card from the deck, and if the numb...
1,600
false
false
true
false
true
false
false
false
true
false
6,446
1025D
Dima the hamster enjoys nibbling different things: cages, sticks, bad problemsetters and even trees! Recently he found a binary search tree and instinctively nibbled all of its edges, hence messing up the vertices. Dima knows that if Andrew, who has been thoroughly assembling the tree for a long time, comes home and se...
2,100
true
false
false
true
false
false
true
false
false
false
5,580
1608E
On an endless checkered sheet of paper, $$$n$$$ cells are chosen and colored in three colors, where $$$n$$$ is divisible by $$$3$$$. It turns out that there are exactly $$$frac{n}{3}$$$ marked cells of each of three colors! Find the largest such $$$k$$$ that it's possible to choose $$$frac{k}{3}$$$ cells of each color,...
2,800
false
false
true
false
false
false
false
true
true
false
2,611
2038N
Problem - 2038N - 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
false
false
true
false
false
false
false
false
false
false
25
1684A
There is an integer $$$n$$$ without zeros in its decimal representation. Alice and Bob are playing a game with this integer. Alice starts first. They play the game in turns. On her turn, Alice must swap any two digits of the integer that are on different positions. Bob on his turn always removes the last digit of the i...
800
true
false
false
false
false
true
false
false
false
false
2,173
1760A
Problem - 1760A - 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
false
false
true
false
false
false
false
false
true
false
1,755
1921C
Stepan is a very busy person. Today he needs to send $$$n$$$ messages at moments $$$m_1, m_2, dots m_n$$$ ($$$m_i < m_{i + 1}$$$). Unfortunately, by the moment $$$0$$$, his phone only has $$$f$$$ units of charge left. At the moment $$$0$$$, the phone is turned on. The phone loses $$$a$$$ units of charge for each unit o...
900
true
true
false
false
false
false
false
false
false
false
763
493B
Vasya has become interested in wrestling. In wrestling wrestlers use techniques for which they are awarded points by judges. The wrestler who gets the most points wins. When the numbers of points of both wrestlers are equal, the wrestler whose sequence of points is lexicographically greater, wins. If the sequences of t...
1,400
false
false
true
false
false
false
false
false
false
false
7,862
1547D
A sequence of non-negative integers $$$a_1, a_2, dots, a_n$$$ is called growing if for all $$$i$$$ from $$$1$$$ to $$$n - 1$$$ all ones (of binary representation) in $$$a_i$$$ are in the places of ones (of binary representation) in $$$a_{i + 1}$$$ (in other words, $$$a_i :&: a_{i + 1} = a_i$$$, where $$$&$$$ denotes . ...
1,300
false
true
false
false
false
true
false
false
false
false
2,910
1801A
Kirill wants to weave the very beautiful blanket consisting of $$$n imes m$$$ of the same size square patches of some colors. He matched some non-negative integer to each color. Thus, in our problem, the blanket can be considered a $$$B$$$ matrix of size $$$n imes m$$$ consisting of non-negative integers. Kirill cons...
1,600
false
false
false
false
false
true
false
false
false
false
1,466
245A
Polycarpus is a system administrator. There are two servers under his strict guidance — _a_ and _b_. To stay informed about the servers' performance, Polycarpus executes commands "ping a" and "ping b". Each ping command sends exactly ten packets to the server specified in the argument of the command. Executing a progra...
800
false
false
true
false
false
false
false
false
false
false
8,856
1607E
The robot is located on a checkered rectangular board of size $$$n imes m$$$ ($$$n$$$ rows, $$$m$$$ columns). The rows in the board are numbered from $$$1$$$ to $$$n$$$ from top to bottom, and the columnsxa0— from $$$1$$$ to $$$m$$$ from left to right. The robot is able to move from the current cell to one of the four...
1,600
false
false
true
false
false
false
false
false
false
false
2,619
1340A
Denis was very sad after Nastya rejected him. So he decided to walk through the gateways to have some fun. And luck smiled at him! When he entered the first courtyard, he met a strange man who was selling something. Denis bought a mysterious item and it was... Random permutation generator! Denis could not believed his ...
1,500
false
true
true
false
true
false
true
false
false
false
4,007
1628C
Enter Register HOME TOP CATALOG CONTESTS GYM PROBLEMSET GROUPS RATING EDU API CALENDAR HELP RAYAN Codeforces Round 767 (Div. 1) 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...
2,300
true
true
true
false
false
true
false
false
false
false
2,473
1970C2
This is the medium version of the problem. The difference in this version is that $$$t=1$$$ and we work on trees. Ron and Hermione are playing a game on a tree of $$$n$$$ nodes that are initially inactive. The game consists of $$$t$$$ rounds, each of which starts with a stone on exactly one node, which is considered as...
1,700
false
false
false
true
false
false
false
false
false
false
479
1019D
Problem - 1019D - 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,700
false
false
false
false
false
false
false
true
true
false
5,594
1237H
You have two strings $$$a$$$ and $$$b$$$ of equal even length $$$n$$$ consisting of characters 0 and 1. We're in the endgame now. To finally make the universe perfectly balanced, you need to make strings $$$a$$$ and $$$b$$$ equal. In one step, you can choose any prefix of $$$a$$$ of even length and reverse it. Formally...
3,300
false
false
false
false
false
true
false
false
false
false
4,504
225C
You've got an _n_u2009×u2009_m_ pixel picture. Each pixel can be white or black. Your task is to change the colors of as few pixels as possible to obtain a barcode picture. A picture is a barcode if the following conditions are fulfilled: All pixels in each column are of the same color. The width of each monochrome v...
1,700
false
false
false
true
false
false
false
false
false
false
8,938
1264C
Creatnx has $$$n$$$ mirrors, numbered from $$$1$$$ to $$$n$$$. Every day, Creatnx asks exactly one mirror "Am I beautiful?". The $$$i$$$-th mirror will tell Creatnx that he is beautiful with probability $$$frac{p_i}{100}$$$ for all $$$1 le i le n$$$. Some mirrors are called checkpoints. Initially, only the $$$1$$$st mi...
2,400
false
false
false
false
true
false
false
false
false
false
4,379
1783A
An array $$$a$$$ is called ugly if it contains at least one element which is equal to the sum of all elements before it. If the array is not ugly, it is beautiful. For example: the array $$$[6, 3, 9, 6]$$$ is ugly: the element $$$9$$$ is equal to $$$6 + 3$$$; the array $$$[5, 5, 7]$$$ is ugly: the element $$$5$$$ (th...
800
true
false
false
false
false
true
false
false
true
false
1,579
1355B
Young wilderness explorers set off to their first expedition led by senior explorer Russell. Explorers went into a forest, set up a camp and decided to split into groups to explore as much interesting locations as possible. Russell was trying to form groups, but ran into some difficulties... Most of the young explorers...
1,200
false
true
false
true
false
false
false
false
true
false
3,930
1995A
Vitaly503 is given a checkered board with a side of $$$n$$$ and $$$k$$$ chips. He realized that all these $$$k$$$ chips need to be placed on the cells of the board (no more than one chip can be placed on a single cell). Let's denote the cell in the $$$i$$$-th row and $$$j$$$-th column as $$$(i ,j)$$$. A diagonal is the...
800
true
true
true
false
false
false
true
false
false
false
297
1158C
Vasya has written some permutation $$$p_1, p_2, ldots, p_n$$$ of integers from $$$1$$$ to $$$n$$$, so for all $$$1 leq i leq n$$$ it is true that $$$1 leq p_i leq n$$$ and all $$$p_1, p_2, ldots, p_n$$$ are different. After that he wrote $$$n$$$ numbers $$$next_1, next_2, ldots, next_n$$$. The number $$$next_i$$$ is eq...
2,100
true
true
false
false
true
true
false
false
true
true
4,913
1209H
Airports often use moving walkways to help you walking big distances faster. Each such walkway has some speed that effectively increases your speed. You can stand on such a walkway and let it move you, or you could also walk and then your effective speed is your walking speed plus walkway's speed. Limak wants to get fr...
3,300
true
true
false
false
true
false
false
false
false
false
4,637
1091A
Alice and Bob are decorating a Christmas Tree. Alice wants only $$$3$$$ types of ornaments to be used on the Christmas Tree: yellow, blue and red. They have $$$y$$$ yellow ornaments, $$$b$$$ blue ornaments and $$$r$$$ red ornaments. In Bob's opinion, a Christmas Tree will be beautiful if: the number of blue ornaments ...
800
true
false
true
false
false
false
true
false
false
false
5,259
1382A
You are given two arrays of integers $$$a_1,ldots,a_n$$$ and $$$b_1,ldots,b_m$$$. Your task is to find a non-empty array $$$c_1,ldots,c_k$$$ that is a subsequence of $$$a_1,ldots,a_n$$$, and also a subsequence of $$$b_1,ldots,b_m$$$. If there are multiple answers, find one of the smallest possible length. If there are ...
800
false
false
false
false
false
false
true
false
false
false
3,758
551A
Professor GukiZ likes programming contests. He especially likes to rate his students on the contests he prepares. Now, he has decided to prepare a new contest. In total, _n_ students will attend, and before the start, every one of them has some positive integer rating. Students are indexed from 1 to _n_. Let's denote t...
800
false
false
true
false
false
false
true
false
true
false
7,632
1579C
Enter Register HOME TOP CATALOG CONTESTS GYM PROBLEMSET GROUPS RATING EDU API CALENDAR HELP RAYAN Codeforces Round 744 (Div. 3) 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...
1,500
false
true
true
false
false
false
false
false
false
false
2,739
1802B
Dasha loves guinea pigs very much. In this regard, she decided to settle as many guinea pigs at home as possible and developed a plan for the next $$$n$$$ days. Every day, she will either buy a new guinea pig or call a doctor to examine all her pets. Unfortunately, the store where she was going to buy guinea pigs does ...
1,000
true
true
true
false
false
false
false
false
false
false
1,458
109C
Problem - 109C - 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
9,447
631A
Blake is a CEO of a large company called "Blake Technologies". He loves his company very much and he thinks that his company should be the best. That is why every candidate needs to pass through the interview that consists of the following problem. We define function _f_(_x_,u2009_l_,u2009_r_) as a bitwise OR of intege...
900
false
false
true
false
false
false
true
false
false
false
7,286
1941F
Rudolf has prepared a set of $$$n$$$ problems with complexities $$$a_1 < a_2 < a_3 < dots < a_n$$$. He is not entirely satisfied with the balance, so he wants to add at most one problem to fix it. For this, Rudolf came up with $$$m$$$ models of problems and $$$k$$$ functions. The complexity of the $$$i$$$-th model is $...
1,800
false
true
false
false
false
false
false
true
true
false
634
1203B
You are given $$$4n$$$ sticks, the length of the $$$i$$$-th stick is $$$a_i$$$. You have to create $$$n$$$ rectangles, each rectangle will consist of exactly $$$4$$$ sticks from the given set. The rectangle consists of four sides, opposite sides should have equal length and all angles in it should be right. Note that e...
1,200
true
true
false
false
false
false
false
false
false
false
4,682
245F
You've got a list of program warning logs. Each record of a log stream is a string in this format: "2012-MM-DD HH:MM:SS:MESSAGE" (without the quotes). String "MESSAGE" consists of spaces, uppercase and lowercase English letters and characters "!", ".", ",", "?". String "2012-MM-DD" determines a correct date in the year...
2,000
false
false
true
false
false
false
true
true
false
false
8,851