Editorial for Valentine's Day '19 S1 - Voting

Remember to use this editorial only when stuck, and not to copy-paste code from it. Please be respectful to the problem author and editorialist.

Submitting an official solution before solving the problem yourself is a bannable offence.

Author: Ninjaclasher

The intended solution was pure implementation. Be careful of the many edge cases. Loop N-1 times, each time removing one candidate, and moving each voter's choice to the next not eliminated candidate.

Time Complexity: \mathcal{O}(N(N + M))


There are no comments at the moment.