#include<bits/stdc++.h>
#define ll long long
using namespace std;
int o[200001];
int main(){
cin.tie(nullptr)->sync_with_stdio(false);
ll n,m;
cin >> n >> m;
for (int i=0;i<n;i++) {
cin >> o[i];
}
int x,y,k;
ll sum=0;
for (int i=0;i<m;i++) {
cin >> x >> y >> k;
y--;
if (x == 1) {
o[y] = k;
} else {
sum = o[y];
for (int i=1;i<k;i++) {
sum^=o[i];
}
for (int i=0;i<k-1;i++) {
sum^=(o[i]^o[i+1]);
}
for (int i=0;i<k-2;i++) {
sum^=(o[i]^o[i+1]^o[i+2]);
}
cout << sum <<'\n';
}
}
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
344 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
348 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
344 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
1052 ms |
3392 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
344 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |