Dreamoon Likes Coloring

2020 VietMX 0

Dreamoon likes coloring cells very much. There is a row of $n$ cells. Initially, all cells are empty (don’t contain any color). Cells are numbered […]

Drazil Likes Heap

2020 VietMX 0

Drazil likes heap very much. So he created a problem with heap: There is a max heap with a height $h$ implemented on the array. […]

Dreamoon Likes Strings

2020 VietMX 0

Dreamoon likes strings. Today he created a game about strings: String $s_1, s_2, \ldots, s_n$ is beautiful if and only if for each $1 \le i < […]

Powered Addition

2020 VietMX 0

You have an array $a$ of length $n$. For every positive integer $x$ you are going to perform the following operation during the $x$-th second: […]

Edge Weight Assignment

2020 VietMX 0

You have unweighted tree of $n$ vertices. You have to assign a positive weight to each edge so that the following condition would hold: For every two […]

Perfect Triples

2020 VietMX 0

Consider the infinite sequence $s$ of positive integers, created by repeating the following steps: Find the lexicographically smallest triple of positive integers $(a, b, c)$ […]

Nested Rubber Bands

2020 VietMX 0

You have a tree of $n$ vertices. You are going to convert this tree into $n$ rubber bands on infinitely large plane. Conversion rule follows: […]

JYPnation

2020 VietMX 0

Due to the success of TWICE, JYP Entertainment has earned countless money and emerged as the biggest entertainment firm by market capitalization. Therefore, the boss, […]

Construct the String

2020 VietMX 0

You are given three positive integers $n$, $a$ and $b$. You have to construct a string $s$ of length $n$ consisting of lowercase Latin letters […]

Two Teams Composing

2020 VietMX 0

You have $n$ students under your control and you have to compose exactly two teams consisting of some subset of your students. Each student had his own […]

Anti-Sudoku

2020 VietMX 0

You are given a correct solution of the sudoku puzzle. If you don’t know what is the sudoku, you can read about it here. The picture […]

Three Blocks Palindrome

2020 VietMX 0

The only difference between easy and hard versions is constraints. You are given a sequence $a$ consisting of $n$ positive integers. Let’s define a three blocks […]

Robots on a Grid

2020 VietMX 0

There is a rectangular grid of size $n \times m$. Each cell of the grid is colored black (‘0’) or white (‘1’). The color of […]

Linova and Kingdom

2020 VietMX 0

Writing light novels is the most important thing in Linova’s life. Last night, Linova dreamed about a fantastic kingdom. She began to write a light […]

Kaavi and Magic Spell

2020 VietMX 0

Kaavi, the mysterious fortune teller, deeply believes that one’s fate is inevitable and unavoidable. Of course, she makes her living by predicting others’ future. While […]

Yui and Mahjong Set

2020 VietMX 0

This is an interactive problem. Yui is a girl who enjoys playing Mahjong. She has a mysterious set which consists of tiles (this set can […]