JamieVardy's blog

By JamieVardy, 11 years ago, In English

How to solve SRM 644 Div 1 Medium? The problem statement has not been linked to in the Problem Archive, so please log in to the arena to get the complete details about the problem. Roughly, the question goes :-

There are N competitors, numbered 1 through N. The tournament will have exactly K rounds. In each round, some of the competitors will drop out of the tournament and some will advance. The competitors who advance from round K are the winners of the tournament. A valid tournament must have at least one winner.

Each round of the tournament must look as follows.

At the beginning of the round, the competitors are divided into rooms.

Each room must contain two or more competitors. The competitors in each room must have consecutive numbers.

In each room the competitors compete against each other. The best competitor in each room advances and all others drop out of the tournament.

After the round, the advancers are assigned new numbers 1 through R, where R is the number of rooms.

A contestant with a smaller current number will always get a smaller new number.

For n = 6 and k = 2, ans is 4: That is, for the first round, we can — Choose first 4 and next 2, first 3 and next 3, 3 groups of 2 each, first 2 and next 4. The second round is defined uniquely then.

n <= 10**18, k <= 6

Full text and comments »

  • Vote: I like it
  • +10
  • Vote: I do not like it