Editorial for COCI '21 Contest 1 #1 Ljeto
Submitting an official solution before solving the problem yourself is a bannable offence.
Using an array ~z~, 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~.