| Task: | Xor sum |
| Sender: | aalto26dm_002 |
| Submission time: | 2026-09-21 17:06:40 +0300 |
| Language: | Python3 (PyPy3) |
| Status: | READY |
| Result: | ACCEPTED |
| test | verdict | time | |
|---|---|---|---|
| #1 | ACCEPTED | 0.04 s | details |
| #2 | ACCEPTED | 0.58 s | details |
Code
n,q = map(int,input().split())
x =list(map(int, input().split()))
k= [0]*(n+1)
for i in range(n):
k[i+1] = k[i]^x[i]
for j in range(q):
a,b = map(int,input().split())
print(k[b]^k[a-1])Test details
Test 1
Verdict: ACCEPTED
| input |
|---|
| 8 36 7 6 4 6 2 9 4 8 1 1 1 2 1 3 ... |
| correct output |
|---|
| 7 1 5 3 1 ... |
| user output |
|---|
| 7 1 5 3 1 ... |
Test 2
Verdict: ACCEPTED
| input |
|---|
| 200000 200000 921726510 307633388 992247073 ... |
| correct output |
|---|
| 834756431 130379787 403037296 308618218 784778243 ... |
| user output |
|---|
| 834756431 130379787 403037296 308618218 784778243 ... |
