n, q = map(int, input().split())
a = [int(x) for x in input().split()]
for _ in range(q):
t, x, y = map(int, input().split())
if t == 1:
a[x - 1] = y
else:
x -= 1
y -= 1
xor = 0
mx_len = y - x + 1
for l in range(1, mx_len + 1):
for i in range(x, y - l + 2):
sub_xor = 0
for j in range(i, i + l):
sub_xor ^= a[j]
xor ^= sub_xor
print(xor)
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
63 ms |
19964 KB |
Output is correct |
2 |
Correct |
56 ms |
20004 KB |
Output is correct |
3 |
Correct |
67 ms |
19888 KB |
Output is correct |
4 |
Correct |
109 ms |
20248 KB |
Output is correct |
5 |
Correct |
102 ms |
21404 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Execution timed out |
1083 ms |
19748 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
63 ms |
19964 KB |
Output is correct |
2 |
Correct |
56 ms |
20004 KB |
Output is correct |
3 |
Correct |
67 ms |
19888 KB |
Output is correct |
4 |
Correct |
109 ms |
20248 KB |
Output is correct |
5 |
Correct |
102 ms |
21404 KB |
Output is correct |
6 |
Execution timed out |
1083 ms |
19748 KB |
Time limit exceeded |
7 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Execution timed out |
1057 ms |
38960 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
63 ms |
19964 KB |
Output is correct |
2 |
Correct |
56 ms |
20004 KB |
Output is correct |
3 |
Correct |
67 ms |
19888 KB |
Output is correct |
4 |
Correct |
109 ms |
20248 KB |
Output is correct |
5 |
Correct |
102 ms |
21404 KB |
Output is correct |
6 |
Execution timed out |
1083 ms |
19748 KB |
Time limit exceeded |
7 |
Halted |
0 ms |
0 KB |
- |