n, q = map(int, input().split())
a = [int(x) for x in input().split()]
for _ in range(q):
act_type, x, y = map(int, input().split())
if act_type == 1:
a[x - 1] = y
else:
res = 0
x -= 1
y -= 1
for d in range(1, y - x + 2):
total_xor_of_seq_len_d = 0
for i in range(x, y - d + 2):
total_xor_of_seq = 0
for j in range(i, i + d):
total_xor_of_seq ^= a[j]
total_xor_of_seq_len_d ^= total_xor_of_seq
res ^= total_xor_of_seq_len_d
print(res)
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
39 ms |
19776 KB |
Output is correct |
2 |
Correct |
46 ms |
20272 KB |
Output is correct |
3 |
Correct |
41 ms |
19764 KB |
Output is correct |
4 |
Correct |
72 ms |
20996 KB |
Output is correct |
5 |
Correct |
68 ms |
20780 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
1037 ms |
20216 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
39 ms |
19776 KB |
Output is correct |
2 |
Correct |
46 ms |
20272 KB |
Output is correct |
3 |
Correct |
41 ms |
19764 KB |
Output is correct |
4 |
Correct |
72 ms |
20996 KB |
Output is correct |
5 |
Correct |
68 ms |
20780 KB |
Output is correct |
6 |
Execution timed out |
1037 ms |
20216 KB |
Time limit exceeded |
7 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
1027 ms |
39084 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
39 ms |
19776 KB |
Output is correct |
2 |
Correct |
46 ms |
20272 KB |
Output is correct |
3 |
Correct |
41 ms |
19764 KB |
Output is correct |
4 |
Correct |
72 ms |
20996 KB |
Output is correct |
5 |
Correct |
68 ms |
20780 KB |
Output is correct |
6 |
Execution timed out |
1037 ms |
20216 KB |
Time limit exceeded |
7 |
Halted |
0 ms |
0 KB |
- |