Editorial for COCI '21 Contest 6 #1 Med
Submitting an official solution before solving the problem yourself is a bannable offence.
This problem is intended to check whether participants can write their own comparator function for sorting. Assume that the sixth round was also held. A competitor with name and points will be ahead of a competitor with name and points if and only if , or if the sums are equal and is lexicographically smaller than .
For each competitor, we can look at the worst and best possible scenario - all competitors except them win points and they get points, and vice versa. For each scenario, we sort the ranking according to the comparator and find the best and worst possible positions for them.
In C++, this can be done by writing a custom comparator function and then using std::sort
, while in Python, this can be done by sorting twice with different key functions for list.sort
.
Comments