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 a_i \le 4. To determine if a spray is a double-spray, it is sufficient to check if t_i-z[a_i-1] \le 10, and if so, we should add an additional 50 points to that team. Finally, for each line, we should update the value z[a_i-1] = t_i.


There are no comments at the moment.