Kuriyama Mirai and Exclusive Or
题号:NC223885
时间限制:C/C++/Rust/Pascal 3秒,其他语言6秒
空间限制:C/C++/Rust/Pascal 64 M,其他语言128 M
64bit IO Format: %lld

题目描述

Kuriyama Mirai gives you an integer sequence of n integers a_i.
She will ask you to design an appropriate data structure,in order to maintain the sequence,allowing her to perform q operations on it.
Those q operations have two types:
  • 0\ l\ r\ x - this operation assigns every a_i which satisfies l \leq i \leq r to a_i \oplus x, in which the operator means "bitwise xor" or "bitwise exclusive or"
  • 1\ l\ r\ x - this operation assigns every a_i which satisfies l \leq i \leq r to a_i \oplus (x+(i- l)),in
which the operator \oplus means "bitwise xor", or "bitwise exclusive or".
By the time those q operations have been performed, she will query the whole adjusted
sequence a_{i}^{'},, you will need to output the value of every single ai which satisfies l \leq i \leq n.。

输入描述:

The first line contains two integers n, q(1≤n≤6 \times 10^5,1\leq q≤4\times 10^5).
The second line contains n integers a_1, a_2,\dots, _an(0 \leq a_i \leq 2^{30}).
The next q lines describe operations, the i-th line describes the i-th operation in one of these two
formats:
0 \ l \ r\ x - representing an operation of the zeroth type.
1\ l \ r \ x - representing an operation of the first type.
Additionally, it is guaranteed that for any operation of the zeroth type,
1 \leq l \leq r \leq n ,0 \leq x \lt 2^{30}; and that for any operation of the first type,
1 \leq l \leq r\leq n,0 \leq x,x+(r-l)\lt 2^{30}

输出描述:

The only line contains n integers a'_1, a'_2, \ldots, a'_n
namely the adjusted integer sequence.
示例1

输入

复制
5 3
11 11 0 8 5
0 1 5 3
1 2 5 5
1 1 2 14

输出

复制
6 2 5 12 14
示例2

输入

复制
8 10
47777 11793 27829 32707 8865 6172 63004 7141
1 1 4 24065
1 4 5 34063
1 3 3 60083
0 7 8 3034
1 1 6 14104
1 2 6 46221
1 5 6 36340
1 8 8 18263
0 7 8 10538
1 6 8 56417

输出

复制
54200 62343 23441 10076 43465 51716 2190 41505

备注: