이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
n, q = map(int, input().split())
a = [int(x) for x in input().split()]
prefix_xor = a[:]
for i in range(1, n):
prefix_xor[i] ^= prefix_xor[i - 1]
for _ in range(q):
act_type, x, y = map(int, input().split())
x -= 1
y -= 1
res = 0
for d in range(1, y - x + 2):
total_xor_of_seq_len_d = 0
for i in range(x, y - d + 2):
if i == 0:
total_xor_of_seq_len_d ^= prefix_xor[i + d - 1]
else:
total_xor_of_seq_len_d ^= (prefix_xor[i + d - 1] ^ prefix_xor[i - 1])
res ^= total_xor_of_seq_len_d
print(res)
| # | Verdict | Execution time | Memory | Grader output |
|---|
| Fetching results... |
| # | Verdict | Execution time | Memory | Grader output |
|---|
| Fetching results... |
| # | Verdict | Execution time | Memory | Grader output |
|---|
| Fetching results... |
| # | Verdict | Execution time | Memory | Grader output |
|---|
| Fetching results... |
| # | Verdict | Execution time | Memory | Grader output |
|---|
| Fetching results... |