Editorial for COCI '20 Contest 1 #5 Tenis
Submitting an official solution before solving the problem yourself is a bannable offence.
We have two types of pairs of players: pairs in which the victory is strict (the best position of the winner (w.r.t. courts) is strictly higher than the best position of the loser), and pairs in which victory is not strict, which means the best positions of the players with respect to courts are equal.
There are at most
Each player can be assigned to a basket (bitmask) which indicates the court on which his position is the best. For example, the player whose best court is the third court would go to the basket
We look for a solution by fixing one player (let's say his best position is
Comments