
Month: May 2020


Optimal Subsequences (Hard Version)
This is the harder version of the problem. In this version, $1 \le n, m \le 2\cdot10^5$. You can hack this problem if you locked […]

Optimal Subsequences (Easy Version)
This is the easier version of the problem. In this version $1 \le n, m \le 100$. You can hack this problem only if you […]

Wrong Answer on Test 233 (Hard Version)
This is the harder version of the problem. In this version, $1 \le n \le 2\cdot10^5$. You can hack this problem if you locked it. […]

Wrong Answer on Test 233 (Easy Version)
This is the easier version of the problem. In this version $1 \le n \le 2000$. You can hack this problem only if you solve […]


Arson In Berland Forest
The Berland Forest can be represented as an infinite cell plane. Every cell contains a tree. That is, contained before the recent events. A destructive […]


Beautiful Sequence
An integer sequence is called beautiful if the difference between any two consecutive numbers is equal to $1$. More formally, a sequence $s_1, s_2, \ldots, s_{n}$ is […]

Beautiful Regional Contest
So the Beautiful Regional Contest (BeRC) has come to an end! $n$ students took part in the contest. The final standings are already known: the […]

Beautiful Mirrors with queries
Creatnx has $n$ mirrors, numbered from $1$ to $n$. Every day, Creatnx asks exactly one mirror “Am I beautiful?”. The $i$-th mirror will tell Creatnx […]

Beautiful Bracket Sequence (easy version)
This is the easy version of this problem. The only difference is the limit of $n$ – the length of the input string. In this […]

Beautiful Bracket Sequence (hard version)
This is the hard version of this problem. The only difference is the limit of $n$ – the length of the input string. In this […]

Beautiful League
A football league has recently begun in Beautiful land. There are $n$ teams participating in the league. Let’s enumerate them with integers from $1$ to […]

Competitive Programmer
Bob is a competitive programmer. He wants to become red, and for that he needs a strict training regime. He went to the annual meeting […]

Dice Tower
Bob is playing with $6$-sided dice. A net of such standard cube is shown below. He has an unlimited supply of these dice and wants […]

Diverse Matrix
Let $a$ be a matrix of size $r \times c$ containing positive integers, not necessarily distinct. Rows of the matrix are numbered from $1$ to […]

Decreasing Debts
There are $n$ people in this world, conveniently numbered $1$ through $n$. They are using burles to buy goods and services. Occasionally, a person might […]

Spaceship Solitaire
Bob is playing a game of Spaceship Solitaire. The goal of this game is to build a spaceship. In order to do this, he first […]

Almost Same Distance
Let $G$ be a simple graph. Let $W$ be a non-empty subset of vertices. Then $W$ is almost-$k$-uniform if for each pair of distinct vertices $u,v \in […]