Idempotent functions

2020 VietMX 0

Some time ago Leonid have known about idempotent functions. Idempotent function defined on a set {1, 2, …, n} is such function , that for any  the formula g(g(x)) = g(x) holds. Let’s denote as f (k)(x) the function f applied k times to the value x. […]

Face Detection

2020 VietMX 0

The developers of Looksery have to write an efficient algorithm that detects faces on a picture. Unfortunately, they are currently busy preparing a contest for […]

Degenerate Matrix

2020 VietMX 0

The determinant of a matrix 2 × 2 is defined as follows: A matrix is called degenerate if its determinant is equal to zero. The norm ||A|| of a matrix A is defined as a maximum of absolute […]

Happy Line

2020 VietMX 0

Do you like summer? Residents of Berland do. They especially love eating ice cream in the hot summer. So this summer day a large queue […]

The Game Of Parity

2020 VietMX 0

There are n cities in Westeros. The i-th city is inhabited by a i people. Daenerys and Stannis play the following game: in one single move, a player chooses a certain […]

Haar Features

2020 VietMX 0

The first algorithm for detecting a face on the image working in realtime was developed by Paul Viola and Michael Jones in 2001. A part […]

Looksery Party

2020 VietMX 0

The Looksery company, consisting of n staff members, is planning another big party. Every employee has his phone number and the phone numbers of his friends in […]

Yura and Developers

2020 VietMX 0

Yura has a team of k developers and a list of n tasks numbered from 1 to n. Yura is going to choose some tasks to be done this week. Due to […]

Pudding Monsters

2020 VietMX 0

In this problem you will meet the simplified model of game Pudding Monsters. An important process in developing any game is creating levels. A game […]

Restructuring Company

2020 VietMX 0

Even the most successful company can go through a crisis period when you have to make a hard decision — to restructure, discard and merge […]

Max and Min

2020 VietMX 0

Two kittens, Max and Min, play with a pair of non-negative integers x and y. As you can guess from their names, kitten Max loves to maximize and […]

Replicating Processes

2020 VietMX 0

A Large Software Company develops its own social network. Analysts have found that during the holidays, major sporting events and other significant events users begin […]

Restoring Map

2020 VietMX 0

Archaeologists found some information about an ancient land of Treeland. We know for sure that the Treeland consisted of n cities connected by the n - 1 road, such that you […]

Matching Names

2020 VietMX 0

Teachers of one programming summer school decided to make a surprise for the students by giving them names in the style of the “Hobbit” movie. […]

Bear and Poker

2020 VietMX 0

Limak is an old brown bear. He often plays poker with his friends. Today they went to a casino. There are n players (including Limak himself) and […]

Bear and Blocks

2020 VietMX 0

Limak is a little bear who loves to play. Today he is playing by destroying block towers. He built n towers in a row. The i-th tower is […]

Tablecity

2020 VietMX 0

There was a big bank robbery in Tablecity. In order to catch the thief, the President called none other than Albert – Tablecity’s Chief of […]

Bots

2020 VietMX 0

Sasha and Ira are two best friends. But they aren’t just friends, they are software engineers and experts in artificial intelligence. They are developing an […]

Bulbo

2020 VietMX 0

Bananistan is a beautiful banana republic. Beautiful women in beautiful dresses. Beautiful statues of beautiful warlords. Beautiful stars in beautiful nights. In Bananistan people play […]