問題一覧 > 通常問題

No.2421 entersys?

レベル : / AI推定難易度 : 1200 / 実行時間制限 : 1ケース 3.000秒 / メモリ制限 : 512 MB / 標準ジャッジ問題
タグ : (AC するまで非表示) / 解いたユーザー数 78
作問者 : dyktr_06 / テスター : Nafmo2 LaFolia13 hikikomori sepa38 Seed57_cash Udon ryota2357
お気に入りにしたユーザー ProblemId : 9704 / 自分の提出
問題文最終更新日: 2023-10-27 17:26:30
This statement was translated by AI (claude-opus-5-5, effort medium) and may contain errors or differ in nuance from the original. The original statement takes precedence. Back to the original
MMA Contest 016 (順位表) の他の問題:

Problem Statement

In the MMA club room, entries and exits are managed using a system called entersys.

According to entersys, based on the information known so far, at least $N$ entries and exits have taken place, and you are given the information that the member with member ID $X_i$ was in the club room from time $L_i -0.1$ to time $R_i + 0.1$.

You are given $Q$ queries; process them in order.

Each query is one of the following $3$ types.

  • 1 x t: Based on the given information, print Yes if the member with member ID $x$ is known to be in the club room at time $t$, and No otherwise.
  • 2 t: Based on the given information, print the number of members known to be in the room at time $t$.
  • 3 x l r: New information is given that the member with member ID $x$ was in the club room from time $l - 0.1$ to time $r + 0.1$.

Note that, for the same member ID, no information is given whose time overlaps with that of information already given.


Constraints

  • $1 \leq N, Q \leq 10^{5}$
  • $X_i$ is a string of length at most $5$ consisting of lowercase English letters.
  • $1 \leq L_i \leq R_i \leq 10^{9}$
  • $x$ is a string of length at most $5$ consisting of lowercase English letters.
  • $1 \leq t \leq 10^{9}$
  • $1 \leq l \leq r \leq 10^{9}$
  • For any member ID, no information is given whose time overlaps with that of information already given.
  • $N, L_i, R_i, Q, t, l, r$ are integers.

Input

The input is given from standard input in the following format.

$N$   
$X_1$ $L_1$ $R_1$  
$X_2$ $L_2$ $R_2$  
$\vdots$

$X_N$ $L_N$ $R_N$  
$Q$  
query $1$  
query $2$  
$\vdots$

query $Q$   

Each query is given in one of the following $3$ formats.

$1$ $x$ $t$
$2$ $t$
$3$ $x$ $l$ $r$

Output

Let $q$ be the number of queries of types $1, 2$. Print $q$ lines.
On line $j$ $(1 \leq j \leq q)$, print the answer to the $j$-th such query.

Sample

Sample 1
Input
5
dyktr 6 15
nafmo 1 20
sepa 11 20
mma 2 6
mma 12 14
5
1 dyktr 5
1 dyktr 6
2 15
3 ryota 3 18
2 15
Output
No
Yes
3
4

For the $1, 2$ -th queries, according to the information given so far, the member with member ID dyktr is known to be in the club room from time $5.9$ to time $15.1$.

For the $3$-rd query, according to the information given so far, $3$ members are known to be in the club room at time $15$, whose member IDs are dyktr, nafmo, sepa.

For the $5$-th query, according to the information given so far, $4$ members are known to be in the club room at time $15$, whose member IDs are dyktr, nafmo, sepa, ryota.

提出するには、Twitter 、GitHub、 Googleもしくは右上の雲マークをクリックしてアカウントを作成してください。