atcoder#ABC292B. [ABC292B] Yellow and Red Card
[ABC292B] Yellow and Red Card
Score : points
Problem Statement
players numbered to will play a soccer game. When a player commits an offense, that player will receive a yellow card or a red card. A player who satisfies one of the following conditions will be removed from the game.
- Accumulates two yellow cards.
- Receives a red card.
Once a player is removed, that player will no longer receive any cards.
You will watch this game. Initially, the players have not received any cards.
There will be events. Correctly answer the questions asked in the events.
There are three kinds of events, which are given in the format c x
from the input, where is , , or . The events are as follows.
1 x
: Player receives a yellow card.2 x
: Player receives a red card.3 x
: You are asked whether player has been removed from the game. AnswerYes
orNo
.
Constraints
- in all events.
- There is at least one event of the third kind.
- A player who has been removed will no longer receive any cards.
- All values in the input are integers.
Input
The input is given from Standard Input in the following format, where denotes the -th event.
Each event is in one of the following formats:
1
2
3
Output
Print lines, where is the number of events of the third kind in the input.
The -th line should contain Yes
if, for the -th event of the third kind, player has been removed from the game, and No
otherwise.
3 9
3 1
3 2
1 2
2 1
3 1
3 2
1 2
3 2
3 3
No
No
Yes
No
Yes
No
Here are all the events in chronological order.
In the -st event, you are asked whether player has been removed from the game. Player has not been removed, so you should print No
.
In the -nd event, you are asked whether player has been removed from the game. Player has not been removed, so you should print No
.
In the -rd event, player receives a yellow card.
In the -th event, player receives a red card and is removed from the game.
In the -th event, you are asked whether player has been removed from the game. Player has been removed, so you should print Yes
.
In the -th event, you are asked whether player has been removed from the game. Player has not been removed, so you should print No
.
In the -th event, player receives a yellow card and is removed from the game.
In the -th event, you are asked whether player has been removed from the game. Player has been removed, so you should print Yes
.
In the -th event, you are asked whether player has been removed from the game. Player has not been removed, so you should print No
.