Editorial for COCI '21 Contest 1 #1 Ljeto


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.

Using an array z[8], for each of the eight players, we can keep track of the last time this player sprayed someone from the other team. Initially, we set each of these values to 11. Then, reading the input line by line, we add 100 points to the teams depending on if ai4. To determine if a spray is a double-spray, it is sufficient to check if tiz[ai1]10, and if so, we should add an additional 50 points to that team. Finally, for each line, we should update the value z[ai1]=ti.


Comments

There are no comments at the moment.