
Flawed Flow
Emuskald considers himself a master of flow algorithms. Now he has completed his most ingenious program yet — it calculates the maximum flow in an […]
Emuskald considers himself a master of flow algorithms. Now he has completed his most ingenious program yet — it calculates the maximum flow in an […]
Emuskald is a well-known illusionist. One of his trademark tricks involves a set of magical boxes. The essence of the trick is in packing the […]
Emuskald is an avid horticulturist and owns the world’s longest greenhouse — it is effectively infinite in length. Over the years Emuskald has cultivated n plants in […]
Emuskald was hired to design an artificial waterfall according to the latest trends in landscape architecture. A modern artificial waterfall consists of multiple horizontal panels […]
Dima’s got a staircase that consists of n stairs. The first stair is at height a 1, the second one is at a 2, the last one is at a n (1 ≤ a 1 ≤ a 2 ≤ … ≤ a n). Dima decided […]
Little Dima has two sequences of points with integer coordinates: sequence (a 1, 1), (a 2, 2), …, (a n, n) and sequence (b 1, 1), (b 2, 2), …, (b n, n). Now Dima wants to count the number of distinct sequences of points of […]
Dima loves making pictures on a piece of squared paper. And yet more than that Dima loves the pictures that depict one of his favorite […]
Dima and Anya love playing different games. Now Dima has imagined a new game that he wants to play with Anya. Dima writes n pairs of integers […]
Dima came to the horse land. There are n horses living in the land. Each horse in the horse land has several enemies (enmity is a symmetric […]
You are given two rectangles on a plane. The centers of both rectangles are located in the origin of coordinates (meaning the center of the […]
Bike loves looking for the second maximum element in the sequence. The second maximum element in the sequence of distinct numbers x 1, x 2, …, x k (k > 1) is such maximum element x j, that […]
Momiji has got a rooted tree, consisting of n nodes. The tree nodes are numbered by integers from 1 to n. The root has number 1. Momiji decided to play a […]
Polycarpus is the director of a large corporation. There are n secretaries working for the corporation, each of them corresponds via the famous Spyke VoIP system during […]
The problem describes the properties of a command line. The description somehow resembles the one you usually see in real operating systems. However, there are […]
The problem uses a simplified TCP/IP address model, please make sure you’ve read the statement attentively. Polycarpus has found a job, he is a system […]
Polycarpus has a computer with n processors. Also, his computer has n memory cells. We’ll consider the processors numbered by integers from 1 to n and that the memory cells are […]
A rooted tree is a non-directed connected graph without any cycles with a distinguished vertex, which is called the tree root. Consider the vertices of a rooted […]
This problem uses a simplified network topology model, please read the problem statement carefully and use it as a formal document as you develop the […]
We often have to copy large volumes of information. Such operation can take up many computer resources. Therefore, in this problem you are advised to […]