26972023-01-18 22:15:49kristofIntervallumXOR kihíváspython3Runtime error 0/10018ms11992 KiB
import numpy
from sys import stdin, stdout
import sys
import os

def main() :
    N = int(input())
    for i in range(N) :
        if i > 60000 :
            exit(0)
        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
        if x%2 :
            drop = x
        else :
            drop = x
            while x != 0 :
                x >>= 1
                drop |= x
        os.write(1, bytes(str(xor) + " " + str(drop) + "\n", 'ascii'))
#   print(xor, drop)
main()
SubtaskSumTestVerdictTimeMemory
subtask10/0
1Runtime error18ms11084 KiB
subtask20/15
2Runtime error17ms11432 KiB
subtask30/15
3Runtime error17ms11404 KiB
subtask40/20
4Runtime error17ms11676 KiB
subtask50/50
5Runtime error17ms11672 KiB
6Runtime error17ms11992 KiB