#P8264. [Ynoi Easy Round 2020] TEST_100
[Ynoi Easy Round 2020] TEST_100
Problem Description
Given a sequence of length , each position represents a transformation . For each query, you are given an interval and a value . Let go from to in order, visit each element , and update to . Find the value of after all transformations.
Input Format
The first line contains two integers .
The second line contains integers separated by spaces, representing the sequence .
The next lines each contain three integers separated by spaces, representing a query.
This problem is forced online: all input values must be XORed with the answer of the previous query. If there was no previous query, then XOR with .
Output Format
For each query, output one integer per line, representing the answer.
5 5
4 5 2 5 3
3 5 3
3 3 0
5 0 6
5 0 5
6 0 4
1
4
4
5
1
Hint
Idea: nzhtl1477, Solution: nzhtl1477&ccz181078, Code: nzhtl1477, Data: nzhtl1477&
FutaRimeWoawaSete
Sample explanation:
In the first query, is transformed in order by values , becoming , so the answer is .
After decryption, the second query is interval with value .
In the second query, is transformed in order by value , becoming , so the answer is .
After decryption, the third query is interval with value .
In the third query, is transformed in order by values , becoming , so the answer is .
After decryption, the fourth query is interval with value .
In the fourth query, is transformed in order by values , becoming , so the answer is .
After decryption, the fifth query is interval with value .
In the fifth query, is transformed in order by values , becoming , so the answer is .
Constraints:
For of the testdata, , and .
Translated by ChatGPT 5