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.
Submitting an official solution before solving the problem yourself is a bannable offence.
Using an array , 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 . Then, reading the input line by line, we add points to the teams depending on if . To determine if a spray is a double-spray, it is sufficient to check if , and if so, we should add an additional points to that team. Finally, for each line, we should update the value .
Comments