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
1211C
Summer in Berland lasts $$$n$$$ days, the price of one portion of ice cream on the $$$i$$$-th day is $$$c_i$$$. Over the summer, Tanya wants to eat exactly $$$k$$$ portions of ice cream. At the same time, on the $$$i$$$-th day, she decided that she would eat at least $$$a_i$$$ portions, but not more than $$$b_i$$$ ($$$...
1,700
false
true
false
false
false
false
false
false
true
false
4,626
2014G
What is done is done, and the spoilt milk cannot be helped. Little John is as little as night is day — he was known to be a giant, at possibly $$$2.1$$$ metres tall. It has everything to do with his love for milk. His dairy diary has $$$n$$$ entries, showing that he acquired $$$a_i$$$ pints of fresh milk on day $$$d_i$...
2,200
false
true
true
false
true
false
true
false
false
false
165
893A
Alex, Bob and Carl will soon participate in a team chess tournament. Since they are all in the same team, they have decided to practise really hard before the tournament. But it's a bit difficult for them because chess is a game for two players, not three. So they play with each other according to following rules: Ale...
900
false
false
true
false
false
false
false
false
false
false
6,181
591A
Harry Potter and He-Who-Must-Not-Be-Named engaged in a fight to the death once again. This time they are located at opposite ends of the corridor of length _l_. Two opponents simultaneously charge a deadly spell in the enemy. We know that the impulse of Harry's magic spell flies at a speed of _p_ meters per second, and...
900
true
false
true
false
false
false
false
false
false
false
7,484
270A
Problem - 270A - 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
false
false
false
false
false
8,753
1322C
Wu got hungry after an intense training session, and came to a nearby store to buy his favourite instant noodles. After Wu paid for his purchase, the cashier gave him an interesting task. You are given a bipartite graph with positive integers in all vertices of the right half. For a subset $$$S$$$ of vertices of the le...
2,300
true
false
false
false
false
false
false
false
false
true
4,105
1864B
You are given a string $$$s$$$ of length $$$n$$$ consisting of lowercase English letters, and an integer $$$k$$$. In one step you can perform any one of the two operations below: Pick an index $$$i$$$ ($$$1 le i le n - 2$$$) and swap $$$s_{i}$$$ and $$$s_{i+2}$$$. Pick an index $$$i$$$ ($$$1 le i le n-k+1$$$) and rev...
1,100
false
true
false
false
false
true
false
false
true
false
1,096
1480B
The great hero guards the country where Homer lives. The hero has attack power $$$A$$$ and initial health value $$$B$$$. There are $$$n$$$ monsters in front of the hero. The $$$i$$$-th monster has attack power $$$a_i$$$ and initial health value $$$b_i$$$. The hero or a monster is said to be living, if his or its health...
900
false
true
true
false
false
false
false
false
true
false
3,274
386A
Problem - 386A - Codeforces =============== xa0 . Write a program that reads prices offered by bidders and finds the winner and the price he will pay. Consider that all of the offered prices are different. Input The first line of the input contains _n_ (2u2009≤u2009_n_u2009≤u20091000) — number of bidders. The...
800
false
false
true
false
false
false
false
false
false
false
8,286
1294C
Problem - 1294C - 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
true
false
false
false
false
false
false
false
false
4,227
1769B1
Statement is not available on English language В этой версии задачи размеры копируемых файлов не превышают $$$1000$$$ байт. Вы копируете с одного сервера на другой $$$n$$$ файлов размером $$$a_1, a_2, ldots, a_n$$$ байт. Файлы копируются последовательно в заданном порядке. При копировании вы видите два прогресс-бара: п...
1,000
true
false
true
false
false
false
true
false
false
false
1,684
1467C
You are given three bags. Each bag contains a non-empty multiset of numbers. You can perform a number of operations on these bags. In one operation, you can choose any two non-empty bags, and choose one number from each of the bags. Let's say that you choose number $$$a$$$ from the first bag and number $$$b$$$ from the...
1,900
false
true
false
false
false
true
false
false
false
false
3,355
209B
Flatland is inhabited by pixels of three colors: red, green and blue. We know that if two pixels of different colors meet in a violent fight, only one of them survives the fight (that is, the total number of pixels decreases by one). Besides, if pixels of colors _x_ and _y_ (_x_u2009≠u2009_y_) meet in a violent fight, ...
2,100
true
false
false
false
false
true
false
false
false
false
8,995
1910F
Monocarp is playing a computer game where he's controlling an empire. An empire consists of $$$n$$$ cities, connected by $$$n - 1$$$ roads. The cities are numbered from $$$1$$$ to $$$n$$$. It's possible to reach every city from every other one using the roads. Traversing every road takes $$$2$$$ hours. However, that ca...
2,000
false
true
false
false
false
false
false
false
false
false
842
524F
Polycarpus has a finite sequence of opening and closing brackets. In order not to fall asleep in a lecture, Polycarpus is having fun with his sequence. He is able to perform two operations: adding any bracket in any position (in the beginning, the end, or between any two existing brackets); cyclic shift — moving the ...
2,700
false
true
false
false
true
false
false
false
false
false
7,737
934A
Nian is a monster which lives deep in the oceans. Once a year, it shows up on the land, devouring livestock and even people. In order to keep the monster away, people fill their villages with red colour, light, and cracking noise, all of which frighten the monster out of coming. Little Tommy has _n_ lanterns and Big Ba...
1,400
false
false
false
false
false
false
true
false
false
false
5,966
756A
Pavel cooks barbecue. There are _n_ skewers, they lay on a brazier in a row, each on one of _n_ positions. Pavel wants each skewer to be cooked some time in every of _n_ positions in two directions: in the one it was directed originally and in the reversed direction. Pavel has a plan: a permutation _p_ and a sequence _...
1,700
false
false
false
false
false
true
false
false
false
false
6,770
543C
You have multiset of _n_ strings of the same length, consisting of lowercase English letters. We will say that those strings are easy to remember if for each string there is some position _i_ and some letter _c_ of the English alphabet, such that this string is the only string in the multiset that has letter _c_ in pos...
2,500
false
false
false
true
false
false
false
false
false
false
7,667
1573B
You are given two arrays $$$a$$$ and $$$b$$$ of length $$$n$$$. Array $$$a$$$ contains each odd integer from $$$1$$$ to $$$2n$$$ in an arbitrary order, and array $$$b$$$ contains each even integer from $$$1$$$ to $$$2n$$$ in an arbitrary order. You can perform the following operation on those arrays: choose one of the...
1,400
true
true
false
false
false
false
false
false
true
false
2,775
407B
One day, little Vasya found himself in a maze consisting of (_n_u2009+u20091) rooms, numbered from 1 to (_n_u2009+u20091). Initially, Vasya is at the first room and to get out of the maze, he needs to get to the (_n_u2009+u20091)-th one. The maze is organized as follows. Each room of the maze has two one-way portals. L...
1,600
false
false
true
true
false
false
false
false
false
false
8,197
150E
This winter is so... well, you've got the idea :-) The Nvodsk road system can be represented as _n_ junctions connected with _n_u2009-u20091 bidirectional roads so that there is a path between any two junctions. The organizers of some event want to choose a place to accommodate the participants (junction _v_), and the ...
3,000
false
false
false
false
true
false
false
true
false
false
9,272
61A
Shapur was an extremely gifted student. He was great at everything including Combinatorics, Algebra, Number Theory, Geometry, Calculus, etc. He was not only smart but extraordinarily fast! He could manage to sum 1018 numbers in a single second. One day in 230 AD Shapur was trying to find out if any one can possibly do ...
800
false
false
true
false
false
false
false
false
false
false
9,670
961C
Magnus decided to play a classic chess game. Though what he saw in his locker shocked him! His favourite chessboard got broken into 4 pieces, each of size _n_ by _n_, _n_ is always odd. And what's even worse, some squares were of wrong color. _j_-th square of the _i_-th row of _k_-th piece of the board has color _a__k_...
1,400
false
false
true
false
false
false
true
false
false
false
5,861
49E
The DNA sequence for every living creature in Berland can be represented as a non-empty line consisting of lowercase Latin letters. Berland scientists found out that all the creatures evolve by stages. During one stage exactly one symbol of the DNA line is replaced by exactly two other ones. At that overall there are _...
2,300
false
false
false
true
false
false
false
false
false
false
9,725
1307C
Bessie the cow has just intercepted a text that Farmer John sent to Burger Queen! However, Bessie is sure that there is a secret message hidden inside. The text is a string $$$s$$$ of lowercase Latin letters. She considers a string $$$t$$$ as hidden in string $$$s$$$ if $$$t$$$ exists as a subsequence of $$$s$$$ whose ...
1,500
true
false
false
true
false
false
true
false
false
false
4,154
1379B
Pasha loves to send strictly positive integers to his friends. Pasha cares about security, therefore when he wants to send an integer $$$n$$$, he encrypts it in the following way: he picks three integers $$$a$$$, $$$b$$$ and $$$c$$$ such that $$$l leq a,b,c leq r$$$, and then he computes the encrypted value $$$m = n cd...
1,500
true
false
false
false
false
false
true
true
false
false
3,777
1776E
Isona is in a train station. This station has two platforms, and between them there are $$$m$$$ parallel railways that can be viewed as infinite straight lines. Each railway is identified with an integer from $$$1$$$ to $$$m$$$, railway $$$1$$$ being the closest to the first platform and railway $$$m$$$ being the farth...
3,500
false
false
false
true
true
false
false
false
false
false
1,624
1822F
Two friends, Alisa and Yuki, planted a tree with $$$n$$$ vertices in their garden. A tree is an undirected graph without cycles, loops, or multiple edges. Each edge in this tree has a length of $$$k$$$. Initially, vertex $$$1$$$ is the root of the tree. Alisa and Yuki are growing the tree not just for fun, they want to...
1,700
false
false
false
true
false
false
true
false
false
true
1,346
339B
Problem - 339B - 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
8,479
1713C
A $$$mathbf{0}$$$-indexed array $$$a$$$ of size $$$n$$$ is called good if for all valid indices $$$i$$$ ($$$0 le i le n-1$$$), $$$a_i + i$$$ is a perfect square$$$^dagger$$$. Given an integer $$$n$$$. Find a permutation$$$^ddagger$$$ $$$p$$$ of $$$[0,1,2,ldots,n-1]$$$ that is good or determine that no such permutation ...
1,200
true
false
false
true
false
true
false
false
false
false
2,004
1140C
You have a playlist consisting of $$$n$$$ songs. The $$$i$$$-th song is characterized by two numbers $$$t_i$$$ and $$$b_i$$$ — its length and beauty respectively. The pleasure of listening to set of songs is equal to the total length of the songs in the set multiplied by the minimum beauty among them. For example, the ...
1,600
false
false
false
false
true
false
true
false
true
false
5,026
1493D
Problem - 1493D - Codeforces =============== xa0 ]( --- Finished → Virtual participation Virtual contest is a way to take part in past contest, as close as possible to participation on time. It is supported only ICPC mode for virtual contests. If you've seen these problems, a virtual contest is not for you - ...
2,100
true
false
true
false
true
false
true
false
true
false
3,205
1548E
Two painters, Amin and Benj, are repainting Gregor's living room ceiling! The ceiling can be modeled as an $$$n imes m$$$ grid. For each $$$i$$$ between $$$1$$$ and $$$n$$$, inclusive, painter Amin applies $$$a_i$$$ layers of paint to the entire $$$i$$$-th row. For each $$$j$$$ between $$$1$$$ and $$$m$$$, inclusive, ...
3,400
true
true
false
false
true
false
false
false
false
true
2,901
2008F
Sakurako has a box with $$$n$$$ balls. Each ball has it's value. She wants to bet with her friend that if the friend randomly picks two balls from the box (it could be two distinct balls, but they may have the same value), the product of their values will be the same as the number that Sakurako guessed. Since Sakurako ...
1,400
true
false
false
false
false
false
false
false
false
false
203
1546B
AquaMoon had $$$n$$$ strings of length $$$m$$$ each. $$$n$$$ is an odd number. When AquaMoon was gone, Cirno tried to pair these $$$n$$$ strings together. After making $$$frac{n-1}{2}$$$ pairs, she found out that there was exactly one string without the pair! In her rage, she disrupted each pair of strings. For each pa...
1,200
true
false
false
false
false
false
false
false
false
false
2,914
1687D
Problem - 1687D - 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,900
true
false
true
false
true
false
true
true
false
false
2,154
309D
Professional sport is more than hard work. It also is the equipment, designed by top engineers. As an example, let's take tennis. Not only should you be in great shape, you also need an excellent racket! In this problem your task is to contribute to the development of tennis and to help to design a revolutionary new co...
2,700
false
false
false
false
false
false
true
false
false
false
8,604
1583B
Lord Omkar would like to have a tree with $$$n$$$ nodes ($$$3 le n le 10^5$$$) and has asked his disciples to construct the tree. However, Lord Omkar has created $$$m$$$ ($$$mathbf{1 le m < n}$$$) restrictions to ensure that the tree will be as heavenly as possible. A tree with $$$n$$$ nodes is an connected undirected ...
1,200
false
false
false
false
false
true
false
false
false
false
2,716
87D
A long time ago in some country in Asia were civil wars. Each of _n_ cities wanted to seize power. That's why sometimes one city gathered an army and sent it to campaign against another city. Road making was difficult, so the country had few roads, exactly _n_u2009-u20091. Also you could reach any city from any other c...
2,300
false
false
true
true
false
false
false
false
true
true
9,533
719B
Anatoly lives in the university dorm as many other students do. As you know, cockroaches are also living there together with students. Cockroaches might be of two colors: black and red. There are _n_ cockroaches living in Anatoly's room. Anatoly just made all his cockroaches to form a single line. As he is a perfection...
1,400
false
true
false
false
false
false
false
false
false
false
6,938
1415F
You live on a number line. You are initially (at time moment $$$t = 0$$$) located at point $$$x = 0$$$. There are $$$n$$$ events of the following type: at time $$$t_i$$$ a small cake appears at coordinate $$$x_i$$$. To collect this cake, you have to be at this coordinate at this point, otherwise the cake spoils immedia...
2,900
false
false
false
true
false
false
false
false
false
false
3,603
1158F
Let $$$c$$$ be some positive integer. Let's call an array $$$a_1, a_2, ldots, a_n$$$ of positive integers $$$c$$$-array, if for all $$$i$$$ condition $$$1 leq a_i leq c$$$ is satisfied. Let's call $$$c$$$-array $$$b_1, b_2, ldots, b_k$$$ a subarray of $$$c$$$-array $$$a_1, a_2, ldots, a_n$$$, if there exists such set o...
3,500
true
false
false
true
false
false
false
false
false
false
4,910
1838D
There is a string $$$s$$$ of length $$$n$$$ consisting of the characters '(' and ')'. You are walking on this string. You start by standing on top of the first character of $$$s$$$, and you want to make a sequence of moves such that you end on the $$$n$$$-th character. In one step, you can move one space to the left (i...
2,100
false
true
false
false
true
false
false
false
false
false
1,261
712E
There are _n_ casinos lined in a row. If Memory plays at casino _i_, he has probability _p__i_ to win and move to the casino on the right (_i_u2009+u20091) or exit the row (if _i_u2009=u2009_n_), and a probability 1u2009-u2009_p__i_ to lose and move to the casino on the left (_i_u2009-u20091) or also exit the row (if _...
2,500
true
false
false
false
true
false
false
false
false
false
6,967
1045C
In an unspecified solar system, there are $$$N$$$ planets. A space government company has recently hired space contractors to build $$$M$$$ bidirectional Hyperspace™ highways, each connecting two different planets. The primary objective, which was to make sure that every planet can be reached from any other planet taki...
2,300
false
false
false
false
false
false
false
false
false
true
5,468
986B
Petr likes to come up with problems about randomly generated data. This time problem is about random permutation. He decided to generate a random permutation this way: he takes identity permutation of numbers from $$$1$$$ to $$$n$$$ and then $$$3n$$$ times takes a random pair of different elements and swaps them. Alex ...
1,800
true
false
false
false
false
false
false
false
false
false
5,771
1612B
A permutation of length $$$n$$$ is an array $$$p=[p_1,p_2,dots, p_n]$$$ which contains every integer from $$$1$$$ to $$$n$$$ (inclusive) exactly once. For example, $$$p=[4, 2, 6, 5, 3, 1]$$$ is a permutation of length $$$6$$$. You are given three integers $$$n$$$, $$$a$$$ and $$$b$$$, where $$$n$$$ is an even number. P...
900
false
true
false
false
false
true
false
false
false
false
2,582
570B
One day Misha and Andrew were playing a very simple game. First, each player chooses an integer in the range from 1 to _n_. Let's assume that Misha chose number _m_, and Andrew chose number _a_. Then, by using a random generator they choose a random integer _c_ in the range between 1 and _n_ (any integer from 1 to _n_ ...
1,300
true
true
true
false
false
true
false
false
false
false
7,570
1912D
Daisy has recently learned divisibility rules for integers and she is fascinated by them. One of the tests she learned is a divisibility test by 3. You can find a sum of all digits of a decimal number and check if the resulting sum is divisible by 3. Moreover, the resulting sum of digits is congruent modulo 3 to the or...
1,900
true
false
false
false
false
false
false
false
false
false
834
1749E
Monocarp is playing Minecraft and wants to build a wall of cacti. He wants to build it on a field of sand of the size of $$$n imes m$$$ cells. Initially, there are cacti in some cells of the field. Note that, in Minecraft, cacti cannot grow on cells adjacent to each other by side — and the initial field meets this res...
2,400
false
false
false
false
false
true
false
false
false
true
1,787
181B
Problem - 181B - Codeforces =============== xa0 ]( --- Finished → Virtual participation Virtual contest is a way to take part in past contest, as close as possible to participation on time. It is supported only ICPC mode for virtual contests. If you've seen these problems, a virtual contest is not for you - s...
1,300
false
false
false
false
false
false
true
true
false
false
9,115
914B
Edogawa Conan got tired of solving cases, and invited his friend, Professor Agasa, over. They decided to play a game of cards. Conan has _n_ cards, and the _i_-th card has a number _a__i_ written on it. They take turns playing, starting with Conan. In each turn, the player chooses a card and removes it. Also, he remove...
1,200
false
true
true
false
false
false
false
false
false
false
6,082
1186E
Vus the Cossack has a field with dimensions $$$n imes m$$$, which consists of "0" and "1". He is building an infinite field from this field. He is doing this in this way: 1. He takes the current field and finds a new inverted field. In other words, the new field will contain "1" only there, where "0" was in the curren...
2,500
true
false
true
false
false
false
false
false
false
false
4,768
1970A1
Enter Register HOME TOP CATALOG CONTESTS GYM PROBLEMSET GROUPS RATING EDU API CALENDAR HELP RAYAN Helvetic Coding Contest 2024 online mirror (teams allowed, unrated) 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 o...
1,000
false
false
true
false
false
false
false
false
true
false
486
748E
Santa Claus has _n_ tangerines, and the _i_-th of them consists of exactly _a__i_ slices. Santa Claus came to a school which has _k_ pupils. Santa decided to treat them with tangerines. However, there can be too few tangerines to present at least one tangerine to each pupil. So Santa decided to divide tangerines into p...
2,100
false
true
false
false
true
false
false
true
false
false
6,800
875D
Disclaimer: there are lots of untranslateable puns in the Russian version of the statement, so there is one more reason for you to learn Russian :) Rick and Morty like to go to the ridge High Cry for crying loudlyxa0— there is an extraordinary echo. Recently they discovered an interesting acoustic characteristic of thi...
2,200
false
false
false
false
true
false
false
true
false
false
6,245
1012E
You are given an array of $$$n$$$ positive integers $$$a_1, a_2, dots, a_n$$$. You can perform the following operation any number of times: select several distinct indices $$$i_1, i_2, dots, i_k$$$ ($$$1 le i_j le n$$$) and move the number standing at the position $$$i_1$$$ to the position $$$i_2$$$, the number at the ...
3,100
true
false
false
false
false
false
false
false
false
false
5,623
961G
You are given a set of _n_ elements indexed from 1 to _n_. The weight of _i_-th element is _w__i_. The weight of some subset of a given set is denoted as . The weight of some partition _R_ of a given set into _k_ subsets is (recall that a partition of a given set is a set of its subsets such that every element of the g...
2,700
true
false
false
false
false
false
false
false
false
false
5,857
1896G
This is an interactive problem. There are $$$n^2$$$ pepes labeled $$$1, 2, ldots, n^2$$$ with pairwise distinct speeds. You would like to set up some races to find out the relative speed of these pepes. In one race, you can choose exactly $$$n$$$ distinct pepes and make them race against each other. After each race, yo...
3,200
false
false
true
false
false
true
false
false
true
false
931
478A
There are five people playing a game called "Generosity". Each person gives some non-zero number of coins _b_ as an initial bet. After all players make their bets of _b_ coins, the following operation is repeated for several times: a coin is passed from one player to some other player. Your task is to write a program t...
1,100
false
false
true
false
false
false
false
false
false
false
7,921