26782023-01-18 21:14:59kristofIntervallumXOR kihíváspython3Wrong answer 35/100331ms12652 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
        for index in range(30) :
            if x & m : 
                break
            else : 
                drop ^= m
            m >>= 1
    print(xor, drop)
SubtaskSumTestVerdictTimeMemory
subtask10/0
1Accepted17ms11336 KiB
subtask215/15
2Accepted26ms11388 KiB
subtask30/15
3Wrong answer331ms12132 KiB
subtask420/20
4Accepted17ms12396 KiB
subtask50/50
5Wrong answer234ms12528 KiB
6Wrong answer224ms12652 KiB