Moscow is hosting a major international conference, which is attended by n scientists from different countries. Each of the scientists knows exactly one language. For convenience, we enumerate all languages of the world with integers from 1 to 109. I…
C. Cinema time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output Moscow is hosting a major international conference, which is attended by n scientists from different countries. Each of the scient…
There are nn segments [li,ri][li,ri] for 1≤i≤n1≤i≤n. You should divide all segments into two non-empty groups in such way that there is no pair of segments from different groups which have at least one common point, or say that it's impossible to do…
D. Divide by three, multiply by two time limit per test 1 second memory limit per test 256 megabytes input:standard input output:standard output Polycarp likes to play with numbers. He takes some integer number x, writes it down on the board, and the…
ACM思维题训练集合 Furik and Rubik love playing computer games. Furik has recently found a new game that greatly interested Rubik. The game consists of n parts and to complete each part a player may probably need to complete some other ones. We know that the…