Gold Experience

2020 VietMX 0

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

MP3

2020 VietMX 0

One common way of digitalizing sound is to record sound intensity at particular time moments. For each time moment intensity is recorded as a non-negative […]

Welfare State

2020 VietMX 0

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

GCD Groups 2

2020 VietMX 1

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

Mysterious Crime

2020 VietMX 0

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

XORinacci

2020 VietMX 0

Cengiz recently learned Fibonacci numbers and now he is studying different algorithms to find them. After getting bored of reading them, he came with his […]

Uniqueness

2020 VietMX 0

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

Restore Permutation

2020 VietMX 0

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

Magic Grid

2020 VietMX 0

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

Let Them Slide

2020 VietMX 0

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

Bits And Pieces

2020 VietMX 0

You are given an array $a$ of $n$ integers. You need to find the maximum value of $a_{i} | ( a_{j} \& a_{k} )$ over […]

Polygons

2020 VietMX 0

You are given two integers $n$ and $k$. You need to construct $k$ regular polygons having same circumcircle, with distinct number of sides $l$ between $3$ and $n$. […]

Red Blue Tree

2020 VietMX 0

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

Wrong Subtraction

2020 VietMX 0

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

Less or Equal

2020 VietMX 0

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

Booking System

2020 VietMX 0

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