#include<bits/stdc++.h>
using namespace std;
int main () {
int n, q;
cin >> n >> q;
vector<int> v(n, 0);
for(int i = 0;i<n;i++) {
int p;
cin >> p;
v[i] = p;
}
while(q--) {
int k;
cin >> k;
if(k == 2) {
int s = 0;
int l, u;
cin >> l >> u;
l--;
u = min(u, n);
for(int i = l;i<u;i++) {
if(((i - l + 1)*(u - i))%2)s^=v[i];
}
cout<<s<<endl;
}
else {
int i, j;
cin >> i >> j;
v[i-1] = j;
}
}
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
204 KB |
Output is correct |
2 |
Correct |
1 ms |
204 KB |
Output is correct |
3 |
Correct |
1 ms |
204 KB |
Output is correct |
4 |
Correct |
1 ms |
292 KB |
Output is correct |
5 |
Correct |
1 ms |
204 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
2 ms |
204 KB |
Output is correct |
2 |
Correct |
2 ms |
204 KB |
Output is correct |
3 |
Correct |
2 ms |
300 KB |
Output is correct |
4 |
Correct |
2 ms |
204 KB |
Output is correct |
5 |
Correct |
2 ms |
204 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
204 KB |
Output is correct |
2 |
Correct |
1 ms |
204 KB |
Output is correct |
3 |
Correct |
1 ms |
204 KB |
Output is correct |
4 |
Correct |
1 ms |
292 KB |
Output is correct |
5 |
Correct |
1 ms |
204 KB |
Output is correct |
6 |
Correct |
2 ms |
204 KB |
Output is correct |
7 |
Correct |
2 ms |
204 KB |
Output is correct |
8 |
Correct |
2 ms |
300 KB |
Output is correct |
9 |
Correct |
2 ms |
204 KB |
Output is correct |
10 |
Correct |
2 ms |
204 KB |
Output is correct |
11 |
Correct |
16 ms |
444 KB |
Output is correct |
12 |
Correct |
16 ms |
436 KB |
Output is correct |
13 |
Correct |
39 ms |
432 KB |
Output is correct |
14 |
Correct |
40 ms |
428 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
1084 ms |
3524 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
204 KB |
Output is correct |
2 |
Correct |
1 ms |
204 KB |
Output is correct |
3 |
Correct |
1 ms |
204 KB |
Output is correct |
4 |
Correct |
1 ms |
292 KB |
Output is correct |
5 |
Correct |
1 ms |
204 KB |
Output is correct |
6 |
Correct |
2 ms |
204 KB |
Output is correct |
7 |
Correct |
2 ms |
204 KB |
Output is correct |
8 |
Correct |
2 ms |
300 KB |
Output is correct |
9 |
Correct |
2 ms |
204 KB |
Output is correct |
10 |
Correct |
2 ms |
204 KB |
Output is correct |
11 |
Correct |
16 ms |
444 KB |
Output is correct |
12 |
Correct |
16 ms |
436 KB |
Output is correct |
13 |
Correct |
39 ms |
432 KB |
Output is correct |
14 |
Correct |
40 ms |
428 KB |
Output is correct |
15 |
Execution timed out |
1084 ms |
3524 KB |
Time limit exceeded |
16 |
Halted |
0 ms |
0 KB |
- |