26822023-01-18 21:31:44kristofIntervallumXOR kihíváspython3Time limit exceeded 15/100566ms12276 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
        drop = 0x3fff
        m = 0x2000
        for index in range(16) :
            if x & m : 
                break
            else : 
                drop ^= m
            m >>= 1
    print(xor, drop)
SubtaskSumTestVerdictTimeMemory
subtask10/0
1Accepted17ms11528 KiB
subtask215/15
2Accepted23ms11220 KiB
subtask30/15
3Time limit exceeded566ms11944 KiB
subtask40/20
4Wrong answer17ms12088 KiB
subtask50/50
5Time limit exceeded547ms12240 KiB
6Time limit exceeded550ms12276 KiB