Problem A
Ace Arbiter
Alice and Bob are playing a friendly game of ping pong. The game consists of several rounds. At the end of each round, exactly one player gets one point. The first player to 11 points wins. When that happens, the game immediately ends. Alice start serving the first round, then Bob serves for the next two rounds, then Alice serves twice, then Bob serves twice, and so on.
At any time in the game, the current score is written
Input
The first line of input contains an integer
Output
If the input is a valid log of a not necessarily finished
game, output “ok”. Otherwise, output
“error
Sample Input 1 | Sample Output 1 |
---|---|
5 0-0 1-0 1-0 2-0 1-2 |
ok |
Sample Input 2 | Sample Output 2 |
---|---|
2 1-0 0-0 |
error 2 |
Sample Input 3 | Sample Output 3 |
---|---|
4 11-0 11-0 11-1 11-11 |
error 3 |
Sample Input 4 | Sample Output 4 |
---|---|
4 0-0 1-0 0-2 2-1 |
error 3 |