
ACM


Reach Median
You are given an array $a$ of $n$ integers and an integer $s$. It is guaranteed that $n$ is odd. In one operation you can […]


Valid BFS?
The BFS algorithm is defined as follows. Consider an undirected graph with vertices numbered from $1$ to $n$. Initialize $q$ as a new queue containing only vertex $1$, mark […]

Maximum Reduction
Given an array $a$ of $n$ integers and an integer $k$ ($2 \le k \le n$), where each element of the array is denoted by […]



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