#P2681. 众数
众数
Description
Alice has a sequence . Now she needs Bob to support querying the mode within a range, and also support modifying a position .
Input Format
The first line contains two integers .
The second line contains integers, representing .
The next lines each contain three integers .
If , it queries the mode in the range . If there are multiple, output the smaller one.
If , it sets to .
Output Format
For each query with , output one integer per line representing the answer.
5 3
1 1 2 2 1
0 1 4
1 2 3
0 1 4
1
2
Hint
For 100% of the testdata, .
For all query operations, .
At any time .
Translated by ChatGPT 5
京公网安备 11011102002149号