There are
There are two types of operations:
1 i f
Replace the bell with one with a frequency of Hz.2 l r
Output the number of distinct frequencies between the and bell (inclusive).
There will be at most
Fast input may be required.
Constraints
For 10% of the points,
For 90% of the points,
Input Specification
The first line contains two space separated integers,
The next line contains
The next
Output Specification
Output a single integer on its own line for each type 2 query.
Sample Input
6 3
1 2 1 4 4 2
2 1 6
1 2 1
2 1 3
Sample Output
3
1
Explanation for Sample Output
In the beginning, there are only 3 distinct frequencies which the bells have, 1 Hz, 2 Hz, and 4 Hz. After switching the second bell with one with a frequency of 1 Hz. There is only one distinct frequency among the first 3 bells.
Comments