#P9995. [Ynoi2000] rspcn
[Ynoi2000] rspcn
Problem Description
Given an integer sequence , there are operations in total.
Each operation gives . First perform a modification, then query how many distinct values there are in .
If , the modification is to sort in increasing order; otherwise, the modification is to sort in decreasing order.
Input Format
The first line contains two integers .
The second line contains integers .
The next lines each contain three integers , describing each operation in order, where is bitwise XOR, and is the answer to the previous operation’s query (in particular, for the first operation, ).
Output Format
Output lines, each containing one integer, in order, representing the answer to the query of each operation.
9 7
2 2 8 8 2 8 2 1 3
2 2 2
3 7 6
6 7 1
9 6 7
10 11 10
7 0 5
5 1 7
1
2
1
2
3
2
2
Hint
Idea: ccz181078, Solution: ccz181078, Code: ccz181078, Data: ccz181078.
Constraints:
For of the testdata, .
For another of the testdata, .
For another of the testdata, .
For another of the testdata, .
For of the testdata, , , and .
Translated by ChatGPT 5