
Gold Experience
Consider an undirected graph $G$ with $n$ vertices. There is a value $a_i$ in each vertex. Two vertices $i$ and $j$ are connected with an […]
Consider an undirected graph $G$ with $n$ vertices. There is a value $a_i$ in each vertex. Two vertices $i$ and $j$ are connected with an […]
You are given a graph with $3 \cdot n$ vertices and $m$ edges. You are to find a matching of $n$ edges, or an independent set of […]
There is a country with $n$ citizens. The $i$-th of them initially has $a_{i}$ money. The government strictly controls the wealth of its citizens. Whenever […]
There is a square grid of size $n \times n$. Some cells are colored in black, all others are colored in white. In one operation […]
There is a square grid of size $n \times n$. Some cells are colored in black, all others are colored in white. In one operation […]
You are given an array of $n$ integers. You need to split all integers into two groups so that the GCD of all integers in […]
Acingel is a small town. There was only one doctor here — Miss Ada. She was very friendly and nobody has ever said something bad about […]
You are given an array $a_{1}, a_{2}, \ldots, a_{n}$. You can remove at most one subsegment from it. The remaining elements should be pairwise distinct. In other […]
An array of integers $p_{1},p_{2}, \ldots,p_{n}$ is called a permutation if it contains each number from $1$ to $n$ exactly once. For example, the following […]
Let us define a magic grid to be a square matrix of integers of size $n \times n$, satisfying the following conditions. All integers from $0$ to […]
You are given $n$ arrays that can have different sizes. You also have a table with $w$ columns and $n$ rows. The $i$-th array is […]
You are given an array $a$ of $n$ integers. You need to find the maximum value of $a_{i} | ( a_{j} \& a_{k} )$ over […]
You are given a tree of $n$ nodes. The tree is rooted at node $1$, which is not considered as a leaf regardless of its […]
Little girl Tanya is learning how to decrease a number by one, but she does it wrong with a number consisting of two or more […]
You are given a sequence of integers of length $n$ and integer number $k$. You should print any integer number $x$ in the range of $[1; 10^9]$ […]
Polycarp likes to play with numbers. He takes some integer number $x$, writes it down on the board, and then performs with it $n – […]
Innovation technologies are on a victorious march around the planet. They integrate into all spheres of human activity! A restaurant called “Dijkstra’s Place” has started […]