#abc292b. B - Yellow and Red Card

B - Yellow and Red Card

Score : 200200 points

问题描述

NN 名编号为 11NN 的球员将进行一场足球比赛。
当一名球员犯规时,该球员将收到一张 黄牌红牌
满足以下任一条件的球员将被 罚下场

  • 累计获得两张黄牌。
  • 收到一张红牌。

一旦球员被罚下场,该球员将不再收到任何牌。

你将观看这场比赛。最初,所有球员都没有收到任何牌。
将会有 QQ 个事件。正确回答在这些事件中提出的问题。
有三种类型的事件,其格式从输入中给出为 c x,其中 cc112233。事件如下。

  • 1 x: 球员 xx 收到一张黄牌。
  • 2 x: 球员 xx 收到一张红牌。
  • 3 x: 询问你球员 xx 是否已被罚下场。回答 YesNo

以上为通义千问 qwen-max 翻译,仅供参考。

Problem Statement

NN players numbered 11 to NN 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 QQ 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 cc is 11, 22, or 33. The events are as follows.

  • 1 x: Player xx receives a yellow card.
  • 2 x: Player xx receives a red card.
  • 3 x: You are asked whether player xx has been removed from the game. Answer Yes or No.

Constraints

  • 1N1001 \leq N \leq 100
  • 1Q1001 \leq Q \leq 100
  • 1xN1 \leq x \leq N 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 eventi\text{event}_i denotes the ii-th event.

NN QQ

event1\text{event}_1

event2\text{event}_2

\vdots

eventQ\text{event}_Q

Each event is in one of the following formats:

1 xx

2 xx

3 xx

Output

Print XX lines, where XX is the number of events of the third kind in the input.
The ii-th line should contain Yes if, for the ii-th event of the third kind, player xx has been removed from the game, and No otherwise.

Sample Input 1

3 9
3 1
3 2
1 2
2 1
3 1
3 2
1 2
3 2
3 3

Sample Output 1

No
No
Yes
No
Yes
No

Here are all the events in chronological order.

In the 11-st event, you are asked whether player 11 has been removed from the game. Player 11 has not been removed, so you should print No.
In the 22-nd event, you are asked whether player 22 has been removed from the game. Player 22 has not been removed, so you should print No.
In the 33-rd event, player 22 receives a yellow card.
In the 44-th event, player 11 receives a red card and is removed from the game.
In the 55-th event, you are asked whether player 11 has been removed from the game. Player 11 has been removed, so you should print Yes.
In the 66-th event, you are asked whether player 22 has been removed from the game. Player 22 has not been removed, so you should print No.
In the 77-th event, player 22 receives a yellow card and is removed from the game.
In the 88-th event, you are asked whether player 22 has been removed from the game. Player 22 has been removed, so you should print Yes.
In the 99-th event, you are asked whether player 33 has been removed from the game. Player 33 has not been removed, so you should print No.

update @ 2024/3/10 12:10:37