26762023-01-18 21:13:57kristofIntervallumXOR kihíváspython3Time limit exceeded 35/100600ms12044 KiB
N = int(input())
for i in range(N) :
    if i > 100000 :
        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
        for index in range(30) :
            if x & m : 
                break
            else : 
                drop ^= m
            m >>= 1
    print(xor, drop)
SubtaskSumTestVerdictTimeMemory
subtask10/0
1Accepted17ms11300 KiB
subtask215/15
2Accepted26ms11508 KiB
subtask30/15
3Time limit exceeded569ms3992 KiB
subtask420/20
4Accepted17ms11732 KiB
subtask50/50
5Time limit exceeded600ms4552 KiB
6Time limit exceeded549ms12044 KiB