408286: GYM103076 I Covid Country

Memory Limit:256 MB Time Limit:1 S
Judge Style:Text Compare Creator:
Submit:0 Solved:0

Description

I. Covid Countrytime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard output

Covid cases are surging in the Country of NLogônia, the Prime Minister has fired all health and statistics officials and now he needs your help. Each day you'll receive two types of queries:

$$$\textit{1}, \textit{id}, \textit{x}$$$

You receive the city's id and how many new cases it has.

$$$\textit{2}, \textit{k}$$$

You have to answer how many cities have more than k cases. Initially all cities have zero cases.

Input

The first line contains two integers $$$(1\leq\textit{q}\leq10^5;1 \leq \textit{n}\leq 10^5)$$$, the number of queries and the number of cities.

$$$\textit{q}$$$ queries follow, each query is in the formats:

1 id x where $$$(0\leq\textit{id}<n;1 \leq \textit{x}\leq 10^{13})$$$

2 k where $$$(0\leq\textit{k}\leq 10^{18})$$$

Output

For the second type of query print how many cities have more than $$$\textit{k}$$$ cases.

ExamplesInput
6 10
1 0 10
1 1 9
2 2
2 8
2 9
2 10
Output
2
2
1
0
Input
4 5
1 0 10
2 10
1 0 1
2 10
Output
0
1

加入题单

算法标签: