New Year Permutation

2020 VietMX 0

User ainta has a permutation p 1, p 2, …, p n. As the New Year is coming, he wants to make his permutation as pretty as possible. Permutation a 1, a 2, …, a n is prettier than permutation b 1, b 2, …, b n, if and […]

New Year Transportation

2020 VietMX 0

New Year is coming in Line World! In this world, there are n cells numbered by integers from 1 to n, as a 1 × n board. People live in cells. However, it was […]

New Year Book Reading

2020 VietMX 0

New Year is coming, and Jaehyun decided to read many books during 2015, unlike this year. He has n books numbered by integers from 1 to n. The […]

New Year Santa Network

2020 VietMX 0

New Year is coming in Tree World! In this world, as the name implies, there are n cities connected by n - 1 roads, and for any two distinct cities there […]

New Year Domino

2020 VietMX 0

Celebrating the new year, many people post videos of falling dominoes; Here’s a list of them: https://www.youtube.com/results?search_query=New+Years+Dominos User ainta, who lives in a 2D world, is […]

New Year Shopping

2020 VietMX 0

Dohyun is running a grocery store. He sells n items numbered by integers from 1 to n. The i-th (1 ≤ i ≤ n) of them costs c i dollars, and if I buy it, my […]

Amr and Music

2020 VietMX 0

Amr is a young coder who likes music a lot. He always wanted to learn how to play music but he was busy coding so […]

Amr and Pins

2020 VietMX 11

Amr loves Geometry. One day he came up with a very interesting problem. Amr has a circle of radius r and center in point (x, y). He wants the […]

Breaking Good

2020 VietMX 1

Breaking Good is a new video game which a lot of gamers want to have. There is a certain level in the game that is […]

The Maths Lecture

2020 VietMX 0

Amr doesn’t like Maths as he finds it really boring, so he usually sleeps in Maths lectures. But one day the teacher suspected that Amr […]

Fox And Jumping

2020 VietMX 0

Fox Ciel is playing a game. In this game there is an infinite long tape with cells indexed by integers (positive, negative and zero). At […]

Fox And Names

2020 VietMX 0

Fox Ciel is going to publish a paper on FOCS (Foxes Operated Computer Systems, pronounce: “Fox”). She heard a rumor: the authors list on the […]

Fox And Travelling

2020 VietMX 0

Fox Ciel is going to travel to New Foxland during this summer. New Foxland has n attractions that are linked by m undirected roads. Two attractions are called adjacent […]

Fox And Dinner

2020 VietMX 0

Fox Ciel is participating in a party in Prime Kingdom. There are n foxes there (include Fox Ciel). The i-th fox is a i years old. They will have dinner […]

Fox And Polygon

2020 VietMX 0

Fox Ciel just designed a puzzle game called “Polygon”! It is played using triangulations of a regular n-edge polygon. The goal is to transform one triangulation to another […]

Game

2020 VietMX 0

Two players play a simple game. Each player is provided with a box with balls. First player’s box contains exactly n 1 balls and second player’s box contains […]

Second price auction

2020 VietMX 0

Nowadays, most of the internet advertisements are not statically linked to a web page. Instead, what will be shown to the person opening a web […]

Permutations

2020 VietMX 0

You are given a permutation p of numbers 1, 2, …, n. Let’s define f(p) as the following sum: Find the lexicographically m-th permutation of length n in the set of permutations having the maximum possible […]

Constrained Tree

2020 VietMX 0

You need to find a binary tree of size n that satisfies a given set of c constraints. Suppose that the nodes of the unknown binary tree are labeled […]