Packets

2020 VietMX 0

You have $n$ coins, each of the same value of $1$. Distribute them into packets such that any amount $x$ ($1 \leq x \leq n$) […]

Reach Median

2020 VietMX 0

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

Equalize

2020 VietMX 0

You are given two binary strings $a$ and $b$ of the same length. You can perform the following two operations on the string $a$: Swap […]

Valid BFS?

2020 VietMX 0

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

Trips

2020 VietMX 0

There are $n$ persons who initially don’t know each other. On each morning, two of them, who were not friends before, become friends. We want […]

Security

2020 VietMX 0

Some programming website is establishing a secure communication protocol. For security reasons, they want to choose several more or less random strings. Initially, they have […]

A Game on Strings

2020 VietMX 0

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

2020 VietMX 0

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

2020 VietMX 0

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

2020 VietMX 0

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

Divisors

2020 VietMX 0

You are given $n$ integers $a_1, a_2, \ldots, a_n$. Each of $a_i$ has between $3$ and $5$ divisors. Consider $a = \prod a_i$ — the product […]

Boolean Computer

2020 VietMX 0

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

Chip Game

2020 VietMX 0

Alice and Bob decided to play one ultimate game. They have $n$ piles, the $i$-th pile initially contain $v_i$ chips. Alice selects a positive integer […]

Hidden Bipartite Graph

2020 VietMX 0

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

Envy

2020 VietMX 0

For a connected undirected weighted graph G, MST (minimum spanning tree) is a subgraph of G that contains all of G‘s vertices, is a tree, and sum of its […]

Radio stations

2020 VietMX 0

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

Dog Show

2020 VietMX 1

A new dog show on TV is starting next week. On the show dogs are required to demonstrate bottomless stomach, strategic thinking and self-preservation instinct. […]

Letters Removing

2020 VietMX 0

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