#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
#define SZ(x) (int)(x.size())
#define F0(i,n) for(int i=0;i<n;i++)
#define F1(i,n) for(int i=1;i<=n;i++)
#define CL(a,x) memset(x, a, sizeof(x));
#define PR(x) cerr << #x << "=" << (x) << endl;
const int inf = 1000000009;
const double pi = atan(1.0)*4.0;
const double eps = 1e-8;
const int N = 200001;
int i, j, k, m, n;
int a[N];
int main() {
//freopen("x.in", "r", stdin);
int q, t;
cin >> n >> q;
F1(i, n) cin >> a[i];
while (q--) {
cin >> t >> i >> j;
if (t == 1) {
a[i] = j;
} else {
int len = j - i + 1;
int ret = 0;
if (len % 2) {
for (int L = i; L <= j; L++) {
int curr = 0;
for (int R = L; R <= j; R++) {
curr ^= a[R];
ret ^= curr;
}
}
}
cout << ret << endl;
}
}
return 0;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
5 ms |
256 KB |
Output is correct |
2 |
Correct |
5 ms |
384 KB |
Output is correct |
3 |
Correct |
5 ms |
384 KB |
Output is correct |
4 |
Correct |
5 ms |
256 KB |
Output is correct |
5 |
Correct |
5 ms |
384 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
11 ms |
512 KB |
Output is correct |
2 |
Correct |
10 ms |
384 KB |
Output is correct |
3 |
Correct |
12 ms |
256 KB |
Output is correct |
4 |
Correct |
30 ms |
256 KB |
Output is correct |
5 |
Correct |
29 ms |
256 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
5 ms |
256 KB |
Output is correct |
2 |
Correct |
5 ms |
384 KB |
Output is correct |
3 |
Correct |
5 ms |
384 KB |
Output is correct |
4 |
Correct |
5 ms |
256 KB |
Output is correct |
5 |
Correct |
5 ms |
384 KB |
Output is correct |
6 |
Correct |
11 ms |
512 KB |
Output is correct |
7 |
Correct |
10 ms |
384 KB |
Output is correct |
8 |
Correct |
12 ms |
256 KB |
Output is correct |
9 |
Correct |
30 ms |
256 KB |
Output is correct |
10 |
Correct |
29 ms |
256 KB |
Output is correct |
11 |
Execution timed out |
1090 ms |
504 KB |
Time limit exceeded |
12 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
1091 ms |
1248 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
5 ms |
256 KB |
Output is correct |
2 |
Correct |
5 ms |
384 KB |
Output is correct |
3 |
Correct |
5 ms |
384 KB |
Output is correct |
4 |
Correct |
5 ms |
256 KB |
Output is correct |
5 |
Correct |
5 ms |
384 KB |
Output is correct |
6 |
Correct |
11 ms |
512 KB |
Output is correct |
7 |
Correct |
10 ms |
384 KB |
Output is correct |
8 |
Correct |
12 ms |
256 KB |
Output is correct |
9 |
Correct |
30 ms |
256 KB |
Output is correct |
10 |
Correct |
29 ms |
256 KB |
Output is correct |
11 |
Execution timed out |
1090 ms |
504 KB |
Time limit exceeded |
12 |
Halted |
0 ms |
0 KB |
- |