
Month: May 2020


Median on Segments
You are given a permutation $p_1, p_2, \dots, p_n$. A permutation of length $n$ is a sequence such that each integer between $1$ and $n$ […]


Double Elimination
The biggest event of the year – Cota 2 world championship “The Innernational” is right around the corner. $2^n$ teams will compete in a double-elimination […]

Likes Display
Polycarp is working on the implementation of displaying likes on the Codehorses social network. The number of likes should be displayed in a format that […]


Dream Team
Polycarp is the project manager in the IT-company. Right now, he needs to choose developers for his team to start a new project. The company […]

Bonus Distribution
For the first time, Polycarp’s startup ended the year with a profit! Now he is about to distribute $k$ burles as a bonus among $n$ […]


Modernization of Treeland
Treeland consists of $n$ cities and $n-1$ two-way roads connecting pairs of cities. From every city, you can reach every other city moving only by […]

Paint the String
You are given a string $s$ of lowercase Latin letters. It is required to paint each letter of the string in one of two colors […]


Falling Blocks
Recently, Polycarp has invented a new mobile game with falling blocks. In the game, $n$ blocks are falling down, one at a time, towards a […]

Kuroni and the Gifts
Kuroni has $n$ daughters. As gifts for them, he bought $n$ necklaces and $n$ bracelets: the $i$-th necklace has a brightness $a_i$, where all the […]

Kuroni and Impossible Calculation
To become the king of Codeforces, Kuroni has to solve the following problem. He is given $n$ numbers $a_1, a_2, \dots, a_n$. Help Kuroni to […]

Kuroni and Simple Strings
Now that Kuroni has reached 10 years old, he is a big boy and doesn’t like arrays of integers as presents anymore. This year he […]

Kuroni and the Score Distribution
Kuroni is the coordinator of the next Mathforces round written by the “Proof by AC” team. All the preparation has been done, and he is […]

Kuroni and the Celebration
This is an interactive problem. After getting AC after 13 Time Limit Exceeded verdicts on a geometry problem, Kuroni went to an Italian restaurant to […]

Kuroni and the Punishment
Kuroni is very angry at the other setters for using him as a theme! As a punishment, he forced them to solve the following problem: […]

Kuroni the Private Tutor
As a professional private tutor, Kuroni has to gather statistics of an exam. Kuroni has appointed you to complete this important task. You must not […]