Au Pont Rouge

2020 VietMX 0

VK just opened its second HQ in St. Petersburg! Side of its office building has a huge string $s$ written on its side. This part […]

Bad Cryptography

2020 VietMX 0

In modern cryptography much is tied to the algorithmic complexity of solving several problems. One of such problems is a discrete logarithm problem. It is […]

Remove Duplicates

2020 VietMX 0

Petya has an array $a$ consisting of $n$ integers. He wants to remove duplicate (equal) elements. Petya wants to leave only the rightmost entry (occurrence) […]

File Name

2020 VietMX 0

You can not just take the file and send it. When Polycarp trying to send a file in the social network “Codehorses”, he encountered an […]

Bus Video System

2020 VietMX 0

The busses in Berland are equipped with a video surveillance system. The system records information about changes in the number of passengers in a bus […]

Mentors

2020 VietMX 0

In BerSoft $n$ programmers work, the programmer $i$ is characterized by a skill $r_i$. A programmer $a$ can be a mentor of a programmer $b$ […]

Median on Segments

2020 VietMX 0

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$ […]

Tourism

2020 VietMX 0

Masha lives in a country with $n$ cities numbered from $1$ to $n$. She lives in the city number $1$. There is a direct train route between […]

Double Elimination

2020 VietMX 0

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

2020 VietMX 0

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 […]

Cartoons

2020 VietMX 0

Tanya likes cartoons. She knows that $n$ new cartoons will be released in his favorite cinema: the $i$-th of them will be airing from the […]

Dream Team

2020 VietMX 0

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

2020 VietMX 0

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$ […]

Movie Fan

2020 VietMX 0

Recently, Polycarp has been a fan of cinema novelties and is trying not to miss them! In the near future, $n$ new movies will be […]

Paint the String

2020 VietMX 0

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 […]

M-numbers

2020 VietMX 0

For a given positive integer $m$, a positive number is called a $m$-number if the product of its digits is $m$. For example, the beginning […]

Falling Blocks

2020 VietMX 0

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

2020 VietMX 0

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 […]