2551 | 2023-01-17 00:27:55 | kristof | IntervallumXOR kihívás | python3 | Time limit exceeded 15/100 | 600ms | 11800 KiB |
#spagetti
pow2 = [1 << i for i in range(14)][::-1]
N = int(input())
for i in range(N):
x = int(input())
if x % 4 == 0:
xor = x
if x % 4 == 1:
xor = 1
if x % 4 == 2:
xor = x + 1
if x % 4 == 3:
xor = 0
drop = xor
for index in range(14):
if pow2[index] ^ drop <= x:
drop ^= pow2[index]
print(xor, xor ^ drop)
Subtask | Sum | Test | Verdict | Time | Memory | ||
---|---|---|---|---|---|---|---|
subtask1 | 0/0 | ||||||
1 | Accepted | 18ms | 11356 KiB | ||||
subtask2 | 15/15 | ||||||
2 | Accepted | 27ms | 11704 KiB | ||||
subtask3 | 0/15 | ||||||
3 | Time limit exceeded | 560ms | 4024 KiB | ||||
subtask4 | 0/20 | ||||||
4 | Wrong answer | 17ms | 11800 KiB | ||||
subtask5 | 0/50 | ||||||
5 | Time limit exceeded | 600ms | 4612 KiB | ||||
6 | Time limit exceeded | 572ms | 4372 KiB |