26942023-01-18 22:12:26kristofIntervallumXOR kihíváspython3Runtime error 0/10017ms12020 KiB
import numpy
from sys import stdin, stdout

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 error17ms11384 KiB
subtask20/15
2Runtime error17ms11624 KiB
subtask30/15
3Runtime error17ms11500 KiB
subtask40/20
4Runtime error17ms11736 KiB
subtask50/50
5Runtime error17ms12020 KiB
6Runtime error17ms12008 KiB