#include <iostream>
using namespace std;
unsigned int o[200008];
int main() {
ios::sync_with_stdio(false);
cin.tie(NULL);
cout.tie(NULL);
int n, q; cin >> n >> q;
for (int i = 0; i < n; i++) cin >> o[i];
for (int it = 0; it < q; it++) {
int code; cin >> code;
if (code == 1) {
int i; cin >> i >> o[--i];
} else {
int l, u; cin >> l >> u;
if (!((u - l + 1) & 1)) {
cout << 0 << endl;
continue;
}
unsigned int res1 = 0, res2 = 0, res3 = 0, res4 = 0;
for (int i = l - 1; i < u; i += 8) res1 ^= o[i], res2 ^= o[i + 2], res3 ^= o[i + 4], res4 ^= o[i + 6];
cout << ((res1 ^ res2) ^ (res3 ^ res4)) << endl;
}
}
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
0 ms |
212 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
1 ms |
212 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
0 ms |
212 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
897 ms |
3268 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
0 ms |
212 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |