Chat Order

2020 VietMX 0

Polycarp is a big lover of killing time in social networks. A page with a chatlist in his favourite network is made so that when […]

Promocodes with Mistakes

2020 VietMX 0

During a New Year special offer the “Sudislavl Bars” offered n promo codes. Each promo code consists of exactly six digits and gives right to one free […]

Running with Obstacles

2020 VietMX 0

A sportsman starts from point x start = 0 and runs to point with coordinate x finish = m (on a straight line). Also, the sportsman can jump — to jump, he should first take […]

Parliament of Berland

2020 VietMX 0

There are n parliamentarians in Berland. They are numbered with integers from 1 to n. It happened that all parliamentarians with odd indices are Democrats and all parliamentarians with even […]

Processing Queries

2020 VietMX 0

In this problem you have to simulate the workflow of one-thread server. There are n queries to process, the i-th will be received at moment t i and needs to be […]

Hostname Aliases

2020 VietMX 0

There are some websites that are accessible through several different addresses. For example, for a long time MaiXuanViet was accessible with two hostnames maixuanviet.com and maixuanviet.vn. You are […]

Mischievous Mess Makers

2020 VietMX 0

It is a balmy spring afternoon, and Farmer John’s n cows are ruminating about link-cut cacti in their stalls. The cows, labeled 1 through n, are arranged so that the i-th […]

Amity Assessment

2020 VietMX 0

Bessie the cow and her best friend Elsie each received a sliding puzzle on Pi Day. Their puzzles consist of a 2 × 2 grid and three tiles labeled […]

Enduring Exodus

2020 VietMX 0

In an attempt to escape the Mischievous Mess Makers’ antics, Farmer John has abandoned his farm and is traveling to the other side of Bovinia. […]

Intellectual Inquiry

2020 VietMX 0

After getting kicked out of her reporting job for not knowing the alphabet, Bessie has decided to attend school at the Fillet and Eggs Eater […]

Cowslip Collections

2020 VietMX 9

In an attempt to make peace with the Mischievious Mess Makers, Bessie and Farmer John are planning to plant some flower gardens to complement the […]

Bear and Forgotten Tree 3

2020 VietMX 0

A tree is a connected undirected graph consisting of n vertices and n  -  1 edges. Vertices are numbered 1 through n. Limak is a little polar bear and Radewoosh is his evil enemy. […]

Bear and Contribution

2020 VietMX 0

Codeforces is a wonderful platform and one its feature shows how much someone contributes to the community. Every registered user has contribution — an integer number, not […]

Bear and Polynomials

2020 VietMX 0

Limak is a little polar bear. He doesn’t have many toys and thus he often plays with polynomials. He considers a polynomial valid if its degree is n and […]

Bear and Paradox

2020 VietMX 0

Limak is a big polar bear. He prepared n problems for an algorithmic contest. The i-th problem has initial score p i. Also, testers said that it takes t i minutes to solve the i-th problem. […]

Gambling Nim

2020 VietMX 0

As you know, the game of “Nim” is played with n piles of stones, where the i-th pile initially contains a i stones. Two players alternate the turns. During a turn […]

Graph Coloring

2020 VietMX 0

You are given an undirected graph that consists of n vertices and m edges. Initially, each edge is colored either red or blue. Each turn a player picks a […]

To Hack or not to Hack

2020 VietMX 0

Consider a regular Codeforces round consisting of three problems that uses dynamic scoring. You are given an almost final scoreboard. For each participant (including yourself), […]