Editorial for SAC '22 Code Challenge 2 P1 - Calendar Management


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: maxcruickshanks

Maintain a list for the day and a list for the name of each assignment.

Define a day variable to represent the current day as 0.

For each query, check all the assignments that occur from (day, C_i] and output their names in the order that they occur in the input.

Then, set day to C_i.

Time Complexity: \mathcal{O}(NQ)

Note that this is the hardest problem in this contest if you are familiar with most topics in competitive programming.


Comments

There are no comments at the moment.