structBIT { /* ======================================== */ ll tr[maxn]; int sz; voidinit( int N ){ sz = N; fill( tr, tr + sz + 2, 0 ); } voidadd( int idx, ll val ){ for( int i = idx; i <= sz; i += i & -i ) tr[i] ^= val; } ll ask( int idx ){ ll res = 0; for( int i = idx; i; i -= i & -i ) res ^= tr[i]; return res; } ll query( int l, int r ){ returnask( r ) ^ ask( l - 1 ); } /* ======================================== */ } bit[2];
int a[maxn];
voidsolve( ){ int n = read( ), q = read( ); bit[0].init( n ); bit[1].init( n );
for( int i = 1; i <= n; ++ i ) { a[i] = read( ); bit[i & 1].add( i, a[i] ); }
while( q -- ) { int opt = read( );
if( opt == 1 ) { int x = read( ), y = read( ); bit[x & 1].add( x, a[x] ); bit[x & 1].add( x, y ); a[x] = y; } else { int l = read( ), r = read( ); int len = r - l + 1; if( len % 2 == 0 ) { cout << 0 << '\n'; } else { cout << bit[l & 1].query( l, r ) << '\n'; } } } }