26812023-01-18 21:30:15kristofIntervallumXOR kihíváspython3Time limit exceeded 15/100600ms11744 KiB
N = int(input())
for i in range(N) :
    #if i > 40000 :
    #    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 = 0x3fffffff
        #m = 0x20000000
        drop = 0x3fff
        m = 0x2000
        for index in range(16) :
            if x & m : 
                break
            else : 
                drop ^= m
            m >>= 1
    print(xor, drop)
SubtaskSumTestVerdictTimeMemory
subtask10/0
1Accepted17ms11268 KiB
subtask215/15
2Accepted23ms11452 KiB
subtask30/15
3Time limit exceeded600ms4336 KiB
subtask40/20
4Wrong answer17ms11744 KiB
subtask50/50
5Time limit exceeded600ms4380 KiB
6Time limit exceeded570ms4176 KiB