n, q = map(int, input().split())
A = list(map(int, input().split())) # scan results
doublepref = [0, 0]
for x in A:
doublepref.append(doublepref[-2] ^ x)
for _ in range(q):
q, i, j = map(int, input().split())
if q == 1:
# rescan
A[i-1] = j
doublepref = [0, 0]
for x in A:
doublepref.append(doublepref[-2] ^ x)
else:
# query
if (j - i) % 2 == 1:
print(0)
else:
print(doublepref[j+1] ^ doublepref[i-1])
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
12 ms |
2772 KB |
Output is correct |
2 |
Correct |
11 ms |
2864 KB |
Output is correct |
3 |
Correct |
12 ms |
2772 KB |
Output is correct |
4 |
Correct |
11 ms |
2856 KB |
Output is correct |
5 |
Correct |
11 ms |
2772 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
13 ms |
2848 KB |
Output is correct |
2 |
Correct |
12 ms |
2832 KB |
Output is correct |
3 |
Correct |
12 ms |
2840 KB |
Output is correct |
4 |
Correct |
12 ms |
2900 KB |
Output is correct |
5 |
Correct |
12 ms |
2900 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
12 ms |
2772 KB |
Output is correct |
2 |
Correct |
11 ms |
2864 KB |
Output is correct |
3 |
Correct |
12 ms |
2772 KB |
Output is correct |
4 |
Correct |
11 ms |
2856 KB |
Output is correct |
5 |
Correct |
11 ms |
2772 KB |
Output is correct |
6 |
Correct |
13 ms |
2848 KB |
Output is correct |
7 |
Correct |
12 ms |
2832 KB |
Output is correct |
8 |
Correct |
12 ms |
2840 KB |
Output is correct |
9 |
Correct |
12 ms |
2900 KB |
Output is correct |
10 |
Correct |
12 ms |
2900 KB |
Output is correct |
11 |
Execution timed out |
1070 ms |
3660 KB |
Time limit exceeded |
12 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
879 ms |
25936 KB |
Output is correct |
2 |
Correct |
900 ms |
26072 KB |
Output is correct |
3 |
Correct |
906 ms |
26116 KB |
Output is correct |
4 |
Correct |
871 ms |
26252 KB |
Output is correct |
5 |
Correct |
856 ms |
26080 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
12 ms |
2772 KB |
Output is correct |
2 |
Correct |
11 ms |
2864 KB |
Output is correct |
3 |
Correct |
12 ms |
2772 KB |
Output is correct |
4 |
Correct |
11 ms |
2856 KB |
Output is correct |
5 |
Correct |
11 ms |
2772 KB |
Output is correct |
6 |
Correct |
13 ms |
2848 KB |
Output is correct |
7 |
Correct |
12 ms |
2832 KB |
Output is correct |
8 |
Correct |
12 ms |
2840 KB |
Output is correct |
9 |
Correct |
12 ms |
2900 KB |
Output is correct |
10 |
Correct |
12 ms |
2900 KB |
Output is correct |
11 |
Execution timed out |
1070 ms |
3660 KB |
Time limit exceeded |
12 |
Halted |
0 ms |
0 KB |
- |