#P4690. [Ynoi Easy Round 2016] 镜中的昆虫
[Ynoi Easy Round 2016] 镜中的昆虫
Description
You are enjoying HS in a galgame, but the game crashes, so you can only do a data structure problem:
Maintain a sequence of length , with operations.
-
Modify the values in interval to .
-
Query how many different numbers appear in interval . That is, if the same number appears multiple times, it is counted only once.
Input Format
The first line contains two integers .
The second line contains integers representing .
The next lines are either or , representing modification and query respectively.
Output Format
For each query, output one number as the answer.
5 5
1 2 3 4 5
2 1 5
1 2 3 4
2 1 5
2 3 3
2 2 4
5
3
1
1
Hint
Idea: nzhtl1477, Solution: nzhtl1477, Code: nzhtl1477, Data: nzhtl1477
Constraints: ,。
Translated by ChatGPT 5
京公网安备 11011102002149号