
Network Mask
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 […]
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 […]
The problem uses a simplified TCP/IP address model, please read the statement carefully. An IP address is a 32-bit integer, represented as a group of […]
We already know of the large corporation where Polycarpus works as a system administrator. The computer network there consists of n computers and m cables that connect some pairs […]
You are fishing with polar bears Alice and Bob. While waiting for the fish to bite, the polar bears get bored. They come up with […]
It is known that there are k fish species in the polar ocean, numbered from 1 to k. They are sorted by non-decreasing order of their weight, which is a […]
Even polar bears feel cold when lying on the ice. Therefore, a polar bear Alice is going to make a carpet. The carpet can be […]
Polar bears like unique arrays ā that is, arrays without repeated elements. You have got a unique array s with length n containing non-negative integers. Since you are good friends with […]
The polar bears have discovered a gigantic circular piece of floating ice with some mystic carvings on it. There are n lines carved on the ice. Each […]
Ksusha is a vigorous mathematician. She is keen on absolutely incredible mathematical riddles. Today Ksusha came across a convex polygon of non-zero area. She is […]
Yaroslav, Andrey and Roman love playing cubes. Sometimes they get together and play cubes for hours and hours! Today they got together again and they […]
Yaroslav, Andrey and Roman can play cubes for hours and hours. But the game is for three, so when Roman doesn’t show up, Yaroslav and […]
You have a rectangular nāĆām-cell board. Some cells are already painted some of k colors. You need to paint each uncolored cell one of the k colors so that any […]
You’ve got a weighted tree, consisting of n vertices. Each edge has a non-negative weight. The length of the path between any two vertices of the tree […]
Imagine a real contest or exam of n participants. Every participant will get a particular score. We can predict the standings board more or less, if we […]
People like to be fit. That’s why many of them are ready to wake up at dawn, go to the stadium and run. In this […]