#P8891. 「UOI-R1」询问
「UOI-R1」询问
Background
ZSS has a sequence, but he is not very smart, so he comes to ask you even about an operation problem.
Problem Description
Given an integer sequence of numbers , there are operations. In each operation, are given. You need to find all such that , and then do . If there is no such , then the sequence will not be changed. Here, denotes the bitwise XOR operation.
After all operations are finished, you need to output this sequence.
Input Format
The first line contains two positive integers , representing the length of the sequence and the number of operations.
The next line contains the initial sequence.
The next lines each contain two numbers , with the meaning as described above.
Output Format
Output one line with numbers, representing the sequence after all operations.
6 1
1 1 4 5 1 1
0 7
1 1 4 5 1 1
3 1
0 3 9
1 2
-2 3 9
见文件附件的 queries3.in
见文件附件的 queries3.ans
见文件附件的 queries4.in
见文件附件的 queries4.ans
Hint
For of the testdata, it is guaranteed that .
For another of the testdata, it is guaranteed that .
For of the testdata, it is guaranteed that , , and .
Translated by ChatGPT 5