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.
Submitting an official solution before solving the problem yourself is a bannable offence.
For each second in the interval , we store what team (if any) scored in that second. To fill this array, we must convert the given events from : format into the number of seconds elapsed from the start of the game, .
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