#P2184. 贪婪大陆
贪婪大陆
Description
Xiao FF’s last line of defense is a trench of length . Xiao FF has infinitely many types of mines, and each time an SCV can lay mines of a single type on the interval , with this type being different from any type used before. Since the situation is urgent, at some moments Xiao FF may ask how many different types of mines are currently in the interval , and he wants you to answer as quickly as possible.
Input Format
The first line contains two integers and , where is the length of the defense line and is the total number of SCV laying operations and Xiao FF’s queries.
Each of the next lines contains three integers :
- If , the SCV lays mines of a single, previously unused type on the interval .
- If , Xiao FF asks how many different types of mines are currently in the interval .
Output Format
For each of Xiao FF’s queries, output one answer (one per line), which is the current number of mine types in the specified interval.
5 4
1 1 3
2 2 5
1 2 4
2 3 5
1
2
Hint
Constraints
- For of the testdata, .
- For of the testdata, .
Translated by ChatGPT 5
京公网安备 11011102002149号