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
1840G1
The only difference between easy and hard versions is the maximum number of queries. In this version, you are allowed to ask at most $$$2023$$$ queries. This is an interactive problem. You are playing a game. The circle is divided into $$$n$$$ sectors, sectors are numbered from $$$1$$$ to $$$n$$$ in some order. You are...
2,200
true
false
false
false
false
true
false
false
false
false
1,247
1944A
There are $$$n$$$ islands, numbered $$$1, 2, ldots, n$$$. Initially, every pair of islands is connected by a bridge. Hence, there are a total of $$$frac{n (n - 1)}{2}$$$ bridges. Everule lives on island $$$1$$$ and enjoys visiting the other islands using bridges. Dominater has the power to destroy at most $$$k$$$ bridg...
800
true
true
false
false
false
false
false
false
false
true
615
1661D
You are given two arrays: an array $$$a$$$ consisting of $$$n$$$ zeros and an array $$$b$$$ consisting of $$$n$$$ integers. You can apply the following operation to the array $$$a$$$ an arbitrary number of times: choose some subsegment of $$$a$$$ of length $$$k$$$ and add the arithmetic progression $$$1, 2, ldots, k$$$...
1,900
false
true
false
false
true
false
false
false
false
false
2,316
1255A
Bob watches TV every day. He always sets the volume of his TV to $$$b$$$. However, today he is angry to find out someone has changed the volume to $$$a$$$. Of course, Bob has a remote control that can change the volume. There are six buttons ($$$-5, -2, -1, +1, +2, +5$$$) on the control, which in one press can either i...
800
true
false
false
false
false
false
false
false
false
false
4,410
1417B
RedDreamer has an array $$$a$$$ consisting of $$$n$$$ non-negative integers, and an unlucky integer $$$T$$$. Let's denote the misfortune of array $$$b$$$ having length $$$m$$$ as $$$f(b)$$$ β€” the number of pairs of integers $$$(i, j)$$$ such that $$$1 le i < j le m$$$ and $$$b_i + b_j = T$$$. RedDreamer has to paint ea...
1,100
true
true
false
false
false
false
false
false
true
false
3,595
1178F1
This is the first subtask of problem F. The only differences between this and the second subtask are the constraints on the value of $$$m$$$ and the time limit. You need to solve both subtasks in order to hack this one. There are $$$n+1$$$ distinct colours in the universe, numbered $$$0$$$ through $$$n$$$. There is a s...
2,200
false
false
false
true
false
false
false
false
false
false
4,825
1725J
One day, Pak Chanek who is already bored of being alone at home decided to go traveling. While looking for an appropriate place, he found that Londonesia has an interesting structure. According to the information gathered by Pak Chanek, there are $$$N$$$ cities numbered from $$$1$$$ to $$$N$$$. The cities are connected...
2,500
false
false
false
true
false
false
false
false
false
false
1,937
602A
After seeing the "ALL YOUR BASE ARE BELONG TO US" meme for the first time, numbers _X_ and _Y_ realised that they have different bases, which complicated their relations. You're given a number _X_ represented in base _b__x_ and a number _Y_ represented in base _b__y_. Compare those two numbers. Input The first line of ...
1,100
false
false
true
false
false
false
true
false
false
false
7,435
1726E
A permutation $$$p$$$ of length $$$n$$$ is called almost perfect if for all integer $$$1 leq i leq n$$$, it holds that $$$lvert p_i - p^{-1}_i vert le 1$$$, where $$$p^{-1}$$$ is the inverse permutation of $$$p$$$ (i.e. $$$p^{-1}_{k_1} = k_2$$$ if and only if $$$p_{k_2} = k_1$$$). Count the number of almost perfect pe...
2,400
true
false
false
false
false
false
false
false
false
false
1,929
513B2
Problem - 513B2 - Codeforces =============== xa0 ]( "16140") as the following sum: Find the lexicographically _m_-th permutation of length _n_ in the set of permutations having the maximum possible value of _f_(_p_). Input The single line of input contains two integers _n_ and _m_ (1u2009≀u2009_m_u2009≀u20...
1,800
true
false
false
false
false
false
false
false
false
false
7,791
1720B
You are given an array $$$a$$$ that contains $$$n$$$ integers. You can choose any proper subsegment $$$a_l, a_{l + 1}, ldots, a_r$$$ of this array, meaning you can choose any two integers $$$1 le l le r le n$$$, where $$$r - l + 1 < n$$$. We define the beauty of a given subsegment as the value of the following expressi...
800
true
true
false
false
true
false
true
false
true
false
1,964
1322D
A popular reality show is recruiting a new cast for the third season! $$$n$$$ candidates numbered from $$$1$$$ to $$$n$$$ have been interviewed. The candidate $$$i$$$ has aggressiveness level $$$l_i$$$, and recruiting this candidate will cost the show $$$s_i$$$ roubles. The show host reviewes applications of all candid...
2,800
false
false
false
true
false
false
false
false
false
false
4,104
933E
East or west, home is best. That's why family reunion, the indispensable necessity of Lunar New Year celebration, is put in such a position. After the reunion dinner, Little Tommy plays a game with the family. Here is a concise introduction to this game: 1. There is a sequence of _n_ non-negative integers _p_1,u2009_p_...
3,200
false
false
false
true
false
true
false
false
false
false
5,967
1556E
William has two arrays $$$a$$$ and $$$b$$$, each consisting of $$$n$$$ items. For some segments $$$l..r$$$ of these arrays William wants to know if it is possible to equalize the values of items in these segments using a balancing operation. Formally, the values are equalized if for each $$$i$$$ from $$$l$$$ to $$$r$$$...
2,200
false
true
false
true
true
false
false
false
false
false
2,851
1010E
Natasha was already going to fly back to Earth when she remembered that she needs to go to the Martian store to buy Martian souvenirs for her friends. It is known, that the Martian year lasts $$$x_{max}$$$ months, month lasts $$$y_{max}$$$ days, day lasts $$$z_{max}$$$ seconds. Natasha also knows that this store works ...
2,700
false
false
false
false
true
false
false
false
false
false
5,631
1111C
Thanos wants to destroy the avengers base, but he needs to destroy the avengers along with their base. Let we represent their base with an array, where each position can be occupied by many avengers, but one avenger can occupy only one position. Length of their base is a perfect power of $$$2$$$. Thanos wants to destro...
1,700
true
false
false
false
false
false
true
true
false
false
5,139
664A
Problem - 664A - 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
7,162
1472C
Polycarp found under the Christmas tree an array $$$a$$$ of $$$n$$$ elements and instructions for playing with it: At first, choose index $$$i$$$ ($$$1 leq i leq n$$$)xa0β€” starting position in the array. Put the chip at the index $$$i$$$ (on the value $$$a_i$$$). While $$$i leq n$$$, add $$$a_i$$$ to your score and m...
1,100
false
false
false
true
false
false
false
false
false
true
3,322
1980G
Yasya was walking in the forest and accidentally found a tree with $$$n$$$ vertices. A tree is a connected undirected graph with no cycles. Next to the tree, the girl found an ancient manuscript with $$$m$$$ queries written on it. The queries can be of two types. The first type of query is described by the integer $$$y...
2,300
false
true
false
false
true
false
false
false
false
true
403
727D
The organizers of a programming contest have decided to present t-shirts to participants. There are six different t-shirts sizes in this problem: S, M, L, XL, XXL, XXXL (sizes are listed in increasing order). The t-shirts are already prepared. For each size from S to XXXL you are given the number of t-shirts of this si...
1,800
false
true
false
false
false
true
false
false
false
false
6,897
1862G
Tema bought an old device with a small screen and a worn-out inscription "The Great Equalizer" on the side. The seller said that the device needs to be given an array $$$a$$$ of integers as input, after which "The Great Equalizer" will work as follows: 1. Sort the current array in non-decreasing order and remove duplic...
2,000
true
false
false
false
true
false
false
true
true
false
1,107
198C
Qwerty the Ranger arrived to the Diatar system with a very important task. He should deliver a special carcinogen for scientific research to planet Persephone. This is urgent, so Qwerty has to get to the planet as soon as possible. A lost day may fail negotiations as nobody is going to pay for an overdue carcinogen. Yo...
2,400
false
false
false
false
false
false
false
true
false
false
9,049
1603C
For an array $$$b$$$ of $$$n$$$ integers, the extreme value of this array is the minimum number of times (possibly, zero) the following operation has to be performed to make $$$b$$$ non-decreasing: Select an index $$$i$$$ such that $$$1 le i le b$$$, where $$$b$$$ is the current length of $$$b$$$. Replace $$$b_i$$$ w...
2,300
true
true
false
true
false
false
false
false
false
false
2,641
1637A
You have an array $$$a$$$ of length $$$n$$$. You can exactly once select an integer $$$len$$$ between $$$1$$$ and $$$n - 1$$$ inclusively, and then sort in non-decreasing order the prefix of the array of length $$$len$$$ and the suffix of the array of length $$$n - len$$$ independently. For example, if the array is $$$...
800
false
false
false
false
false
false
true
false
true
false
2,434
1458E
After your debut mobile game "Nim" blew up, you decided to make a sequel called "Nim 2". This game will expand on the trusted Nim game formula, adding the much awaited second heap! In the game, there are two heaps, each containing a non-negative number of stones. Two players make moves in turn. On their turn, a player ...
3,100
false
false
false
false
true
false
false
false
false
false
3,390
1569D
There is a city that can be represented as a square grid with corner points in $$$(0, 0)$$$ and $$$(10^6, 10^6)$$$. The city has $$$n$$$ vertical and $$$m$$$ horizontal streets that goes across the whole city, i.xa0e. the $$$i$$$-th vertical streets goes from $$$(x_i, 0)$$$ to $$$(x_i, 10^6)$$$ and the $$$j$$$-th horiz...
1,900
false
false
true
false
true
false
false
true
true
false
2,795
505C
The Shuseki Islands are an archipelago of 30001 small islands in the Yutampo Sea. The islands are evenly spaced along a line, numbered from 0 to 30000 from the west to the east. These islands are known to contain many treasures. There are _n_ gems in the Shuseki Islands in total, and the _i_-th gem is located on island...
1,900
false
false
false
true
false
false
false
false
false
false
7,821
707B
Masha wants to open her own bakery and bake muffins in one of the _n_ cities numbered from 1 to _n_. There are _m_ bidirectional roads, each of whose connects some pair of cities. To bake muffins in her bakery, Masha needs to establish flour supply from some storage. There are only _k_ storages, located in different ci...
1,300
false
false
false
false
false
false
false
false
false
true
6,993
1485A
Problem - 1485A - 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,000
true
true
false
false
false
false
true
false
false
false
3,259
915A
Luba thinks about watering her garden. The garden can be represented as a segment of length _k_. Luba has got _n_ buckets, the _i_-th bucket allows her to water some continuous subsegment of garden of length exactly _a__i_ each hour. Luba can't water any parts of the garden that were already watered, also she can't wat...
900
false
false
true
false
false
false
false
false
false
false
6,075
1881A
Given a string $$$x$$$ of length $$$n$$$ and a string $$$s$$$ of length $$$m$$$ ($$$n cdot m le 25$$$), consisting of lowercase Latin letters, you can apply any number of operations to the string $$$x$$$. In one operation, you append the current value of $$$x$$$ to the end of the string $$$x$$$. Note that the value of ...
800
false
false
false
false
false
false
true
false
false
false
1,004
776F
Sherlock met Moriarty for a final battle of wits. He gave him a regular _n_ sided convex polygon. In addition to it, he gave him certain diagonals to form regions on the polygon. It was guaranteed that the diagonals did not intersect in interior points. He took each of the region and calculated its importance value. Im...
2,800
false
false
true
false
true
true
false
false
false
true
6,663
1923A
There is a ribbon divided into $$$n$$$ cells, numbered from $$$1$$$ to $$$n$$$ from left to right. Each cell either contains a chip or is free. You can perform the following operation any number of times (possibly zero): choose a chip and move it to the closest free cell to the left. You can choose any chip that you wa...
800
false
true
true
false
false
false
false
false
false
false
752
183D
You are going to work in Codeforces as an intern in a team of _n_ engineers, numbered 1 through _n_. You want to give each engineer a souvenir: a T-shirt from your country (T-shirts are highly desirable in Codeforces). Unfortunately you don't know the size of the T-shirt each engineer fits in. There are _m_ different s...
2,700
false
true
false
true
false
false
false
false
false
false
9,106
1714E
You are given an array of $$$n$$$ integers $$$a_1, a_2, dots, a_n$$$ You can apply the following operation an arbitrary number of times: select an index $$$i$$$ ($$$1 le i le n$$$) and replace the value of the element $$$a_i$$$ with the value $$$a_i + (a_i bmod 10)$$$, where $$$a_i bmod 10$$$ is the remainder of the i...
1,400
true
false
false
false
false
false
true
false
false
false
1,996
1641E
You are given an array $$$a$$$ of length $$$n$$$. Also you are given $$$m$$$ distinct positions $$$p_1, p_2, ldots, p_m$$$ ($$$1 leq p_i leq n$$$). A non-empty subset of these positions $$$T$$$ is randomly selected with equal probability and the following value is calculated: $$$$$$sum_{i=1}^{n} (a_i cdot min_{j in T} ...
3,300
true
false
false
false
false
false
false
false
false
false
2,405
903A
Problem - 903A - 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
false
false
6,134
1902D
There is an infinite $$$2$$$-dimensional grid. Initially, a robot stands in the point $$$(0, 0)$$$. The robot can execute four commands: Uxa0β€” move from point $$$(x, y)$$$ to $$$(x, y + 1)$$$; Dxa0β€” move from point $$$(x, y)$$$ to $$$(x, y - 1)$$$; Lxa0β€” move from point $$$(x, y)$$$ to $$$(x - 1, y)$$$; Rxa0β€” move ...
1,900
false
false
true
true
true
false
false
true
false
false
900
1168A
Toad Zitz has an array of integers, each integer is between $$$0$$$ and $$$m-1$$$ inclusive. The integers are $$$a_1, a_2, ldots, a_n$$$. In one operation Zitz can choose an integer $$$k$$$ and $$$k$$$ indices $$$i_1, i_2, ldots, i_k$$$ such that $$$1 leq i_1 < i_2 < ldots < i_k leq n$$$. He should then change $$$a_{i_...
1,700
false
true
false
false
false
false
false
true
false
false
4,876
292B
This problem uses a simplified network topology model, please read the problem statement carefully and use it as a formal document as you develop the solution. Polycarpus continues working as a system administrator in a large corporation. The computer network of this corporation consists of _n_ computers, some of them ...
1,200
false
false
true
false
false
false
false
false
false
true
8,665
1334B
Many years ago Berland was a small country where only $$$n$$$ people lived. Each person had some savings: the $$$i$$$-th one had $$$a_i$$$ burles. The government considered a person as wealthy if he had at least $$$x$$$ burles. To increase the number of wealthy people Berland decided to carry out several reforms. Each ...
1,100
false
true
false
false
false
false
false
false
true
false
4,036
117A
And now the numerous qualifying tournaments for one of the most prestigious Russian contests Russian Codec Cup are over. All _n_ participants who have made it to the finals found themselves in a huge _m_-floored 108-star hotel. Of course the first thought to come in a place like this is "How about checking out the elev...
1,300
true
false
true
false
false
false
false
false
false
false
9,421
2036E
Enter Register HOME TOP CATALOG CONTESTS GYM PROBLEMSET GROUPS RATING EDU API CALENDAR HELP RAYAN Codeforces Round 984 (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,600
false
true
false
false
true
true
false
true
false
false
48
1475C
At the school where Vasya is studying, preparations are underway for the graduation ceremony. One of the planned performances is a ball, which will be attended by pairs of boys and girls. Each class must present two couples to the ball. In Vasya's class, $$$a$$$ boys and $$$b$$$ girls wish to participate. But not all b...
1,400
true
false
false
false
false
false
false
false
false
true
3,302
1211I
Ivan on his birthday was presented with array of non-negative integers $$$a_1, a_2, ldots, a_n$$$. He immediately noted that all $$$a_i$$$ satisfy the condition $$$0 leq a_i leq 15$$$. Ivan likes graph theory very much, so he decided to transform his sequence to the graph. There will be $$$n$$$ vertices in his graph, a...
3,000
false
false
false
false
false
false
false
false
false
true
4,620
1492B
You have a deck of $$$n$$$ cards, and you'd like to reorder it to a new one. Each card has a value between $$$1$$$ and $$$n$$$ equal to $$$p_i$$$. All $$$p_i$$$ are pairwise distinct. Cards in a deck are numbered from bottom to top, i.xa0e. $$$p_1$$$ stands for the bottom card, $$$p_n$$$ is the top card. In each step y...
1,100
true
true
false
false
true
false
false
false
false
false
3,212
923C
Alice has a very important message _M_ consisting of some non-negative integers that she wants to keep secret from Eve. Alice knows that the only theoretically secure cipher is one-time pad. Alice generates a random key _K_ of the length equal to the message's length. Alice computes the bitwise xor of each element of t...
1,800
false
true
false
false
true
false
false
false
false
false
6,021
53E
Life in Bertown has become hard. The city has too many roads and the government spends too much to maintain them. There are _n_ junctions and _m_ two way roads, at which one can get from each junction to any other one. The mayor wants to close some roads so that the number of roads left totaled to _n_u2009-u20091 roads...
2,500
false
false
false
true
false
false
false
false
false
false
9,706
2003C
Turtle gives you a string $$$s$$$, consisting of lowercase Latin letters. Turtle considers a pair of integers $$$(i, j)$$$ ($$$1 le i < j le n$$$) to be a pleasant pair if and only if there exists an integer $$$k$$$ such that $$$i le k < j$$$ and both of the following two conditions hold: $$$s_k e s_{k + 1}$$$; $$$s...
1,200
false
true
false
false
false
true
false
false
true
false
237
1500E
Vanya invented an interesting trick with a set of integers. Let an illusionist have a set of positive integers $$$S$$$. He names a positive integer $$$x$$$. Then an audience volunteer must choose some subset (possibly, empty) of $$$S$$$ without disclosing it to the illusionist. The volunteer tells the illusionist the s...
3,300
false
false
false
false
true
false
false
true
false
false
3,164
1838A
Two integers were written on a blackboard. After that, the following step was carried out $$$n-2$$$ times: Select any two integers on the board, and write the absolute value of their difference on the board. After this process was complete, the list of $$$n$$$ integers was shuffled. You are given the final list. Recov...
800
true
false
false
false
false
true
false
false
false
false
1,264
768C
Jon Snow now has to fight with White Walkers. He has _n_ rangers, each of which has his own strength. Also Jon Snow has his favourite number _x_. Each ranger can fight with a white walker only if the strength of the white walker equals his strength. He however thinks that his rangers are weak and need to improve. Jon n...
1,800
false
false
true
true
false
false
true
false
true
false
6,711
1901B
There is a ribbon divided into $$$n$$$ cells, numbered from $$$1$$$ to $$$n$$$ from left to right. Initially, an integer $$$0$$$ is written in each cell. Monocarp plays a game with a chip. The game consists of several turns. During the first turn, Monocarp places the chip in the $$$1$$$-st cell of the ribbon. During ea...
1,100
true
true
false
false
false
false
false
false
false
false
908
598E
You have a rectangular chocolate bar consisting of _n_u2009Γ—u2009_m_ single squares. You want to eat exactly _k_ squares, so you may need to break the chocolate bar. In one move you can break any single rectangular piece of chocolate in two rectangular pieces. You can break only by lines between squares: horizontally o...
2,000
false
false
false
true
false
false
true
false
false
false
7,453
1750A
You are given a permutation $$$a_1, a_2, ldots, a_n$$$ of size $$$n$$$, where each integer from $$$1$$$ to $$$n$$$ appears exactly once. You can do the following operation any number of times (possibly, zero): Choose any three indices $$$i, j, k$$$ ($$$1 le i < j < k le n$$$). If $$$a_i > a_k$$$, replace $$$a_i$$$ wi...
800
true
false
true
false
false
true
false
false
false
false
1,785
384A
Problem - 384A - 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
8,293
1482H
This year a Chunin Selection Exam is held again in Konoha, and taking part in it are $$$n$$$ ninjas named $$$s_1$$$, $$$s_2$$$, ..., $$$s_n$$$. All names are distinct. One of the exam stages consists of fights between the participants. This year the rules determining the ninjas for each fight are the following: ninjas ...
3,400
false
false
false
false
true
false
false
false
false
false
3,260
294D
Shaass thinks a kitchen with all white floor tiles is so boring. His kitchen floor is made of _n_Β·_m_ square tiles forming a _n_u2009Γ—u2009_m_ rectangle. Therefore he's decided to color some of the tiles in black so that the floor looks like a checkerboard, which is no two side-adjacent tiles should have the same color...
2,500
false
false
true
false
false
false
true
false
false
false
8,653
540E
Problem - 540E - 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,100
false
false
true
false
true
false
false
true
true
false
7,676
2033B
During her journey with Kosuke, Sakurako and Kosuke found a valley that can be represented as a matrix of size $$$n imes n$$$, where at the intersection of the $$$i$$$-th row and the $$$j$$$-th column is a mountain with a height of $$$a_{i,j}$$$. If $$$a_{i,j} < 0$$$, then there is a lake there. Kosuke is very afraid ...
900
false
true
false
false
false
true
true
false
false
false
67
1476E
You are given $$$n$$$ patterns $$$p_1, p_2, dots, p_n$$$ and $$$m$$$ strings $$$s_1, s_2, dots, s_m$$$. Each pattern $$$p_i$$$ consists of $$$k$$$ characters that are either lowercase Latin letters or wildcard characters (denoted by underscores). All patterns are pairwise distinct. Each string $$$s_j$$$ consists of $$$...
2,300
false
false
false
false
true
false
false
false
true
true
3,293
1934E
Problem - 1934E - 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 - ...
3,000
false
false
false
false
false
true
true
false
false
false
675
993E
Problem - 993E - 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,300
true
false
false
false
false
false
false
false
false
false
5,730
703D
Little Mishka enjoys programming. Since her birthday has just passed, her friends decided to present her with array of non-negative integers _a_1,u2009_a_2,u2009...,u2009_a__n_ of _n_ elements! Mishka loved the array and she instantly decided to determine its beauty value, but she is too little and can't process large ...
2,100
false
false
false
false
true
false
false
false
false
false
7,008
2002G
Problem - 2002G - 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 - ...
3,400
false
false
false
false
false
false
true
false
false
false
241
1033B
Alice has a lovely piece of cloth. It has the shape of a square with a side of length $$$a$$$ centimeters. Bob also wants such piece of cloth. He would prefer a square with a side of length $$$b$$$ centimeters (where $$$b < a$$$). Alice wanted to make Bob happy, so she cut the needed square out of the corner of her pie...
1,100
true
false
false
false
false
false
false
false
false
false
5,534
538D
Igor has been into chess for a long time and now he is sick of the game by the ordinary rules. He is going to think of new rules of the game and become world famous. Igor's chessboard is a square of size _n_u2009Γ—u2009_n_ cells. Igor decided that simple rules guarantee success, that's why his game will have only one ty...
1,800
false
false
true
false
false
true
true
false
false
false
7,685
268E
Manao's friends often send him new songs. He never listens to them right away. Instead, he compiles them into a playlist. When he feels that his mind is open to new music, he opens the playlist and starts to listen to the songs. Of course, there are some songs that Manao doesn't particuarly enjoy. To get more pleasure ...
2,100
true
false
false
false
false
false
false
false
true
false
8,759
188F
Problem - 188F - Codeforces =============== xa0 . Output Output the binary notation of _n_ (without any leading zeros). Examples Input 5 Output 101 Input 101 Output 1100101 Note In the first example 5u2009=u20091u2009*u200922u2009+u20090u2009*u200921u2009+u20091u2009*u200920.
1,400
false
false
true
false
false
false
false
false
false
false
9,087
1455E
You are given four different integer points $$$p_1$$$, $$$p_2$$$, $$$p_3$$$ and $$$p_4$$$ on $$$mathit{XY}$$$ grid. In one step you can choose one of the points $$$p_i$$$ and move it in one of four directions by one. In other words, if you have chosen point $$$p_i = (x, y)$$$ you can move it to $$$(x, y + 1)$$$, $$$(x,...
2,400
true
true
true
false
false
true
true
false
false
false
3,398
1336C
Kaavi, the mysterious fortune teller, deeply believes that one's fate is inevitable and unavoidable. Of course, she makes her living by predicting others' future. While doing divination, Kaavi believes that magic spells can provide great power for her to see the future. xa0Kaavi has a string $$$T$$$ of length $$$m$$$ a...
2,200
false
false
false
true
false
false
false
false
false
false
4,021
331E2
Everybody knows that we have been living in the Matrix for a long time. And in the new seventh Matrix the world is ruled by beavers. So let's take beaver Neo. Neo has so-called "deja vu" outbursts when he gets visions of events in some places he's been at or is going to be at. Let's examine the phenomenon in more detai...
3,100
false
false
false
true
false
true
false
false
false
false
8,511
1133A
Polycarp is going to participate in the contest. It starts at $$$h_1:m_1$$$ and ends at $$$h_2:m_2$$$. It is guaranteed that the contest lasts an even number of minutes (i.e. $$$m_1 % 2 = m_2 % 2$$$, where $$$x % y$$$ is $$$x$$$ modulo $$$y$$$). It is also guaranteed that the entire contest is held during a single day....
1,000
false
false
true
false
false
false
false
false
false
false
5,054
1873B
Problem - 1873B - 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
true
false
false
false
false
true
false
false
false
1,043
1730D
You have two strings $$$s_1$$$ and $$$s_2$$$ of length $$$n$$$, consisting of lowercase English letters. You can perform the following operation any (possibly zero) number of times: Choose a positive integer $$$1 leq k leq n$$$. Swap the prefix of the string $$$s_1$$$ and the suffix of the string $$$s_2$$$ of length ...
2,200
false
false
false
false
false
true
false
false
false
false
1,908
1610D
Lee couldn't sleep lately, because he had nightmares. In one of his nightmares (which was about an unbalanced global round), he decided to fight back and propose a problem below (which you should solve) to balance the round, hopefully setting him free from the nightmares. A non-empty array $$$b_1, b_2, ldots, b_m$$$ is...
2,000
true
false
false
true
false
false
false
false
false
false
2,597
1881G
Anya received a string $$$s$$$ of length $$$n$$$ brought from Rome. The string $$$s$$$ consists of lowercase Latin letters and at first glance does not raise any suspicions. An instruction was attached to the string. Start of the instruction. A palindrome is a string that reads the same from left to right and right to ...
2,000
false
false
false
false
true
false
false
true
false
false
998
1405A
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...
800
false
false
false
false
false
true
false
false
false
false
3,648
250C
A film festival is coming up in the city N. The festival will last for exactly _n_ days and each day will have a premiere of exactly one film. Each film has a genre β€” an integer from 1 to _k_. On the _i_-th day the festival will show a movie of genre _a__i_. We know that a movie of each of _k_ genres occurs in the fest...
1,600
false
true
false
false
false
false
false
false
false
false
8,834
994B
Unlike Knights of a Round Table, Knights of a Polygonal Table deprived of nobility and happy to kill each other. But each knight has some power and a knight can kill another knight if and only if his power is greater than the power of victim. However, even such a knight will torment his conscience, so he can kill no mo...
1,400
false
true
true
false
false
false
false
false
true
false
5,727
534A
Problem - 534A - 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
true
false
true
false
false
true
false
false
false
false
7,701
852C
Bill is a famous mathematician in BubbleLand. Thanks to his revolutionary math discoveries he was able to make enough money to build a beautiful house. Unfortunately, for not paying property tax on time, court decided to punish Bill by making him lose a part of his property. Bill’s property can be observed as a convex ...
2,100
false
true
false
false
false
false
false
false
true
false
6,341
1523H
William really wants to get a pet. Since his childhood he dreamt about getting a pet grasshopper. William is being very responsible about choosing his pet, so he wants to set up a trial for the grasshopper! The trial takes place on an array $$$a$$$ of length $$$n$$$, which defines lengths of hops for each of $$$n$$$ ce...
3,500
false
false
false
true
true
false
false
false
false
false
3,043
1257E
A team of three programmers is going to play a contest. The contest consists of $$$n$$$ problems, numbered from $$$1$$$ to $$$n$$$. Each problem is printed on a separate sheet of paper. The participants have decided to divide the problem statements into three parts: the first programmer took some prefix of the statemen...
2,000
false
true
false
true
true
false
false
false
false
false
4,397
1225B1
The only difference between easy and hard versions is constraints. The BerTV channel every day broadcasts one episode of one of the $$$k$$$ TV shows. You know the schedule for the next $$$n$$$ days: a sequence of integers $$$a_1, a_2, dots, a_n$$$ ($$$1 le a_i le k$$$), where $$$a_i$$$ is the show, the episode of which...
1,000
false
false
true
false
false
false
false
false
false
false
4,551
1720A
Burenka came to kindergarden. This kindergarten is quite strange, so each kid there receives two fractions ($$$frac{a}{b}$$$ and $$$frac{c}{d}$$$) with integer numerators and denominators. Then children are commanded to play with their fractions. Burenka is a clever kid, so she noticed that when she claps once, she can...
900
true
false
false
false
false
false
false
false
false
false
1,965
1056B
Arkady and his friends love playing checkers on an $$$n imes n$$$ field. The rows and the columns of the field are enumerated from $$$1$$$ to $$$n$$$. The friends have recently won a championship, so Arkady wants to please them with some candies. Remembering an old parable (but not its moral), Arkady wants to give to ...
1,600
true
false
false
false
false
false
false
false
false
false
5,431
298B
The polar bears are going fishing. They plan to sail from (_s__x_,u2009_s__y_) to (_e__x_,u2009_e__y_). However, the boat can only sail by wind. At each second, the wind blows in one of these directions: east, south, west or north. Assume the boat is currently at (_x_,u2009_y_). If the wind blows to the east, the boat...
1,200
false
true
true
false
false
false
true
false
false
false
8,638
723B
Modern text editors usually show some information regarding the document being edited. For example, the number of words, the number of pages, or the number of characters. In this problem you should implement the similar functionality. You are given a string which only consists of: uppercase and lowercase English lette...
1,100
false
false
true
false
false
false
false
false
false
false
6,919
359A
Simon has a rectangular table consisting of _n_ rows and _m_ columns. Simon numbered the rows of the table from top to bottom starting from one and the columns β€” from left to right starting from one. We'll represent the cell on the _x_-th row and the _y_-th column as a pair of numbers (_x_,u2009_y_). The table corners ...
1,000
false
true
true
false
false
true
false
false
false
false
8,399
1231E
The problem was inspired by Pied Piper story. After a challenge from Hooli's compression competitor Nucleus, Richard pulled an all-nighter to invent a new approach to compression: middle-out. You are given two strings $$$s$$$ and $$$t$$$ of the same length $$$n$$$. Their characters are numbered from $$$1$$$ to $$$n$$$ ...
2,200
false
true
false
false
false
true
false
false
false
false
4,526
1999E
Problem - 1999E - 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,300
true
false
true
true
false
false
false
false
false
false
267
676A
Nicholas has an array _a_ that contains _n_ distinct integers from 1 to _n_. In other words, Nicholas has a permutation of size _n_. Nicholas want the minimum element (integer 1) and the maximum element (integer _n_) to be as far as possible from each other. He wants to perform exactly one swap in order to maximize the...
800
false
false
true
false
false
true
false
false
false
false
7,126
706A
Vasiliy lives at point (_a_,u2009_b_) of the coordinate plane. He is hurrying up to work so he wants to get out of his house as soon as possible. New app suggested _n_ available Beru-taxi nearby. The _i_-th taxi is located at point (_x__i_,u2009_y__i_) and moves with a speed _v__i_. Consider that each of _n_ drivers wi...
900
false
false
true
false
false
false
true
false
false
false
6,999
1733A
You are given an array $$$a$$$ with $$$n$$$ integers. You can perform the following operation at most $$$k$$$ times: Choose two indices $$$i$$$ and $$$j$$$, in which $$$i ,bmod, k = j ,bmod, k$$$ ($$$1 le i < j le n$$$). Swap $$$a_i$$$ and $$$a_j$$$. After performing all operations, you have to select $$$k$$$ consecu...
800
false
true
false
false
false
false
false
false
true
false
1,892
597C
Problem - 597C - Codeforces =============== xa0 β€” the length of sequence and the number of elements in increasing subsequences. Next _n_ lines contains one integer _a__i_ (1u2009≀u2009_a__i_u2009≀u2009_n_) each β€” elements of sequence. All values _a__i_ are different. Output Print one integer β€” the answer to the p...
1,900
false
false
false
true
true
false
false
false
false
false
7,458
1684H
You are given a binary string $$$s$$$. You have to cut it into any number of non-intersecting substrings, so that the sum of binary integers denoted by these substrings is a power of 2. Each element of $$$s$$$ should be in exactly one substring. Input Each test contains multiple test cases. The first line contains the ...
3,400
true
false
false
false
false
true
false
false
false
false
2,166
1007B
You are given a rectangular parallelepiped with sides of positive integer lengths $$$A$$$, $$$B$$$ and $$$C$$$. Find the number of different groups of three integers ($$$a$$$, $$$b$$$, $$$c$$$) such that $$$1leq aleq bleq c$$$ and parallelepiped $$$A imes B imes C$$$ can be paved with parallelepipeds $$$a imes b imes c...
2,400
true
false
false
false
false
false
true
false
false
false
5,648
1486E
There are $$$n$$$ cities and $$$m$$$ bidirectional roads in the country. The roads in the country form an undirected weighted graph. The graph is not guaranteed to be connected. Each road has it's own parameter $$$w$$$. You can travel through the roads, but the government made a new law: you can only go through two roa...
2,200
false
false
false
true
false
true
true
true
false
true
3,248
1061D
There are $$$n$$$ TV shows you want to watch. Suppose the whole time is split into equal parts called "minutes". The $$$i$$$-th of the shows is going from $$$l_i$$$-th to $$$r_i$$$-th minute, both ends inclusive. You need a TV to watch a TV show and you can't watch two TV shows which air at the same time on the same TV...
2,000
false
true
true
false
true
false
false
false
true
false
5,405