26752023-01-18 21:04:03kristofIntervallumXOR kihíváspython3Time limit exceeded 35/100600ms11792 KiB
N = int(input())
for i in range(N) :
    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
        for index in range(30) :
            if x & m : 
                break
            else : 
                drop ^= m
            m >>= 1
    print(xor, drop)
SubtaskSumTestVerdictTimeMemory
subtask10/0
1Accepted18ms11224 KiB
subtask215/15
2Accepted25ms11792 KiB
subtask30/15
3Time limit exceeded552ms4092 KiB
subtask420/20
4Accepted17ms11620 KiB
subtask50/50
5Time limit exceeded600ms4104 KiB
6Time limit exceeded554ms4440 KiB