Irreducible Anagrams

2020 VietMX 0

Let’s call two strings $s$ and $t$ anagrams of each other if it is possible to rearrange symbols in the string $s$ to get a string, equal […]

Mind Control

2020 VietMX 0

You and your $n – 1$ friends have found an array of integers $a_1, a_2, \dots, a_n$. You have decided to share it in the […]

Making Shapes

2020 VietMX 0

You are given $n$ pairwise non-collinear two-dimensional vectors. You can make shapes in the two-dimensional plane with these vectors in the following fashion: Start at […]

Cow and Haybales

2020 VietMX 0

The USA Construction Operation (USACO) recently ordered Farmer John to arrange a row of $n$ haybale piles on the farm. The $i$-th pile contains $a_i$ haybales. However, […]

Cow and Friend

2020 VietMX 0

Bessie has way too many friends because she is everyone’s favorite cow! Her new friend Rabbit is trying to hop over so they can play! […]

Cow and Message

2020 VietMX 0

Bessie the cow has just intercepted a text that Farmer John sent to Burger Queen! However, Bessie is sure that there is a secret message […]

Cow and Fields

2020 VietMX 0

Bessie is out grazing on the farm, which consists of $n$ fields connected by $m$ bidirectional roads. She is currently at field $1$, and will […]

Cow and Treats

2020 VietMX 2

After a successful year of milk production, Farmer John is rewarding his cows with their favorite treat: tasty grass! On the field, there is a […]

Recommendations

2020 VietMX 1

VK news recommendation system daily selects interesting publications of one of $n$ disjoint categories for each user. Each publication belongs to exactly one category. For […]

Strange Function

2020 VietMX 0

Let’s define the function $f$ of multiset $a$ as the multiset of number of occurences of every number, that is present in $a$. E.g., $f(\{5, […]

Au Pont Rouge

2020 VietMX 0

VK just opened its second HQ in St. Petersburg! Side of its office building has a huge string $s$ written on its side. This part […]

Bad Cryptography

2020 VietMX 0

In modern cryptography much is tied to the algorithmic complexity of solving several problems. One of such problems is a discrete logarithm problem. It is […]

Remove Duplicates

2020 VietMX 0

Petya has an array $a$ consisting of $n$ integers. He wants to remove duplicate (equal) elements. Petya wants to leave only the rightmost entry (occurrence) […]

File Name

2020 VietMX 0

You can not just take the file and send it. When Polycarp trying to send a file in the social network “Codehorses”, he encountered an […]

Bus Video System

2020 VietMX 0

The busses in Berland are equipped with a video surveillance system. The system records information about changes in the number of passengers in a bus […]