CS Academy Round 50: Min Races
I solved it during the contest, but the official explanation is cleaner than mine.
Official solution
sort all drivers by their final rank, i.e., we will have a list of classes
Claim: answer to the problem = length of longest decreasing subsequence.
Proof: This is actually Dilworth Theorem. In any finite partially ordered set, the maximum number of elements in any antichain equals the minimum number of chains in any partition of the set into chains.
Our greedy construction actually serves as proof