#include <iostream>
using namespace std;
const int MAXN = 2e5 + 123;
int a[MAXN];
signed main(){
int n, q;
cin >> n >> q;
for(int i = 0; i < n; ++i){
cin >> a[i];
}
while(q--){
int t;
cin >> t;
if(t == 1){
int i, x;
cin >> i >> x;
--i;
a[i] = x;
} else {
int l, r;
cin >> l >> r;
--l;
int ans = 0;
for(int l0 = l; l0 < r; ++l0){
for(int r0 = l0 + 1; r0 <= r; ++r0){
for(int i = l0; i < r0; ++i)
ans ^= a[i];
}
}
cout << ans << '\n';
}
}
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
204 KB |
Output is correct |
2 |
Correct |
1 ms |
204 KB |
Output is correct |
3 |
Correct |
2 ms |
204 KB |
Output is correct |
4 |
Correct |
6 ms |
204 KB |
Output is correct |
5 |
Correct |
6 ms |
204 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
682 ms |
204 KB |
Output is correct |
2 |
Correct |
573 ms |
204 KB |
Output is correct |
3 |
Correct |
778 ms |
204 KB |
Output is correct |
4 |
Execution timed out |
1080 ms |
316 KB |
Time limit exceeded |
5 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
204 KB |
Output is correct |
2 |
Correct |
1 ms |
204 KB |
Output is correct |
3 |
Correct |
2 ms |
204 KB |
Output is correct |
4 |
Correct |
6 ms |
204 KB |
Output is correct |
5 |
Correct |
6 ms |
204 KB |
Output is correct |
6 |
Correct |
682 ms |
204 KB |
Output is correct |
7 |
Correct |
573 ms |
204 KB |
Output is correct |
8 |
Correct |
778 ms |
204 KB |
Output is correct |
9 |
Execution timed out |
1080 ms |
316 KB |
Time limit exceeded |
10 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Execution timed out |
1087 ms |
1324 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
204 KB |
Output is correct |
2 |
Correct |
1 ms |
204 KB |
Output is correct |
3 |
Correct |
2 ms |
204 KB |
Output is correct |
4 |
Correct |
6 ms |
204 KB |
Output is correct |
5 |
Correct |
6 ms |
204 KB |
Output is correct |
6 |
Correct |
682 ms |
204 KB |
Output is correct |
7 |
Correct |
573 ms |
204 KB |
Output is correct |
8 |
Correct |
778 ms |
204 KB |
Output is correct |
9 |
Execution timed out |
1080 ms |
316 KB |
Time limit exceeded |
10 |
Halted |
0 ms |
0 KB |
- |