#include<bits/stdc++.h>
using namespace std;
int main() {
ios::sync_with_stdio(0);
cin.tie(0);
int n, q;
cin >> n >> q;
int a[n + 1];
for(int i = 1; i <= n; i++) {
cin >> a[i];
}
while(q--) {
int t, l, r;
cin >> t >> l >> r;
if(t == 1) {
a[l] = r;
} else {
int S = a[l];
for(int i = l + 1; i <= r; i++) {
S = (S ^ a[i]);
}
for(int i = 2; i <= r - l + 1; i++) {
for(int j = l; j <= r - i + 1; j++) {
int A = 0;
for(int k = j; k <= j + i - 1; k++) {
A = (A ^ a[k]);
}
S = (S ^ A);
}
}
cout << S << '\n';
}
}
return 0;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
348 KB |
Output is correct |
2 |
Correct |
1 ms |
348 KB |
Output is correct |
3 |
Correct |
1 ms |
348 KB |
Output is correct |
4 |
Correct |
4 ms |
348 KB |
Output is correct |
5 |
Correct |
3 ms |
348 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
399 ms |
444 KB |
Output is correct |
2 |
Correct |
365 ms |
444 KB |
Output is correct |
3 |
Correct |
459 ms |
468 KB |
Output is correct |
4 |
Execution timed out |
1056 ms |
348 KB |
Time limit exceeded |
5 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
348 KB |
Output is correct |
2 |
Correct |
1 ms |
348 KB |
Output is correct |
3 |
Correct |
1 ms |
348 KB |
Output is correct |
4 |
Correct |
4 ms |
348 KB |
Output is correct |
5 |
Correct |
3 ms |
348 KB |
Output is correct |
6 |
Correct |
399 ms |
444 KB |
Output is correct |
7 |
Correct |
365 ms |
444 KB |
Output is correct |
8 |
Correct |
459 ms |
468 KB |
Output is correct |
9 |
Execution timed out |
1056 ms |
348 KB |
Time limit exceeded |
10 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Execution timed out |
1065 ms |
3272 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
348 KB |
Output is correct |
2 |
Correct |
1 ms |
348 KB |
Output is correct |
3 |
Correct |
1 ms |
348 KB |
Output is correct |
4 |
Correct |
4 ms |
348 KB |
Output is correct |
5 |
Correct |
3 ms |
348 KB |
Output is correct |
6 |
Correct |
399 ms |
444 KB |
Output is correct |
7 |
Correct |
365 ms |
444 KB |
Output is correct |
8 |
Correct |
459 ms |
468 KB |
Output is correct |
9 |
Execution timed out |
1056 ms |
348 KB |
Time limit exceeded |
10 |
Halted |
0 ms |
0 KB |
- |