2587 | 2023-01-17 20:40:08 | kristof | IntervallumXOR kihívás | python3 | Wrong answer 35/100 | 206ms | 28340 KiB |
from sys import stdin, stdout
import sys
import os
pow2 = [1 << i for i in range(30)][::-1]
mm = pow2[0]
N = int(input())
x = [int(stdin.readline()) for i in range(N)]
max = 10000
if N > max: N = max
for i in range(N):
xx = x[i]
if xx % 4 == 0:
xor = xx
if xx % 4 == 1:
xor = 1
if xx % 4 == 2:
xor = xx + 1
if xx % 4 == 3:
xor = 0
drop = xor
m = mm
for index in range(30):
if m ^ drop <= xx:
drop ^= m
m >>= 1
#print(xor, xor ^ drop)
sys.stdout.write(str(xor) + " " + str(xor ^ drop) + "\n")
Subtask | Sum | Test | Verdict | Time | Memory | ||
---|---|---|---|---|---|---|---|
subtask1 | 0/0 | ||||||
1 | Accepted | 18ms | 11496 KiB | ||||
subtask2 | 15/15 | ||||||
2 | Accepted | 27ms | 11728 KiB | ||||
subtask3 | 0/15 | ||||||
3 | Wrong answer | 189ms | 27932 KiB | ||||
subtask4 | 20/20 | ||||||
4 | Accepted | 17ms | 11932 KiB | ||||
subtask5 | 0/50 | ||||||
5 | Wrong answer | 206ms | 28340 KiB | ||||
6 | Wrong answer | 204ms | 28152 KiB |