
Month: May 2020


A Game on Strings
Alice and Bob are playing a game on strings. Initially, they have some string $t$. In one move the first player selects the character $c$ […]

King Escape
Alice and Bob are playing chess on a huge chessboard with dimensions $n \times n$. Alice has a single piece left — a queen, located at […]

Square Difference
Alice has a lovely piece of cloth. It has the shape of a square with a side of length $a$ centimeters. Bob also wants such piece of […]

Permutation Game
After a long day, Alice and Bob decided to play a little game. The game board consists of $n$ cells in a straight line, numbered […]


Boolean Computer
Alice has a computer that operates on $w$-bit integers. The computer has $n$ registers for values. The current content of the registers is given as an array […]


Hidden Bipartite Graph
Bob has a simple undirected connected graph (without self-loops and multiple edges). He wants to learn whether his graph is bipartite (that is, you can […]


Radio stations
In the lattice points of the coordinate line there are n radio stations, the i-th of which is described by three integers: x i — the coordinate of the i-th station […]

Yet Another Array Queries Problem
You are given an array a of size n, and q queries to it. There are queries of two types: 1 l i r i — perform a cyclic shift of the segment [l i, r i] to the right. […]


Letters Removing
Petya has a string of length n consisting of small and large English letters and digits. He performs m operations. Each operation is described with two integers l and r and a character c: […]


Lost Array
Bajtek, known for his unusual gifts, recently got an integer array $x_0, x_1, \ldots, x_{k-1}$. Unfortunately, after a huge array-party with his extraordinary friends, he […]

Smallest Word
IA has so many colorful magnets on her fridge! Exactly one letter is written on each magnet, ‘a’ or ‘b’. She loves to play with […]

Train Hard, Win Easy
Zibi is a competitive programming coach. There are $n$ competitors who want to be prepared well. The training contests are quite unusual – there are two […]

Make It One
Janusz is a businessman. He owns a company “Januszex”, which produces games for teenagers. Last hit of Januszex was a cool one-person game “Make it […]

Speckled Band
Ildar took a band (a thin strip of cloth) and colored it. Formally, the band has $n$ cells, each of them is colored into one […]