Editorial for COCI '10 Contest 5 #2 Košarka


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.

For each second in the interval [0, 48 \times 60], we store what team (if any) scored in that second. To fill this array, we must convert the given events from MM:SS format into the number of seconds elapsed from the start of the game, MM \times 60 + SS.

Now we traverse this array keeping track of the current score for each team. For each second during which the score wasn't tied, increase the counter for the winning team.


Comments

There are no comments at the moment.