25972023-01-17 21:09:08kristofIntervallumXOR kihíváspython3Runtime error 0/100564ms27888 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 = 20000
# if N > max: N = max
all = ""
i = 0
while i < N:
    xx = x[i]
    #aa = xx % 4
    aa = xx & 4
    if aa == 0 : xxor = xx
    if aa == 1 : xxor = 1
    if aa == 2 : xxor = xx + 1
    if aa == 3 : xxor = 0
    drop = xxor
    m = mm
    for index in range(30):
        if m ^ drop <= xx:
            drop ^= m
        m >>= 1
    #print(xxor, xxor ^ drop, flush=True)
    all = all + str(xxor) + " " + str(xxor ^ drop) + "\n"
    # sys.stdout.write(str(xxor) + " " + str(xxor ^ drop) + "\n")
    i += 1
sys.stdout.write(all)

SubtaskSumTestVerdictTimeMemory
subtask10/0
1Runtime error18ms11292 KiB
subtask20/15
2Wrong answer27ms12024 KiB
subtask30/15
3Runtime error90ms27644 KiB
subtask40/20
4Runtime error17ms12320 KiB
subtask50/50
5Runtime error93ms27888 KiB
6Time limit exceeded564ms13652 KiB