25912023-01-17 20:45:51kristofIntervallumXOR kihíváspython3Runtime error 0/10018ms11732 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
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)
	all = all + str(xor) + " " + str(xor ^ drop) + "\n"
#    sys.stdout.write(str(xor) + " " + str(xor ^ drop) + "\n")
sys.stdout.write(all)
SubtaskSumTestVerdictTimeMemory
subtask10/0
1Runtime error18ms11048 KiB
subtask20/15
2Runtime error17ms11492 KiB
subtask30/15
3Runtime error17ms11380 KiB
subtask40/20
4Runtime error17ms11600 KiB
subtask50/50
5Runtime error17ms11696 KiB
6Runtime error17ms11732 KiB