Score : $600$ points
We have an integer sequence $A$ of length $N$.
You will process $Q$ queries on this sequence. In the $i$-th query, given values $T_i$, $X_i$, and $Y_i$, do the following:
Here, $a \oplus b$ denotes the bitwise XOR of $a$ and $b$.
The bitwise XOR of integers $A$ and $B$, $A \oplus B$, is defined as follows:
What is bitwise XOR?
For example, $3 \oplus 5 = 6$. (In base two: $011 \oplus 101 = 110$.)
Input is given from Standard Input in the following format:
$N$ $Q$ $A_1 \hspace{7pt} A_2 \hspace{7pt} A_3 \hspace{5pt} \dots \hspace{5pt} A_N$ $T_1$ $X_1$ $Y_1$ $T_2$ $X_2$ $Y_2$ $T_3$ $X_3$ $Y_3$ $\hspace{22pt} \vdots$ $T_Q$ $X_Q$ $Y_Q$
For each query with $T_i = 2$ in the order received, print the response in its own line.
3 4 1 2 3 2 1 3 2 2 3 1 2 3 2 2 3
0 1 2
In the first query, we print $1 \oplus 2 \oplus 3 = 0$.
In the second query, we print $2 \oplus 3 = 1$.
In the third query, we replace $A_2$ with $2 \oplus 3 = 1$.
In the fourth query, we print $1 \oplus 3 = 2$.
10 10 0 5 3 4 7 0 0 0 1 0 1 10 7 2 8 9 2 3 6 2 1 6 2 1 10 1 9 4 1 6 1 1 6 3 1 1 7 2 3 5
1 0 5 3 0