2553 | 2023-01-17 01:02:40 | kristof | IntervallumXOR kihívás | python3 | Runtime error 0/100 | 256ms | 27960 KiB |
#spagetti
import sys
pow2 = [1 << i for i in range(30)][::-1]
x = [0 for i in range(200000)]
N = int(input())
for i in range(N):
x[i] = int(input())
for i in range(N):
if x[i] % 4 == 0:
xor = x
if x[i] % 4 == 1:
xor = 1
if x[i] % 4 == 2:
xor = x + 1
if x[i] % 4 == 3:
xor = 0
drop = xor
for index in range(30):
if pow2[index] ^ drop <= x[i]:
drop ^= pow2[index]
#print(xor, xor ^ drop)
sys.stdout.write(str(xor) + " " + str(xor ^ drop) + "\n")
Subtask | Sum | Test | Verdict | Time | Memory | ||
---|---|---|---|---|---|---|---|
subtask1 | 0/0 | ||||||
1 | Runtime error | 29ms | 14680 KiB | ||||
subtask2 | 0/15 | ||||||
2 | Runtime error | 28ms | 14680 KiB | ||||
subtask3 | 0/15 | ||||||
3 | Runtime error | 256ms | 27960 KiB | ||||
subtask4 | 0/20 | ||||||
4 | Runtime error | 28ms | 15684 KiB | ||||
subtask5 | 0/50 | ||||||
5 | Runtime error | 252ms | 27860 KiB | ||||
6 | Runtime error | 252ms | 27656 KiB |