26922023-01-18 21:54:43kristofIntervallumXOR kihíváspython3Wrong answer 35/100479ms12992 KiB
N = int(input())
for i in range(N) :
    if i > 60000 :
        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 = x
        for index in range(16) :
            if x == 0 :
                break
            x >>= 1
            drop |= x
    print(xor, drop)
SubtaskSumTestVerdictTimeMemory
subtask10/0
1Accepted18ms11512 KiB
subtask215/15
2Accepted24ms11576 KiB
subtask30/15
3Wrong answer470ms11808 KiB
subtask420/20
4Accepted17ms12160 KiB
subtask50/50
5Wrong answer456ms12340 KiB
6Wrong answer479ms12992 KiB