이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
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])
# | 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... |