Editorial for Back to School '24 P2 - Cheating
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.
Submitting an official solution before solving the problem yourself is a bannable offence.
Author:
Subtask 1:
We can put all
Time Complexity:
Subtask 2:
We can further optimize our solution from subtask 1 by noticing that it is not required to iterate through the queue's values individually to add score. We can store the index of the first student in the queue as index
Time Complexity:
Comments