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
818B
_n_ children are standing in a circle and playing a game. Children's numbers in clockwise order form a permutation _a_1,u2009_a_2,u2009...,u2009_a__n_ of length _n_. It is an integer sequence such that each integer from 1 to _n_ appears exactly once in it. The game consists of _m_ steps. On each step the current leader...
1,600
false
false
true
false
false
false
false
false
false
false
6,486
1941G
Building bridges did not help Bernard, and he continued to be late everywhere. Then Rudolf decided to teach him how to use the subway. Rudolf depicted the subway map as an undirected connected graph, without self-loops, where the vertices represent stations. There is at most one edge between any pair of vertices. Two v...
2,000
false
false
false
false
false
true
false
false
false
true
633
204C
Little Elephant loves Furik and Rubik, who he met in a small city Kremenchug. The Little Elephant has two strings of equal length _a_ and _b_, consisting only of uppercase English letters. The Little Elephant selects a pair of substrings of equal length — the first one from string _a_, the second one from string _b_. T...
2,000
true
false
false
false
false
false
false
false
false
false
9,025
1063F
We call a sequence of strings _t_1,u2009...,u2009_t__k_ a journey of length _k_, if for each _i_u2009>u20091 _t__i_ is a substring of _t__i_u2009-u20091 and length of _t__i_ is strictly less than length of _t__i_u2009-u20091. For example, {_ab_,u2009_b_} is a journey, but {_ab_,u2009_c_} and {_a_,u2009_a_} are not. Def...
3,300
false
false
false
true
true
false
false
false
false
false
5,391
1760G
You are given a weighted tree with $$$n$$$ vertices. Recall that a tree is a connected graph without any cycles. A weighted tree is a tree in which each edge has a certain weight. The tree is undirected, it doesn't have a root. Since trees bore you, you decided to challenge yourself and play a game on the given tree. I...
1,700
false
false
false
false
false
false
false
false
false
true
1,749
460C
Little beaver is a beginner programmer, so informatics is his favorite subject. Soon his informatics teacher is going to have a birthday and the beaver has decided to prepare a present for her. He planted _n_ flowers in a row on his windowsill and started waiting for them to grow. However, after some time the beaver no...
1,700
false
true
false
false
true
false
false
true
false
false
7,999
1554A
You are given $$$n$$$ integers $$$a_1, a_2, ldots, a_n$$$. Find the maximum value of $$$max(a_l, a_{l + 1}, ldots, a_r) cdot min(a_l, a_{l + 1}, ldots, a_r)$$$ over all pairs $$$(l, r)$$$ of integers for which $$$1 le l < r le n$$$. Input The first line contains a single integer $$$t$$$ ($$$1 le t le 10,000$$$) xa0— th...
800
false
true
false
false
false
false
false
false
false
false
2,866
798A
Problem - 798A - 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,000
false
false
false
false
false
true
true
false
false
false
6,581
1746G
Anton decided to get ready for an Olympiad in Informatics. Ilya prepared $$$n$$$ tasks for him to solve. It is possible to submit the solution for the $$$i$$$-th task in the first $$$d_{i}$$$ days only. Anton cannot solve more than one task a day. Ilya estimated the usefulness of the $$$i$$$-th tasks as $$$r_{i}$$$ and...
3,500
false
false
true
true
true
false
false
true
true
false
1,803
263A
You've got a 5u2009×u20095 matrix, consisting of 24 zeroes and a single number one. Let's index the matrix rows by numbers from 1 to 5 from top to bottom, let's index the matrix columns by numbers from 1 to 5 from left to right. In one move, you are allowed to apply one of the two following transformations to the matri...
800
false
false
true
false
false
false
false
false
false
false
8,783
367A
Sereja loves all sorts of algorithms. He has recently come up with a new algorithm, which receives a string as an input. Let's represent the input string of the algorithm as _q_u2009=u2009_q_1_q_2... _q__k_. The algorithm consists of two steps: 1. Find any continuous subsequence (substring) of three characters of strin...
1,500
false
false
true
false
true
false
false
false
false
false
8,365
274E
Imagine an _n_u2009×u2009_m_ grid with some blocked cells. The top left cell in the grid has coordinates (1,u20091) and the bottom right cell has coordinates (_n_,u2009_m_). There are _k_ blocked cells in the grid and others are empty. You flash a laser beam from the center of an empty cell (_x__s_,u2009_y__s_) in one ...
3,000
false
false
true
false
true
false
false
false
false
false
8,735
1506F
Consider an infinite triangle made up of layers. Let's number the layers, starting from one, from the top of the triangle (from top to bottom). The $$$k$$$-th layer of the triangle contains $$$k$$$ points, numbered from left to right. Each point of an infinite triangle is described by a pair of numbers $$$(r, c)$$$ ($$...
2,000
true
false
false
false
false
true
false
false
true
true
3,138
1027B
You are given a chessboard of size $$$n imes n$$$. It is filled with numbers from $$$1$$$ to $$$n^2$$$ in the following way: the first $$$lceil frac{n^2}{2} ceil$$$ numbers from $$$1$$$ to $$$lceil frac{n^2}{2} ceil$$$ are written in the cells with even sum of coordinates from left to right from top to bottom. The r...
1,200
true
false
true
false
false
false
false
false
false
false
5,575
2029H
Given is an undirected graph with $$$n$$$ vertices and $$$m$$$ edges. Each edge connects two vertices $$$(u, v)$$$ and has a probability of $$$frac{p}{q}$$$ of appearing each day. Initially, vertex $$$1$$$ has a message. At the end of the day, a vertex has a message if and only if itself or at least one of the vertices...
3,500
false
false
false
true
false
false
true
false
false
false
90
1632C
Igor is in 11th grade. Tomorrow he will have to write an informatics test by the strictest teacher in the school, Pavel Denisovich. Igor knows how the test will be conducted: first of all, the teacher will give each student two positive integers $$$a$$$ and $$$b$$$ ($$$a < b$$$). After that, the student can apply any o...
1,600
true
false
false
true
false
false
true
true
false
false
2,456
1557E
This is an interactive problem. ICPC Assiut Community decided to hold a unique chess contest, and you were chosen to control a queen and hunt down the hidden king, while a member of ICPC Assiut Community controls this king. You compete on an $$$8 imes8$$$ chessboard, the rows are numerated from top to bottom, and the c...
2,800
false
false
false
false
false
true
true
false
false
false
2,843
627A
Problem - 627A - Codeforces =============== xa0 ]( "8VC Venture Cup 2016 — Final Round") ? Input The first line of the input contains two integers _s_ and _x_ (2u2009≤u2009_s_u2009≤u20091012, 0u2009≤u2009_x_u2009≤u20091012), the sum and bitwise xor of the pair of positive integers, respectively. Output Pri...
1,700
true
false
false
true
false
false
false
false
false
false
7,321
735B
Local authorities have heard a lot about combinatorial abilities of Ostap Bender so they decided to ask his help in the question of urbanization. There are _n_ people who plan to move to the cities. The wealth of the _i_ of them is equal to _a__i_. Authorities plan to build two cities, first for _n_1 people and second ...
1,100
false
true
false
false
false
false
false
false
true
false
6,851
1575L
Problem - 1575L - 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
false
false
false
true
true
false
false
false
true
false
2,757
276A
Problem - 276A - 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
false
true
false
false
false
false
false
false
false
8,732
1863C
You are given an array $$$a_1,a_2,ldots, a_n$$$ of pairwise distinct integers from $$$0$$$ to $$$n$$$. Consider the following operation: consecutively for each $$$i$$$ from $$$1$$$ to $$$n$$$ in this order, replace $$$a_i$$$ with $$$operatorname{MEX}(a_1, a_2, ldots, a_n)$$$. Here $$$operatorname{MEX}$$$ of a collecti...
1,100
true
false
true
false
false
false
false
false
false
false
1,104
2021E2
This is the hard version of the problem. In the three versions, the constraints on $$$n$$$ and $$$m$$$ are different. You can make hacks only if all the versions of the problem are solved. Pak Chanek is setting up internet connections for the village of Khuntien. The village can be represented as a connected simple gra...
2,500
true
false
false
true
true
false
false
false
false
true
140
108A
Problem - 108A - 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,000
false
false
true
false
false
false
false
false
false
false
9,451
1055E
You are a given a list of integers $$$a_1, a_2, ldots, a_n$$$ and $$$s$$$ of its segments $$$[l_j; r_j]$$$ (where $$$1 le l_j le r_j le n$$$). You need to select exactly $$$m$$$ segments in such a way that the $$$k$$$-th order statistic of the multiset of $$$a_i$$$, where $$$i$$$ is contained in at least one segment, i...
2,500
false
false
false
true
false
false
false
true
false
false
5,435
305D
Olya has got a directed non-weighted graph, consisting of _n_ vertexes and _m_ edges. We will consider that the graph vertexes are indexed from 1 to _n_ in some manner. Then for any graph edge that goes from vertex _v_ to vertex _u_ the following inequation holds: _v_u2009<u2009_u_. Now Olya wonders, how many ways ther...
2,200
true
false
false
false
false
false
false
false
false
false
8,613
1190D
There are $$$n$$$ points on the plane, the $$$i$$$-th of which is at $$$(x_i, y_i)$$$. Tokitsukaze wants to draw a strange rectangular area and pick all the points in the area. The strange area is enclosed by three lines, $$$x = l$$$, $$$y = a$$$ and $$$x = r$$$, as its left side, its bottom side and its right side res...
2,000
false
false
false
false
true
false
false
false
true
false
4,747
1835A
Consider all equalities of form $$$a + b = c$$$, where $$$a$$$ has $$$A$$$ digits, $$$b$$$ has $$$B$$$ digits, and $$$c$$$ has $$$C$$$ digits. All the numbers are positive integers and are written without leading zeroes. Find the $$$k$$$-th lexicographically smallest equality when written as a string like above or dete...
1,700
true
false
true
false
false
false
true
false
false
false
1,278
97D
The Professor has lost his home robot yet again. After some thinking Professor understood that he had left the robot in the basement. The basement in Professor's house is represented by a rectangle _n_u2009×u2009_m_, split into 1u2009×u20091 squares. Some squares are walls which are impassable; other squares are passab...
2,700
false
false
true
false
false
false
true
false
false
false
9,498
962B
There are $$$n$$$ consecutive seat places in a railway carriage. Each place is either empty or occupied by a passenger. The university team for the Olympiad consists of $$$a$$$ student-programmers and $$$b$$$ student-athletes. Determine the largest number of students from all $$$a+b$$$ students, which you can put in th...
1,300
false
true
true
false
false
true
false
false
false
false
5,855
1946D
Yarik's birthday is coming soon, and Mark decided to give him an array $$$a$$$ of length $$$n$$$. Mark knows that Yarik loves bitwise operations very much, and he also has a favorite number $$$x$$$, so Mark wants to find the maximum number $$$k$$$ such that it is possible to select pairs of numbers xa0— the number of t...
1,900
false
true
true
false
false
true
true
false
false
false
602
827A
Ivan had string _s_ consisting of small English letters. However, his friend Julia decided to make fun of him and hid the string _s_. Ivan preferred making a new string to finding the old one. Ivan knows some information about the string _s_. Namely, he remembers, that string _t__i_ occurs in string _s_ at least _k__i_...
1,700
false
true
false
false
true
false
false
false
true
false
6,455
1296F
There are $$$n$$$ railway stations in Berland. They are connected to each other by $$$n-1$$$ railway sections. The railway network is connected, i.e. can be represented as an undirected tree. You have a map of that network, so for each railway section you know which stations it connects. Each of the $$$n-1$$$ sections ...
2,100
false
true
false
false
false
true
false
false
true
false
4,211
1071E
A lot of people dream of convertibles (also often called cabriolets). Some of convertibles, however, don't have roof at all, and are vulnerable to rain. This is why Melon Ask, the famous inventor, decided to create a rain protection mechanism for convertibles. The workplace of the mechanism is a part of plane just abov...
3,500
false
false
false
false
false
false
false
true
false
false
5,354
764B
Young Timofey has a birthday today! He got kit of _n_ cubes as a birthday present from his parents. Every cube has a number _a__i_, which is written on it. Timofey put all the cubes in a row and went to unpack other presents. In this time, Timofey's elder brother, Dima reordered the cubes using the following rule. Supp...
900
false
false
true
false
false
true
false
false
false
false
6,731
1005C
A sequence $$$a_1, a_2, dots, a_n$$$ is called good if, for each element $$$a_i$$$, there exists an element $$$a_j$$$ ($$$i e j$$$) such that $$$a_i+a_j$$$ is a power of two (that is, $$$2^d$$$ for some non-negative integer $$$d$$$). For example, the following sequences are good: $$$[5, 3, 11]$$$ (for example, for $$...
1,300
false
true
true
false
false
false
true
false
false
false
5,660
550B
You have _n_ problems. You have estimated the difficulty of the _i_-th one as integer _c__i_. Now you want to prepare a problemset for a contest, using some of the problems you've made. A problemset for the contest must consist of at least two problems. You think that the total difficulty of the problems of the contest...
1,400
false
false
false
false
false
false
true
false
false
false
7,636
981B
Two famous competing companies ChemForces and TopChemist decided to show their sets of recently discovered chemical elements on an exhibition. However they know that no element should be present in the sets of both companies. In order to avoid this representatives of both companies decided to make an agreement on the s...
1,000
false
false
false
false
false
false
false
false
true
false
5,799
605D
You are playing a board card game. In this game the player has two characteristics, _x_ and _y_xa0— the white magic skill and the black magic skill, respectively. There are _n_ spell cards lying on the table, each of them has four characteristics, _a__i_, _b__i_, _c__i_ and _d__i_. In one move a player can pick one of ...
2,500
false
false
false
false
true
false
false
false
false
false
7,423
1627D
You have an array $$$a_1, a_2, dots, a_n$$$ consisting of $$$n$$$ distinct integers. You are allowed to perform the following operation on it: Choose two elements from the array $$$a_i$$$ and $$$a_j$$$ ($$$i e j$$$) such that $$$gcd(a_i, a_j)$$$ is not present in the array, and add $$$gcd(a_i, a_j)$$$ to the end of t...
1,900
true
false
false
true
false
false
true
false
false
false
2,478
1387B1
This problem is split into two tasks. In this task, you are required to find the minimum possible answer. In the task Village (Maximum) you are required to find the maximum possible answer. Each task is worth $$$50$$$ points. There are $$$N$$$ houses in a certain village. A single villager lives in each of the houses. ...
2,100
false
true
false
true
false
false
false
false
false
false
3,736
1660F1
This is the easy version of Problem F. The only difference between the easy version and the hard version is the constraints. We will call a non-empty string balanced if it contains the same number of plus and minus signs. For example: strings "+--+" and "++-+--" are balanced, and strings "+--", "--" and "" are not bala...
1,700
true
false
true
false
false
false
true
false
false
false
2,321
2007C
Dora has just learned the programming language C++! However, she has completely misunderstood the meaning of C++. She considers it as two kinds of adding operations on the array $$$c$$$ with $$$n$$$ elements. Dora has two integers $$$a$$$ and $$$b$$$. In one operation, she can choose one of the following things to do. ...
1,500
true
false
false
false
false
false
false
false
false
false
209
1146B
Problem - 1146B - Codeforces =============== xa0 ]( "Forethought Future Cup") . He then generates a new string $$$t$$$ by concatenating $$$s$$$ and $$$s'$$$. In other words, $$$t=s+s'$$$ (look at notes for an example). You are given a string $$$t$$$. Your task is to find some $$$s$$$ that Bob could have us...
1,100
false
false
true
false
false
false
false
false
false
false
4,990
1906F
You are given a one-based array consisting of $$$N$$$ integers: $$$A_1, A_2, cdots, A_N$$$. Initially, the value of each element is set to $$$0$$$. There are $$$M$$$ operations (numbered from $$$1$$$ to $$$M$$$). Operation $$$i$$$ is represented by $$$langle L_i, R_i, X_i angle$$$. If operation $$$i$$$ is executed, al...
2,100
false
false
false
false
true
false
false
false
true
false
872
794G
Igor the analyst is at work. He learned about a feature in his text editor called "Replace All". Igor is too bored at work and thus he came up with the following problem: Given two strings _x_ and _y_ which consist of the English letters 'A' and 'B' only, a pair of strings (_s_,u2009_t_) is called good if: _s_ and _t_...
3,400
true
false
false
true
false
false
false
false
false
false
6,594
707E
Like all children, Alesha loves New Year celebration. During the celebration he and his whole family dress up the fir-tree. Like all children, Alesha likes to play with garlandsxa0— chains consisting of a lightbulbs. Alesha uses a grid field sized _n_u2009×u2009_m_ for playing. The rows of the field are numbered from 1...
2,400
false
false
false
false
true
false
false
false
false
false
6,990
1682E
Alice had a permutation $$$p$$$ of numbers from $$$1$$$ to $$$n$$$. Alice can swap a pair $$$(x, y)$$$ which means swapping elements at positions $$$x$$$ and $$$y$$$ in $$$p$$$ (i.e. swap $$$p_x$$$ and $$$p_y$$$). Alice recently learned her first sorting algorithm, so she decided to sort her permutation in the minimum ...
2,700
true
true
false
false
false
true
false
false
true
true
2,175
1119F
Niyaz has a tree with $$$n$$$ vertices numerated from $$$1$$$ to $$$n$$$. A tree is a connected graph without cycles. Each edge in this tree has strictly positive integer weight. A degree of a vertex is the number of edges adjacent to this vertex. Niyaz does not like when vertices in the tree have too large degrees. Fo...
3,400
false
false
false
true
true
false
false
false
false
false
5,089
353C
Problem - 353C - 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,600
true
false
true
false
false
false
false
false
false
false
8,421
1930G
Define a function $$$f$$$ such that for an array $$$b$$$, $$$f(b)$$$ returns the array of prefix maxima of $$$b$$$. In other words, $$$f(b)$$$ is an array containing only those elements $$$b_i$$$, for which $$$b_i=max(b_1,b_2,ldots,b_i)$$$, without changing their order. For example, $$$f([3,10,4,10,15,1])=[3,10,10,15]$...
3,100
false
false
false
true
true
false
false
false
false
false
704
131F
How many stars are there in the sky? A young programmer Polycarpus can't get this question out of his head! He took a photo of the starry sky using his digital camera and now he analyzes the resulting monochrome digital picture. The picture is represented by a rectangular matrix consisting of _n_ lines each containing ...
2,000
false
false
false
false
false
false
false
true
false
false
9,348
575B
Ruritania is a country with a very badly maintained road network, which is not exactly good news for lorry drivers that constantly have to do deliveries. In fact, when roads are maintained, they become one-way. It turns out that it is sometimes impossible to get from one town to another in a legal way – however, we kno...
2,200
false
false
false
false
false
false
false
false
false
true
7,551
2024B
There is a vending machine that sells lemonade. The machine has a total of $$$n$$$ slots. You know that initially, the $$$i$$$-th slot contains $$$a_i$$$ cans of lemonade. There are also $$$n$$$ buttons on the machine, each button corresponds to a slot, with exactly one button corresponding to each slot. Unfortunately,...
1,100
false
false
false
false
false
true
false
true
true
false
124
1498B
You are given $$$n$$$ rectangles, each of height $$$1$$$. Each rectangle's width is a power of $$$2$$$ (i.u2009e. it can be represented as $$$2^x$$$ for some non-negative integer $$$x$$$). You are also given a two-dimensional box of width $$$W$$$. Note that $$$W$$$ may or may not be a power of $$$2$$$. Moreover, $$$W$$...
1,300
false
true
false
false
true
false
false
true
false
false
3,180
1480A
Homer has two friends Alice and Bob. Both of them are string fans. One day, Alice and Bob decide to play a game on a string $$$s = s_1 s_2 dots s_n$$$ of length $$$n$$$ consisting of lowercase English letters. They move in turns alternatively and Alice makes the first move. In a move, a player must choose an index $$$i...
800
false
true
false
false
false
false
false
false
false
false
3,275
35C
After a terrifying forest fire in Berland a forest rebirth program was carried out. Due to it _N_ rows with _M_ trees each were planted and the rows were so neat that one could map it on a system of coordinates so that the _j_-th tree in the _i_-th row would have the coordinates of (_i_,u2009_j_). However a terrible th...
1,500
false
false
false
false
false
false
true
false
false
false
9,821
1437C
Chef Monocarp has just put $$$n$$$ dishes into an oven. He knows that the $$$i$$$-th dish has its optimal cooking time equal to $$$t_i$$$ minutes. At any positive integer minute $$$T$$$ Monocarp can put no more than one dish out of the oven. If the $$$i$$$-th dish is put out at some minute $$$T$$$, then its unpleasant ...
1,800
true
true
false
true
false
false
false
false
true
false
3,483
1672D
There is an array $$$a$$$ of length $$$n$$$. You may perform the following operation any number of times: Choose two indices $$$l$$$ and $$$r$$$ where $$$1 le l < r le n$$$ and $$$a_l = a_r$$$. Then, set $$$a[l ldots r] = [a_{l+1}, a_{l+2}, ldots, a_r, a_l]$$$. You are also given another array $$$b$$$ of length $$$n$$...
1,700
false
true
true
false
false
true
false
false
false
false
2,242
159E
Little Janet likes playing with cubes. Actually, she likes to play with anything whatsoever, cubes or tesseracts, as long as they are multicolored. Each cube is described by two parameters — color _c__i_ and size _s__i_. A Zebra Tower is a tower that consists of cubes of exactly two colors. Besides, the colors of the c...
1,700
false
true
false
false
true
false
false
false
true
false
9,236
2022A
Enter Register HOME TOP CATALOG CONTESTS GYM PROBLEMSET GROUPS RATING EDU API CALENDAR HELP RAYAN Codeforces Round 978 (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...
800
true
true
true
false
false
true
false
false
false
false
138
734F
Problem - 734F - 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,500
true
false
true
false
false
true
false
false
false
false
6,853
70E
Thought it is already the XXI century, the Mass Media isn't very popular in Walrusland. The cities get news from messengers who can only travel along roads. The network of roads in Walrusland is built so that it is possible to get to any city from any other one in exactly one way, and the roads' lengths are equal. The ...
2,700
false
false
true
true
false
false
false
false
false
false
9,617
1583A
A bow adorned with nameless flowers that bears the earnest hopes of an equally nameless person. You have obtained the elegant bow known as the Windblume Ode. Inscribed in the weapon is an array of $$$n$$$ ($$$n ge 3$$$) positive distinct integers (i.e. different, no duplicates are allowed). Find the largest subset (i.e...
800
true
false
false
false
false
false
false
false
false
false
2,717
2033C
Even in university, students need to relax. That is why Sakurakos teacher decided to go on a field trip. It is known that all of the students will be walking in one line. The student with index $$$i$$$ has some topic of interest which is described as $$$a_i$$$. As a teacher, you want to minimise the disturbance of the ...
1,400
false
true
false
true
false
false
false
false
false
false
66
1805B
You are given a string $$$s$$$. You can apply this operation to the string exactly once: choose index $$$i$$$ and move character $$$s_i$$$ to the beginning of the string (removing it at the old position). For example, if you apply the operation with index $$$i=4$$$ to the string "abaacd" with numbering from $$$1$$$, yo...
800
false
true
false
false
false
false
false
false
false
false
1,448
1111A
We all know that a superhero can transform to certain other superheroes. But not all Superheroes can transform to any other superhero. A superhero with name $$$s$$$ can transform to another superhero with name $$$t$$$ if $$$s$$$ can be made equal to $$$t$$$ by changing any vowel in $$$s$$$ to any other vowel and any co...
1,000
false
false
true
false
false
false
false
false
false
false
5,141
1607F
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...
2,300
false
false
true
false
false
false
true
false
false
true
2,618
1925B
Jay managed to create a problem of difficulty $$$x$$$ and decided to make it the second problem for Codeforces Round #921. But Yash fears that this problem will make the contest highly unbalanced, and the coordinator will reject it. So, he decided to break it up into a problemset of $$$n$$$ sub-problems such that the d...
1,200
true
true
false
false
false
false
true
false
false
false
739
919A
We often go to supermarkets to buy some fruits or vegetables, and on the tag there prints the price for a kilo. But in some supermarkets, when asked how much the items are, the clerk will say that $$$a$$$ yuan for $$$b$$$ kilos (You don't need to care about what "yuan" is), the same as $$$a/b$$$ yuan for a kilo. Now im...
800
false
true
true
false
false
false
true
false
false
false
6,056
1916A
In a sequence $$$a$$$, whose product was equal to $$$2023$$$, $$$k$$$ numbers were removed, leaving a sequence $$$b$$$ of length $$$n$$$. Given the resulting sequence $$$b$$$, find any suitable sequence $$$a$$$ and output which $$$k$$$ elements were removed from it, or state that such a sequence could not have existed....
800
true
false
true
false
false
true
false
false
false
false
803
929A
Как известно, в теплую погоду многие жители крупных городов пользуются сервисами городского велопроката. Вот и Аркадий сегодня будет добираться от школы до дома, используя городские велосипеды. Школа и дом находятся на одной прямой улице, кроме того, на той же улице есть _n_ точек, где можно взять велосипед в прокат ил...
1,400
false
true
true
false
false
false
false
false
false
false
5,990
1363E
Ashish has a tree consisting of $$$n$$$ nodes numbered $$$1$$$ to $$$n$$$ rooted at node $$$1$$$. The $$$i$$$-th node in the tree has a cost $$$a_i$$$, and binary digit $$$b_i$$$ is written in it. He wants to have binary digit $$$c_i$$$ written in the $$$i$$$-th node in the end. To achieve this, he can perform the foll...
2,000
false
true
false
true
false
false
false
false
false
false
3,864
606A
Problem - 606A - 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
false
false
false
false
false
false
false
7,421
648A
Statement is not available on English language Профиль горного хребта схематично задан в виде прямоугольной таблицы из символов «.» (пустое пространство) и «*» (часть горы). Каждый столбец таблицы содержит хотя бы одну «звёздочку». Гарантируется, что любой из символов «*» либо находится в нижней строке матрицы, либо не...
900
false
false
true
false
false
true
false
false
false
false
7,227
1442C
You are given a directed graph of $$$n$$$ vertices and $$$m$$$ edges. Vertices are numbered from $$$1$$$ to $$$n$$$. There is a token in vertex $$$1$$$. The following actions are allowed: Token movement. To move the token from vertex $$$u$$$ to vertex $$$v$$$ if there is an edge $$$u o v$$$ in the graph. This action ...
2,400
false
true
false
false
false
false
false
false
false
true
3,462
1717D
Madoka decided to entrust the organization of a major computer game tournament "OSU"! In this tournament, matches are held according to the "Olympic system". In other words, there are $$$2^n$$$ participants in the tournament, numbered with integers from $$$1$$$ to $$$2^n$$$. There are $$$n$$$ rounds in total in the tou...
1,900
true
true
false
false
false
true
false
false
false
false
1,978
1575J
Mr. Chanek has a new game called Dropping Balls. Initially, Mr. Chanek has a grid $$$a$$$ of size $$$n imes m$$$ Each cell $$$(x,y)$$$ contains an integer $$$a_{x,y}$$$ denoting the direction of how the ball will move. $$$a_{x,y}=1$$$ — the ball will move to the right (the next cell is $$$(x, y + 1)$$$); $$$a_{x,y}=...
1,500
false
false
true
false
false
false
true
true
false
false
2,759
1743E
Monocarp is playing a video game. In the game, he controls a spaceship and has to destroy an enemy spaceship. Monocarp has two lasers installed on his spaceship. Both lasers $$$1$$$ and $$$2$$$ have two values: $$$p_i$$$xa0— the power of the laser; $$$t_i$$$xa0— the reload time of the laser. When a laser is fully cha...
2,400
false
false
false
true
false
false
false
true
false
false
1,820
1512F
Polycarp is wondering about buying a new computer, which costs $$$c$$$ tugriks. To do this, he wants to get a job as a programmer in a big company. There are $$$n$$$ positions in Polycarp's company, numbered starting from one. An employee in position $$$i$$$ earns $$$a[i]$$$ tugriks every day. The higher the position n...
1,900
false
true
true
true
false
false
true
false
false
false
3,104
1526B
Problem - 1526B - 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,400
true
false
false
true
false
false
false
false
false
false
3,035
1276D
Vasya has a tree with $$$n$$$ vertices numbered from $$$1$$$ to $$$n$$$, and $$$n - 1$$$ edges numbered from $$$1$$$ to $$$n - 1$$$. Initially each vertex contains a token with the number of the vertex written on it. Vasya plays a game. He considers all edges of the tree by increasing of their indices. For every edge h...
2,900
false
false
false
true
false
false
false
false
false
false
4,312
417B
During the "Russian Code Cup" programming competition, the testing system stores all sent solutions for each participant. We know that many participants use random numbers in their programs and are often sent several solutions with the same source code to check. Each participant is identified by some unique positive in...
1,400
false
false
true
false
false
false
false
false
false
false
8,156
672B
A wise man told Kerem "Different is good" once, so Kerem wants all things in his life to be different. Kerem recently got a string _s_ consisting of lowercase English letters. Since Kerem likes it when things are different, he wants all substrings of his string _s_ to be distinct. Substring is a string formed by some n...
1,000
false
false
true
false
false
true
false
false
false
false
7,134
404E
Valera has a strip infinite in both directions and consisting of cells. The cells are numbered by integers. The cell number 0 has a robot. The robot has instructions — the sequence of moves that he must perform. In one move, the robot moves one cell to the left or one cell to the right, according to instructions. Befor...
2,200
false
true
true
false
false
false
false
true
false
false
8,206
1966B
There is an $$$n imes m$$$ grid of white and black squares. In one operation, you can select any two squares of the same color, and color all squares in the subrectangle between them that color. Formally, if you select positions $$$(x_1, y_1)$$$ and $$$(x_2, y_2)$$$, both of which are currently the same color $$$c$$$,...
1,100
false
false
true
false
false
true
false
false
false
false
509
1965D
There is a hidden array $$$a$$$ of $$$n$$$ positive integers. You know that $$$a$$$ is a palindrome, or in other words, for all $$$1 le i le n$$$, $$$a_i = a_{n + 1 - i}$$$. You are given the sums of all but one of its distinct subarrays, in arbitrary order. The subarray whose sum is not given can be any of the $$$frac...
2,900
false
false
false
false
false
true
false
false
false
false
513
1923B
You are playing a computer game. The current level of this game can be modeled as a straight line. Your character is in point $$$0$$$ of this line. There are $$$n$$$ monsters trying to kill your character; the $$$i$$$-th monster has health equal to $$$a_i$$$ and is initially in the point $$$x_i$$$. Every second, the fo...
1,100
false
true
true
true
false
false
false
false
false
false
751
1326E
You are given a permutation, $$$p_1, p_2, ldots, p_n$$$. Imagine that some positions of the permutation contain bombs, such that there exists at least one position without a bomb. For some fixed configuration of bombs, consider the following process. Initially, there is an empty set, $$$A$$$. For each $$$i$$$ from $$$1...
2,400
false
false
false
false
true
false
false
false
false
false
4,082
1941A
Rudolf is going to visit Bernard, and he decided to take the metro to get to him. The ticket can be purchased at a machine that accepts exactly two coins, the sum of which does not exceed $$$k$$$. Rudolf has two pockets with coins. In the left pocket, there are $$$n$$$ coins with denominations $$$b_1, b_2, dots, b_n$$$...
800
true
false
false
false
false
false
true
false
false
false
639
1710E
You are given two arrays of integers $$$a_1,a_2,dots,a_n$$$ and $$$b_1,b_2,dots,b_m$$$. Alice and Bob are going to play a game. Alice moves first and they take turns making a move. They play on a grid of size $$$n imes m$$$ (a grid with $$$n$$$ rows and $$$m$$$ columns). Initially, there is a rook positioned on the fi...
2,400
false
false
false
false
false
false
false
true
false
false
2,016
594B
For months Maxim has been coming to work on his favorite bicycle. And quite recently he decided that he is ready to take part in a cyclists' competitions. He knows that this year _n_ competitions will take place. During the _i_-th competition the participant must as quickly as possible complete a ride along a straight ...
2,500
false
false
false
false
false
false
false
true
false
false
7,471
1053E
Euler is a little, cute squirrel. When the autumn comes, he collects some reserves for winter. The interesting fact is that Euler likes to collect acorns in a specific way. A tree can be described as $$$n$$$ acorns connected by $$$n - 1$$$ branches, such that there is exactly one way between each pair of acorns. Let's ...
3,500
false
false
false
false
false
true
false
false
false
false
5,448
534D
On February, 30th _n_ students came in the Center for Training Olympiad Programmers (CTOP) of the Berland State University. They came one by one, one after another. Each of them went in, and before sitting down at his desk, greeted with those who were present in the room by shaking hands. Each of the students who came ...
1,900
false
true
false
false
true
true
false
true
false
false
7,698
1129B
Consider the following problem: given an array $$$a$$$ containing $$$n$$$ integers (indexed from $$$0$$$ to $$$n-1$$$), find $$$maxlimits_{0 leq l leq r leq n-1} sumlimits_{l leq i leq r} (r-l+1) cdot a_i$$$. In this problem, $$$1 leq n leq 2,000$$$ and $$$a_i leq 10^6$$$. In an attempt to solve the problem described, ...
2,000
false
false
false
false
false
true
false
false
false
false
5,075
1338E
Due to the success of TWICE, JYP Entertainment has earned countless money and emerged as the biggest entertainment firm by market capitalization. Therefore, the boss, JYP, has decided to create a new nation and has appointed you to provide a design diagram. The new nation consists of $$$n$$$ cities and some roads betwe...
3,500
false
false
false
false
false
false
false
false
false
true
4,010
1621G
You are given the sequence of integers $$$a_1, a_2, ldots, a_n$$$ of length $$$n$$$. The sequence of indices $$$i_1 < i_2 < ldots < i_k$$$ of length $$$k$$$ denotes the subsequence $$$a_{i_1}, a_{i_2}, ldots, a_{i_k}$$$ of length $$$k$$$ of sequence $$$a$$$. The subsequence $$$a_{i_1}, a_{i_2}, ldots, a_{i_k}$$$ of len...
3,200
true
false
false
true
true
false
false
false
false
false
2,514
1200A
Amugae has a hotel consisting of $$$10$$$ rooms. The rooms are numbered from $$$0$$$ to $$$9$$$ from left to right. The hotel has two entrances — one from the left end, and another from the right end. When a customer arrives to the hotel through the left entrance, they are assigned to an empty room closest to the left ...
800
false
false
true
false
true
false
true
false
false
false
4,701
852I
This story is happening in a town named BubbleLand. There are _n_ houses in BubbleLand. In each of these _n_ houses lives a boy or a girl. People there really love numbers and everyone has their favorite number _f_. That means that the boy or girl that lives in the _i_-th house has favorite number equal to _f__i_. The ...
2,300
false
false
false
false
false
false
true
false
false
true
6,335
876A
Winnie-the-Pooh likes honey very much! That is why he decided to visit his friends. Winnie has got three best friends: Rabbit, Owl and Eeyore, each of them lives in his own house. There are winding paths between each pair of houses. The length of a path between Rabbit's and Owl's houses is _a_ meters, between Rabbit's ...
900
true
false
false
false
false
false
false
false
false
false
6,242