25512023-01-17 00:27:55kristofIntervallumXOR kihíváspython3Time limit exceeded 15/100600ms11800 KiB
#spagetti

pow2 = [1 << i for i in range(14)][::-1]
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
    drop = xor
    for index in range(14):
        if pow2[index] ^ drop <= x:
            drop ^= pow2[index]
    print(xor, xor ^ drop)
SubtaskSumTestVerdictTimeMemory
subtask10/0
1Accepted18ms11356 KiB
subtask215/15
2Accepted27ms11704 KiB
subtask30/15
3Time limit exceeded560ms4024 KiB
subtask40/20
4Wrong answer17ms11800 KiB
subtask50/50
5Time limit exceeded600ms4612 KiB
6Time limit exceeded572ms4372 KiB