Bracket Sequence

2020 VietMX 87

A bracket sequence is a string, containing only characters “(“, “)”, “[” and “]”. A correct bracket sequence is a bracket sequence that can be transformed into a correct […]

Barcode

2020 VietMX 0

You’ve got an n × m pixel picture. Each pixel can be white or black. Your task is to change the colors of as few pixels as possible to […]

Dice Tower

2020 VietMX 0

A dice is a cube, its faces contain distinct integers from 1 to 6 as black points. The sum of numbers at the opposite dice […]

Unsolvable

2020 VietMX 0

Consider the following equation:where sign [a] represents the integer part of number a. Let’s find all integer z (z > 0), for which this equation is unsolvable in positive integers. The phrase “unsolvable in […]

Well-known Numbers

2020 VietMX 0

Numbers k-bonacci ( k is integer, k > 1) are a generalization of Fibonacci numbers and are determined as follows: F(k, n) = 0, for integer n, 1 ≤ n < k; F(k, k) = 1; F(k, n) = F(k, n - 1) + F(k, n - 2) + … + F(k, n - k), for integer n, n > k. Note that we determine […]

Snake

2020 VietMX 0

Let us remind you the rules of a very popular game called “Snake” (or sometimes “Boa”, “Python” or “Worm”). The game field is represented by […]

Table

2020 VietMX 0

John Doe has an n × m table. John Doe can paint points in some table cells, not more than one point in one table cell. John Doe wants […]

Cycles

2020 VietMX 0

John Doe started thinking about graphs. After some thought he decided that he wants to paint an undirected graph, containing exactly k cycles of length 3. A cycle […]

Fence Planks

2020 VietMX 0

John Doe has a crooked fence, consisting of n rectangular planks, lined up from the left to the right: the plank that goes i-th (1 ≤ i ≤ n) (from left to right) has […]

Practice

2020 VietMX 0

Little time is left before Berland annual football championship. Therefore the coach of team “Losewille Rangers” decided to resume the practice, that were indefinitely interrupted […]

Fence

2020 VietMX 0

Vasya should paint a fence in front of his own cottage. The fence is a sequence of n wooden boards arranged in a single row. Each board […]

Cinema

2020 VietMX 0

Overall there are m actors in Berland. Each actor has a personal identifier — an integer from 1 to m (distinct actors have distinct identifiers). Vasya likes to watch Berland movies […]

TorCoder

2020 VietMX 0

A boy named Leo doesn’t miss a single TorCoder contest round. On the last TorCoder round number 100666 Leo stumbled over the following problem. He […]

Road Repairs

2020 VietMX 0

A country named Berland has n cities. They are numbered with integers from 1 to n. City with index 1 is the capital of the country. Some pairs of cities have monodirectional […]

LCM Challenge

2020 VietMX 0

Some days ago, I learned the concept of LCM (least common multiple). I’ve played with it for several times and I want to make a […]

Let’s Play Osu!

2020 VietMX 0

You’re playing a game called Osu! Here’s a simplified version of it. There are n clicks in a game. For each click there are two outcomes: correct […]

Old Peykan

2020 VietMX 0

There are n cities in the country where the Old Peykan lives. These cities are located on a straight line, we’ll denote them from left to right […]

Mirror Box

2020 VietMX 0

Mirror Box is a name of a popular game in the Iranian National Amusement Park (INAP). There is a wooden box, 105 cm long and 100 cm high in […]

Challenging Balloons

2020 VietMX 0

Martha — as a professional problemsetter — proposed a problem for a world-class contest. This is the problem statement: Tomorrow is Nadia’s birthday, and Bardia […]