#K37072. XOR Sequence Transformation
XOR Sequence Transformation
XOR Sequence Transformation
You are given an integer sequence and a list of transformations. Each transformation is represented by a pair \( (i, v) \), where \( i \) is a 0-indexed position in the sequence and \( v \) is an integer. For each transformation, update the element at index \( i \) by performing a bitwise XOR with \( v \). Formally, if the current value is \( a_i \), then the new value becomes \( a_i \oplus v \).
Your task is to compute the final modified sequence after applying all the transformations in the given order.
Note: The operator \( \oplus \) denotes the bitwise XOR operation.
inputFormat
The input is given from standard input (stdin) and has the following format:
<n> <a1> <a2> ... <an> <m> <i1> <v1> <i2> <v2> ... <im> <vm>
Here:
- \( n \) is the number of elements in the initial sequence.
- The second line contains \( n \) space-separated integers representing the sequence.
- \( m \) is the number of transformations.
- Each of the following \( m \) lines contains two integers \( i \) (0-indexed) and \( v \), representing a transformation.
outputFormat
Output the final sequence after all the transformations as space-separated integers in a single line to standard output (stdout).
## sample5
5 10 15 20 25
4
1 3
2 10
0 5
4 20
0 9 5 20 13