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
1995B2
This is the hard version of the problem. The only difference is that in this version, instead of listing the number of petals for each flower, the number of petals and the quantity of flowers in the store is set for all types of flowers. A girl is preparing for her birthday and wants to buy the most beautiful bouquet. ...
1,700
true
true
false
false
true
false
false
true
true
false
295
1712E1
We are sum for we are many Some Number This version of the problem differs from the next one only in the constraint on $$$t$$$. You can make hacks only if both versions of the problem are solved. You are given two positive integers $$$l$$$ and $$$r$$$. Count the number of distinct triplets of integers $$$(i, j, k)$$$ s...
2,300
true
false
false
false
false
false
true
true
false
false
2,009
1942A
Let's call an array $$$a$$$ sorted if $$$a_1 leq a_2 leq ldots leq a_{n - 1} leq a_{n}$$$. You are given two of Farmer John's favorite integers, $$$n$$$ and $$$k$$$. He challenges you to find any array $$$a_1, a_2, ldots, a_{n}$$$ satisfying the following requirements: $$$1 leq a_i leq 10^9$$$ for each $$$1 leq i leq ...
800
true
false
false
false
false
true
false
false
false
false
632
451A
After winning gold and silver in IOI 2014, Akshat and Malvika want to have some fun. Now they are playing a game on a grid made of _n_ horizontal and _m_ vertical sticks. An intersection point is any point on the grid which is formed by the intersection of one horizontal stick and one vertical stick. In the grid shown ...
900
false
false
true
false
false
false
false
false
false
false
8,037
1301D
Bashar was practicing for the national programming contest. Because of sitting too much in front of the computer without doing physical movements and eating a lot Bashar became much fatter. Bashar is going to quit programming after the national contest and he is going to become an actor (just like his father), so he sh...
2,000
false
false
true
false
false
true
false
false
false
true
4,191
895E
Vasya and Petya were tired of studying so they decided to play a game. Before the game begins Vasya looks at array _a_ consisting of _n_ integers. As soon as he remembers all elements of _a_ the game begins. Vasya closes his eyes and Petya does _q_ actions of one of two types: 1) Petya says 4 integers _l_1,u2009_r_1,u2...
2,300
false
false
false
false
true
false
false
false
false
false
6,166
863C
Ilya is working for the company that constructs robots. Ilya writes programs for entertainment robots, and his current project is "Bob", a new-generation game robot. Ilya's boss wants to know his progress so far. Especially he is interested if Bob is better at playing different games than the previous model, "Alice". S...
1,800
false
false
true
false
false
false
false
false
false
true
6,292
1367C
Polycarp and his friends want to visit a new restaurant. The restaurant has $$$n$$$ tables arranged along a straight line. People are already sitting at some tables. The tables are numbered from $$$1$$$ to $$$n$$$ in the order from left to right. The state of the restaurant is described by a string of length $$$n$$$ wh...
1,300
true
true
false
false
false
true
false
false
false
false
3,841
1900F
For an array $$$b_1, b_2, ldots, b_m$$$, for some $$$i$$$ ($$$1 < i < m$$$), element $$$b_i$$$ is said to be a local minimum if $$$b_i < b_{i-1}$$$ and $$$b_i < b_{i+1}$$$. Element $$$b_1$$$ is said to be a local minimum if $$$b_1 < b_2$$$. Element $$$b_m$$$ is said to be a local minimum if $$$b_m < b_{m-1}$$$. For an ...
2,800
false
false
true
false
true
false
false
true
false
false
910
1152E
A permutation of length $$$k$$$ is a sequence of $$$k$$$ integers from $$$1$$$ to $$$k$$$ containing each integer exactly once. For example, the sequence $$$[3, 1, 2]$$$ is a permutation of length $$$3$$$. When Neko was five, he thought of an array $$$a$$$ of $$$n$$$ positive integers and a permutation $$$p$$$ of lengt...
2,400
false
false
false
false
false
true
false
false
false
true
4,952
780E
The evil Bumbershoot corporation produces clones for gruesome experiments in a vast underground lab. On one occasion, the corp cloned a boy Andryusha who was smarter than his comrades. Immediately Andryusha understood that something fishy was going on there. He rallied fellow clones to go on a feud against the evil cor...
2,100
false
false
false
false
false
true
false
false
false
true
6,644
2021B
You are given an array $$$a$$$ of $$$n$$$ positive integers and an integer $$$x$$$. You can do the following two-step operation any (possibly zero) number of times: 1. Choose an index $$$i$$$ ($$$1 leq i leq n$$$). 2. Increase $$$a_i$$$ by $$$x$$$, in other words $$$a_i := a_i + x$$$. Find the maximum value of the $$$o...
1,200
true
true
false
false
false
false
true
false
false
false
145
1575I
Chanek Jones is back, helping his long-lost relative Indiana Jones, to find a secret treasure in a maze buried below a desert full of illusions. The map of the labyrinth forms a tree with $$$n$$$ rooms numbered from $$$1$$$ to $$$n$$$ and $$$n - 1$$$ tunnels connecting them such that it is possible to travel between ea...
2,300
false
false
false
false
true
false
false
false
false
false
2,760
1800G
Kid was gifted a tree of $$$n$$$ vertices with the root in the vertex $$$1$$$. Since he really like symmetrical objects, Kid wants to find out if this tree is symmetrical. For example, the trees in the picture above are symmetrical. And the trees in this picture are not symmetrical. Formally, a tree is symmetrical if...
2,200
false
false
true
false
false
false
false
false
false
false
1,467
1355F
This is an interactive problem. We have hidden an integer $$$1 le X le 10^{9}$$$. You don't have to guess this number. You have to find the number of divisors of this number, and you don't even have to find the exact number: your answer will be considered correct if its absolute error is not greater than 7 or its relat...
2,600
false
false
false
false
false
true
false
false
false
false
3,926
337E
Problem - 337E - 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,200
false
false
false
false
false
false
true
false
false
false
8,483
23E
Problem - 23E - Codeforces =============== xa0 : he deletes any (possibly, zero) amount of edges of the tree, and counts the product of sizes of the connected components left after the deletion. Your task is to find out the maximum number that Bob can get in his new game for a given tree. Input The first ...
2,500
false
false
false
true
false
false
false
false
false
false
9,879
1114F
You are given an array $$$a_1, a_2, ldots, a_n$$$. You need to perform $$$q$$$ queries of the following two types: 1. "MULTIPLY l r x"xa0— for every $$$i$$$ ($$$l le i le r$$$) multiply $$$a_i$$$ by $$$x$$$. 2. "TOTIENT l r"xa0— print $$$varphi(prod limits_{i=l}^{r} a_i)$$$ taken modulo $$$10^9+7$$$, where $$$varphi$$$...
2,400
true
false
false
false
true
false
false
false
false
false
5,129
1328C
A number is ternary if it contains only digits $$$0$$$, $$$1$$$ and $$$2$$$. For example, the following numbers are ternary: $$$1022$$$, $$$11$$$, $$$21$$$, $$$2002$$$. You are given a long ternary number $$$x$$$. The first (leftmost) digit of $$$x$$$ is guaranteed to be $$$2$$$, the other digits of $$$x$$$ can be $$$0...
1,200
false
true
true
false
false
false
false
false
false
false
4,069
1845A
You are given an integer $$$n$$$, which you want to obtain. You have an unlimited supply of every integer from $$$1$$$ to $$$k$$$, except integer $$$x$$$ (there are no integer $$$x$$$ at all). You are allowed to take an arbitrary amount of each of these integers (possibly, zero). Can you make the sum of taken integers ...
800
true
false
true
false
false
true
false
false
false
false
1,214
1646D
You are given a tree of $$$n$$$ vertices numbered from $$$1$$$ to $$$n$$$. A tree is a connected undirected graph without cycles. For each $$$i=1,2, ldots, n$$$, let $$$w_i$$$ be the weight of the $$$i$$$-th vertex. A vertex is called good if its weight is equal to the sum of the weights of all its neighbors. Initially...
2,000
false
false
true
true
false
true
false
false
false
false
2,392
712A
There are _n_ integers _b_1,u2009_b_2,u2009...,u2009_b__n_ written in a row. For all _i_ from 1 to _n_, values _a__i_ are defined by the crows performing the following procedure: The crow sets _a__i_ initially 0. The crow then adds _b__i_ to _a__i_, subtracts _b__i_u2009+u20091, adds the _b__i_u2009+u20092 number, an...
800
true
false
true
false
false
false
false
false
false
false
6,971
1733C
You are given an array $$$a$$$ with $$$n$$$ non-negative integers. You can apply the following operation on it. Choose two indices $$$l$$$ and $$$r$$$ ($$$1 le l < r le n$$$). If $$$a_l + a_r$$$ is odd, do $$$a_r := a_l$$$. If $$$a_l + a_r$$$ is even, do $$$a_l := a_r$$$. Find any sequence of at most $$$n$$$ operatio...
1,300
false
false
false
false
false
true
false
false
true
false
1,890
1295B
You are given string $$$s$$$ of length $$$n$$$ consisting of 0-s and 1-s. You build an infinite string $$$t$$$ as a concatenation of an infinite number of strings $$$s$$$, or $$$t = ssss dots$$$ For example, if $$$s =$$$ 10010, then $$$t =$$$ 100101001010010... Calculate the number of prefixes of $$$t$$$ with balance e...
1,700
true
false
false
false
false
false
false
false
false
false
4,222
706C
Vasiliy is fond of solving different tasks. Today he found one he wasn't able to solve himself, so he asks you to help. Vasiliy is given _n_ strings consisting of lowercase English letters. He wants them to be sorted in lexicographical order (as in the dictionary), but he is not allowed to swap any of them. The only op...
1,600
false
false
false
true
false
false
false
false
false
false
6,997
1141G
Treeland consists of $$$n$$$ cities and $$$n-1$$$ roads. Each road is bidirectional and connects two distinct cities. From any city you can get to any other city by roads. Yes, you are right — the country's topology is an undirected tree. There are some private road companies in Treeland. The government decided to sell...
1,900
false
true
false
false
false
true
false
true
false
true
5,014
1970C3
This is the hard version of the problem. The only difference in this version is the constraint on $$$t$$$. 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 activa...
1,900
false
false
false
true
false
false
false
false
false
false
478
91C
A ski base is planned to be built in Walrusland. Recently, however, the project is still in the constructing phase. A large land lot was chosen for the construction. It contains _n_ ski junctions, numbered from 1 to _n_. Initially the junctions aren't connected in any way. In the constructing process _m_ bidirectional ...
2,300
false
false
false
false
false
false
false
false
false
true
9,520
1876F
Pak Chanek has just bought an empty fish tank and he has been dreaming to fill it with his favourite kind of fish, clownfish. Pak Chanek likes clownfish because of their ability to change their genders on demand. Because of the size of his fish tank, Pak Chanek wants to buy exactly $$$k$$$ clownfish to fill the tank. P...
3,500
false
false
false
false
false
false
false
true
false
true
1,021
1352A
A positive (strictly greater than zero) integer is called round if it is of the form d00...0. In other words, a positive integer is round if all its digits except the leftmost (most significant) are equal to zero. In particular, all numbers from $$$1$$$ to $$$9$$$ (inclusive) are round. For example, the following numbe...
800
true
false
true
false
false
false
false
false
false
false
3,952
1808B
Galaxy Luck, a well-known casino in the entire solar system, introduces a new card game. In this game, there is a deck that consists of $$$n$$$ cards. Each card has $$$m$$$ numbers written on it. Each of the $$$n$$$ players receives exactly one card from the deck. Then all players play with each other in pairs, and eac...
1,200
true
false
false
false
false
false
false
false
true
false
1,426
1146E
You are given an array of $$$n$$$ integers $$$a_1, a_2, ldots, a_n$$$. You will perform $$$q$$$ operations. In the $$$i$$$-th operation, you have a symbol $$$s_i$$$ which is either "<" or ">" and a number $$$x_i$$$. You make a new array $$$b$$$ such that $$$b_j = -a_j$$$ if $$$a_j s_i x_i$$$ and $$$b_j = a_j$$$ otherwi...
2,400
false
false
true
false
true
false
false
false
false
false
4,987
288C
Problem - 288C - 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,700
true
false
true
false
false
false
false
false
false
false
8,682
1766B
You want to type the string $$$s$$$, consisting of $$$n$$$ lowercase Latin letters, using your favorite text editor Notepad#. Notepad# supports two kinds of operations: append any letter to the end of the string; copy a continuous substring of an already typed string and paste this substring to the end of the string....
1,000
false
false
true
false
false
false
false
false
false
false
1,702
1650C
On the number line there are $$$m$$$ points, $$$i$$$-th of which has integer coordinate $$$x_i$$$ and integer weight $$$w_i$$$. The coordinates of all points are different, and the points are numbered from $$$1$$$ to $$$m$$$. A sequence of $$$n$$$ segments $$$[l_1, r_1], [l_2, r_2], dots, [l_n, r_n]$$$ is called system...
1,200
false
true
true
false
false
false
false
false
true
false
2,373
1931D
Polycarp has two favorite integers $$$x$$$ and $$$y$$$ (they can be equal), and he has found an array $$$a$$$ of length $$$n$$$. Polycarp considers a pair of indices $$$langle i, j angle$$$ ($$$1 le i < j le n$$$) beautiful if: $$$a_i + a_j$$$ is divisible by $$$x$$$; $$$a_i - a_j$$$ is divisible by $$$y$$$. For exa...
1,300
true
false
false
false
false
false
false
false
false
false
698
38D
Once Vasya played bricks. All the bricks in the set had regular cubical shape. Vasya vas a talented architect, however the tower he built kept falling apart. Let us consider the building process. Vasya takes a brick and puts it on top of the already built tower so that the sides of the brick are parallel to the sides o...
1,900
false
false
true
false
false
false
false
false
false
false
9,805
1325B
Ehab has an array $$$a$$$ of length $$$n$$$. He has just enough free time to make a new array consisting of $$$n$$$ copies of the old array, written back-to-back. What will be the length of the new array's longest increasing subsequence? A sequence $$$a$$$ is a subsequence of an array $$$b$$$ if $$$a$$$ can be obtained...
800
false
true
true
false
false
false
false
false
false
false
4,092
126B
Problem - 126B - 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,700
false
false
false
true
false
false
false
true
false
false
9,376
685C
When the river brought Gerda to the house of the Old Lady who Knew Magic, this lady decided to make Gerda her daughter. She wants Gerda to forget about Kay, so she puts all the roses from the garden underground. Mole, who lives in this garden, now can watch the roses without going up to the surface. Typical mole is bli...
2,900
true
false
false
false
false
false
false
true
false
false
7,081
217A
Problem - 217A - 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
false
false
false
false
true
false
false
true
8,971
586B
A little boy Laurenty has been playing his favourite game Nota for quite a while and is now very hungry. The boy wants to make sausage and cheese sandwiches, but first, he needs to buy a sausage and some cheese. The town where Laurenty lives in is not large. The houses in it are located in two rows, _n_ houses in each ...
1,300
false
false
true
false
false
false
false
false
false
false
7,498
1702G2
This is a hard version of the problem. The only difference between an easy and a hard version is in the number of queries. Polycarp grew a tree from $$$n$$$ vertices. We remind you that a tree of $$$n$$$ vertices is an undirected connected graph of $$$n$$$ vertices and $$$n-1$$$ edges that does not contain cycles. He c...
2,000
false
false
false
false
true
false
false
false
false
false
2,063
1856E2
This is the hard version of the problem. The differences between the two versions are the constraint on $$$n$$$ and the time limit. You can make hacks only if both versions of the problem are solved. You are given a tree with $$$n$$$ vertices rooted at vertex $$$1$$$. For some permutation$$$^dagger$$$ $$$a$$$ of length...
2,700
true
true
true
true
false
false
false
false
false
false
1,145
2018E1
This is the easy version of the problem. In this version, the constraints on $$$n$$$ and the time limit are lower. You can make hacks only if both versions of the problem are solved. A set of (closed) segments is complex if it can be partitioned into some subsets such that all the subsets have the same size; and a pa...
3,300
true
true
false
false
true
false
false
true
true
false
159
1634D
This is an interactive problem. We picked an array of whole numbers $$$a_1, a_2, ldots, a_n$$$ ($$$0 le a_i le 10^9$$$) and concealed exactly one zero in it! Your goal is to find the location of this zero, that is, to find $$$i$$$ such that $$$a_i = 0$$$. You are allowed to make several queries to guess the answer. For...
2,000
true
false
false
false
false
true
false
false
false
false
2,443
729E
There are _n_ workers in a company, each of them has a unique id from 1 to _n_. Exaclty one of them is a chief, his id is _s_. Each worker except the chief has exactly one immediate superior. There was a request to each of the workers to tell how how many superiors (not only immediate). Worker's superiors are his immed...
1,900
false
true
false
false
true
true
false
false
true
true
6,890
1155C
Ivan is going to sleep now and wants to set his alarm clock. There will be many necessary events tomorrow, the $$$i$$$-th of them will start during the $$$x_i$$$-th minute. Ivan doesn't want to skip any of the events, so he has to set his alarm clock in such a way that it rings during minutes $$$x_1, x_2, dots, x_n$$$,...
1,300
true
false
false
false
false
false
false
false
false
false
4,934
1852C
To prepare her "Takodachi" dumbo octopuses for world domination, Ninomae Ina'nis, a.k.a. Ina of the Mountain, orders Hoshimachi Suisei to throw boulders at them. Ina asks you, Kiryu Coco, to help choose where the boulders are thrown. There are $$$n$$$ octopuses on a single-file trail on Ina's mountain, numbered $$$1, 2...
2,400
true
true
false
true
true
false
false
false
false
false
1,165
1508A
A bitstring is a string that contains only the characters 0 and 1. Koyomi Kanou is working hard towards her dream of becoming a writer. To practice, she decided to participate in the Binary Novel Writing Contest. The writing prompt for the contest consists of three bitstrings of length $$$2n$$$. A valid novel for the c...
1,900
false
true
true
false
false
true
false
false
false
false
3,136
1918D
You are given an array of numbers $$$a_1, a_2, ldots, a_n$$$. Your task is to block some elements of the array in order to minimize its cost. Suppose you block the elements with indices $$$1 leq b_1 < b_2 < ldots < b_m leq n$$$. Then the cost of the array is calculated as the maximum of: the sum of the blocked element...
1,900
false
false
true
true
true
false
false
true
false
false
785
1197A
Let's denote a $$$k$$$-step ladder as the following structure: exactly $$$k + 2$$$ wooden planks, of which two planks of length at least $$$k+1$$$ — the base of the ladder; $$$k$$$ planks of length at least $$$1$$$ — the steps of the ladder; Note that neither the base planks, nor the steps planks are required to be e...
900
true
true
false
false
false
false
false
false
true
false
4,715
1881B
Once upon a time, bartender Decim found three threadlets and a pair of scissors. In one operation, Decim chooses any threadlet and cuts it into two threadlets, whose lengths are positive integers and their sum is equal to the length of the threadlet being cut. For example, he can cut a threadlet of length $$$5$$$ into ...
900
true
false
false
false
false
false
false
false
false
false
1,003
1513B
A sequence of $$$n$$$ non-negative integers ($$$n ge 2$$$) $$$a_1, a_2, dots, a_n$$$ is called good if for all $$$i$$$ from $$$1$$$ to $$$n-1$$$ the following condition holds true: $$$$$$a_1 : & : a_2 : & : dots : & : a_i = a_{i+1} : & : a_{i+2} : & : dots : & : a_n,$$$$$$ where $$$&$$$ denotes the . Find the number of...
1,400
true
false
false
false
false
true
false
false
false
false
3,101
716A
ZS the Coder is coding on a crazy computer. If you don't type in a word for a _c_ consecutive seconds, everything you typed disappear! More formally, if you typed a word at second _a_ and then the next word at second _b_, then if _b_u2009-u2009_a_u2009≤u2009_c_, just the new word is appended to other words on the scree...
800
false
false
true
false
false
false
false
false
false
false
6,954
1889A
Qingshan has a string $$$s$$$ which only contains $$$ exttt{0}$$$ and $$$ exttt{1}$$$. A string $$$a$$$ of length $$$k$$$ is good if and only if $$$a_i e a_{k-i+1}$$$ for all $$$i=1,2,ldots,k$$$. For Div. 2 contestants, note that this condition is different from the condition in problem B. For example, $$$ exttt{10}$...
1,300
false
true
true
false
false
true
false
false
false
false
966
1444E
This is an interactive problem. You are given a treexa0— connected undirected graph without cycles. One vertex of the tree is special, and you have to find which one. You can ask questions in the following form: given an edge of the tree, which endpoint is closer to the special vertex, meaning which endpoint's shortest...
3,500
false
false
false
true
false
false
true
false
false
false
3,450
1628B
Mihai plans to watch a movie. He only likes palindromic movies, so he wants to skip some (possibly zero) scenes to make the remaining parts of the movie palindromic. You are given a list $$$s$$$ of $$$n$$$ non-empty strings of length at most $$$3$$$, representing the scenes of Mihai's movie. A subsequence of $$$s$$$ is...
1,700
false
true
false
false
false
false
false
false
false
false
2,474
444A
DZY loves Physics, and he enjoys calculating density. Almost everything has density, even a graph. We define the density of a non-directed graph (nodes and edges of the graph have some values) as follows: where _v_ is the sum of the values of the nodes, _e_ is the sum of the values of the edges. Once DZY got a graph _G...
1,600
true
true
false
false
false
false
false
false
false
false
8,063
765G
Problem - 765G - 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...
3,200
true
false
false
true
false
false
true
false
false
false
6,724
220C
Problem - 220C - 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
false
false
true
false
false
false
false
false
8,957
1051C
Vasya has a multiset $$$s$$$ consisting of $$$n$$$ integer numbers. Vasya calls some number $$$x$$$ nice if it appears in the multiset exactly once. For example, multiset $$${1, 1, 2, 3, 3, 3, 4}$$$ contains nice numbers $$$2$$$ and $$$4$$$. Vasya wants to split multiset $$$s$$$ into two multisets $$$a$$$ and $$$b$$$ (...
1,500
true
true
true
true
false
false
true
false
false
false
5,453
1250M
Berland Gardeners United Inc. hired you for the project called "SmartGarden". The main feature of this project is automatic garden watering. Formally the garden can be represented as a square of $$$n imes n$$$ cells with rows numbered $$$1$$$ to $$$n$$$ from top to bottom and columns numbered $$$1$$$ to $$$n$$$ from l...
2,500
false
false
false
false
false
true
false
false
false
false
4,443
165A
One day Vasya painted a Cartesian coordinate system on a piece of paper and marked some set of points (_x_1,u2009_y_1),u2009(_x_2,u2009_y_2),u2009...,u2009(_x__n_,u2009_y__n_). Let's define neighbors for some fixed point from the given set (_x_,u2009_y_): point (_x_',u2009_y_') is (_x_,u2009_y_)'s right neighbor, if _...
1,000
false
false
true
false
false
false
false
false
false
false
9,205
1743G
Problem - 1743G - 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
true
false
false
true
true
true
false
false
false
false
1,818
1747B
You are given an integer $$$n$$$. Let's define $$$s(n)$$$ as the string "BAN" concatenated $$$n$$$ times. For example, $$$s(1)$$$ = "BAN", $$$s(3)$$$ = "BANBANBAN". Note that the length of the string $$$s(n)$$$ is equal to $$$3n$$$. Consider $$$s(n)$$$. You can perform the following operation on $$$s(n)$$$ any number o...
900
false
false
false
false
false
true
false
false
false
false
1,801
60E
Once upon a time in the thicket of the mushroom forest lived mushroom gnomes. They were famous among their neighbors for their magic mushrooms. Their magic nature made it possible that between every two neighboring mushrooms every minute grew another mushroom with the weight equal to the sum of weights of two neighbori...
2,600
true
false
false
false
false
false
false
false
false
false
9,671
89B
Vasya writes his own library for building graphical user interface. Vasya called his creation VTK (VasyaToolKit). One of the interesting aspects of this library is that widgets are packed in each other. A widget is some element of graphical interface. Each widget has width and height, and occupies some rectangle on the...
2,300
false
false
true
true
false
false
false
false
false
true
9,528
8B
The whole world got obsessed with robots,and to keep pace with the progress, great Berland's programmer Draude decided to build his own robot. He was working hard at the robot. He taught it to walk the shortest path from one point to another, to record all its movements, but like in many Draude's programs, there was a ...
1,400
false
false
true
false
false
true
false
false
false
true
9,954
21D
Problem - 21D - 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...
2,400
false
false
false
false
false
false
false
false
false
true
9,889
1325A
Problem - 1325A - 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
true
false
false
false
true
false
false
false
false
4,093
1422D
Yura has been walking for some time already and is planning to return home. He needs to get home as fast as possible. To do this, Yura can use the instant-movement locations around the city. Let's represent the city as an area of $$$n imes n$$$ square blocks. Yura needs to move from the block with coordinates $$$(s_x,...
2,300
false
false
false
false
false
false
false
false
true
true
3,566
97C
One university has just found out about a sport programming contest called ACM ICPC v2.0. This contest doesn't differ much from the well-known ACM ICPC, for example, the participants are not allowed to take part in the finals more than two times. However, there is one notable difference: the teams in the contest should...
2,400
true
false
false
false
false
false
false
true
false
true
9,499
1870A
You are given three non-negative integers $$$n$$$, $$$k$$$, and $$$x$$$. Find the maximum possible sum of elements in an array consisting of non-negative integers, which has $$$n$$$ elements, its MEX is equal to $$$k$$$, and all its elements do not exceed $$$x$$$. If such an array does not exist, output $$$-1$$$. The M...
800
true
true
false
false
false
true
false
false
false
false
1,059
1728A
The title is a reference to the very first Educational Round from our writers team, Educational Round 18. There is a bag, containing colored balls. There are $$$n$$$ different colors of balls, numbered from $$$1$$$ to $$$n$$$. There are $$$mathit{cnt}_i$$$ balls of color $$$i$$$ in the bag. The total amount of balls in...
800
false
true
true
false
false
false
true
false
true
false
1,925
1156E
Problem - 1156E - 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
false
false
false
false
true
false
false
false
false
false
4,926
1943A
Alice and Bob play yet another game on an array $$$a$$$ of size $$$n$$$. Alice starts with an empty array $$$c$$$. Both players take turns playing, with Alice starting first. On Alice's turn, she picks one element from $$$a$$$, appends that element to $$$c$$$, and then deletes it from $$$a$$$. On Bob's turn, he picks o...
1,300
false
true
false
false
false
false
false
false
false
false
623
47D
Problem - 47D - 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...
2,200
false
false
false
false
false
false
true
false
false
false
9,739
1040B
Long story short, shashlik is Miroslav's favorite food. Shashlik is prepared on several skewers simultaneously. There are two states for each skewer: initial and turned over. This time Miroslav laid out $$$n$$$ skewers parallel to each other, and enumerated them with consecutive integers from $$$1$$$ to $$$n$$$ in orde...
1,300
true
true
false
true
false
false
false
false
false
false
5,496
727F
Polycarp is an experienced participant in Codehorses programming contests. Now he wants to become a problemsetter. He sent to the coordinator a set of _n_ problems. Each problem has it's quality, the quality of the _i_-th problem is _a__i_ (_a__i_ can be positive, negative or equal to zero). The problems are ordered by...
2,300
false
true
false
true
false
false
false
true
false
false
6,895
487B
Problem - 487B - Codeforces =============== xa0 ]( --- Finished → Virtual participation Virtual contest is a way to take part in past contest, as close as possible to participation on time. It is supported only ICPC mode for virtual contests. If you've seen these problems, a virtual contest is not for you - s...
2,000
false
false
false
true
true
false
false
true
false
false
7,889
96A
Problem - 96A - 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...
900
false
false
true
false
false
false
false
false
false
false
9,503
9A
Problem - 9A - Codeforces =============== xa0 ]( --- Finished → Virtual participation Virtual contest is a way to take part in past contest, as close as possible to participation on time. It is supported only ICPC mode for virtual contests. If you've seen these problems, a virtual contest is not for you - sol...
800
true
false
false
false
false
false
false
false
false
false
9,950
935B
Two neighboring kingdoms decided to build a wall between them with some gates to enable the citizens to go from one kingdom to another. Each time a citizen passes through a gate, he has to pay one silver coin. The world can be represented by the first quadrant of a plane and the wall is built along the identity line (i...
900
false
false
true
false
false
false
false
false
false
false
5,963
733C
There was an epidemic in Monstropolis and all monsters became sick. To recover, all monsters lined up in queue for an appointment to the only doctor in the city. Soon, monsters became hungry and began to eat each other. One monster can eat other monster if its weight is strictly greater than the weight of the monster b...
1,800
false
true
false
true
false
true
false
false
false
false
6,862
560B
Problem - 560B - 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
true
false
false
false
false
7,592
926C
A camera you have accidentally left in a desert has taken an interesting photo. The photo has a resolution of _n_ pixels width, and each column of this photo is all white or all black. Thus, we can represent the photo as a sequence of _n_ zeros and ones, where 0 means that the corresponding column is all white, and 1 m...
1,700
false
false
true
false
false
false
false
false
false
false
6,003
177E2
The Smart Beaver from ABBYY plans a space travel on an ultramodern spaceship. During the voyage he plans to visit _n_ planets. For planet _i_ _a__i_ is the maximum number of suitcases that an alien tourist is allowed to bring to the planet, and _b__i_ is the number of citizens on the planet. The Smart Beaver is going t...
1,900
false
false
false
false
false
false
false
true
false
false
9,145
918B
As the guys fried the radio station facilities, the school principal gave them tasks as a punishment. Dustin's task was to add comments to nginx configuration for school's website. The school has _n_ servers. Each server has a name and an ip (names aren't necessarily unique, but ips are). Dustin knows the ip and name o...
900
false
false
true
false
false
false
false
false
false
false
6,057
1379A
Acacius is studying strings theory. Today he came with the following problem. You are given a string $$$s$$$ of length $$$n$$$ consisting of lowercase English letters and question marks. It is possible to replace question marks with lowercase English letters in such a way that a string "abacaba" occurs as a substring i...
1,500
false
false
true
false
false
false
true
false
false
false
3,778
1798E
Let's call an array $$$b_1, b_2, ldots, b_m$$$ a test if $$$b_1 = m - 1$$$. Let's call an array $$$b_1, b_2, ldots, b_m$$$ a multitest if the array $$$b_2, b_3, ldots, b_m$$$ can be split into $$$b_1$$$ non-empty subarrays so that each of these subarrays is a test. Note that each element of the array must be included i...
2,300
false
false
false
true
false
false
true
false
false
false
1,486
1997E
Monocarp is playing a computer game. He starts the game being level $$$1$$$. He is about to fight $$$n$$$ monsters, in order from $$$1$$$ to $$$n$$$. The level of the $$$i$$$-th monster is $$$a_i$$$. For each monster in the given order, Monocarp's encounter goes as follows: if Monocarp's level is strictly higher than ...
2,200
false
false
true
false
true
false
true
true
false
false
279
1380D
There are $$$n$$$ warriors in a row. The power of the $$$i$$$-th warrior is $$$a_i$$$. All powers are pairwise distinct. You have two types of spells which you may cast: 1. Fireball: you spend $$$x$$$ mana and destroy exactly $$$k$$$ consecutive warriors; 2. Berserk: you spend $$$y$$$ mana, choose two consecutive warri...
2,000
true
true
true
false
false
true
false
false
false
false
3,768
448B
Bizon the Champion isn't just a bison. He also is a favorite of the "Bizons" team. At a competition the "Bizons" got the following problem: "You are given two distinct words (strings of English letters), _s_ and _t_. You need to transform word _s_ into word _t_". The task looked simple to the guys because they know the...
1,400
false
false
true
false
false
false
false
false
false
false
8,048
1481D
Your friend Salem is Warawreh's brother and only loves math and geometry problems. He has solved plenty of such problems, but according to Warawreh, in order to graduate from university he has to solve more graph problems. Since Salem is not good with graphs he asked your help with the following problem. You are given ...
2,000
false
true
true
false
false
true
true
false
false
true
3,270
1055A
Alice has a birthday today, so she invited home her best friend Bob. Now Bob needs to find a way to commute to the Alice's home. In the city in which Alice and Bob live, the first metro line is being built. This metro line contains $$$n$$$ stations numbered from $$$1$$$ to $$$n$$$. Bob lives near the station with numbe...
900
false
false
false
false
false
false
false
false
false
true
5,439
41A
Problem - 41A - 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...
800
false
false
true
false
false
false
false
false
false
false
9,784
1313D
Being Santa Claus is very difficult. Sometimes you have to deal with difficult situations. Today Santa Claus came to the holiday and there were $$$m$$$ children lined up in front of him. Let's number them from $$$1$$$ to $$$m$$$. Grandfather Frost knows $$$n$$$ spells. The $$$i$$$-th spell gives a candy to every child ...
2,500
false
false
true
true
false
false
false
false
false
false
4,126
212C
A very tense moment: _n_ cowboys stand in a circle and each one points his colt at a neighbor. Each cowboy can point the colt to the person who follows or precedes him in clockwise direction. Human life is worthless, just like in any real western. The picture changes each second! Every second the cowboys analyse the si...
2,100
true
false
false
true
false
false
false
false
false
false
8,991
1617A
You are given strings $$$S$$$ and $$$T$$$, consisting of lowercase English letters. It is guaranteed that $$$T$$$ is a permutation of the string abc. Find string $$$S'$$$, the lexicographically smallest permutation of $$$S$$$ such that $$$T$$$ is not a subsequence of $$$S'$$$. String $$$a$$$ is a permutation of string ...
800
false
true
false
false
false
true
false
false
true
false
2,548