25562023-01-17 02:20:22kristofIntervallumXOR kihíváspython3Time limit exceeded 35/100601ms13308 KiB
from sys import stdin, stdout
import sys
import os
pow2 = [1 << i for i in range(30)][::-1]
mm = pow2[0]
N = int(input())
x = [int(stdin.readline()) for i in range(N)]
for i in range(N):
    xx = x[i]
    if xx % 4 == 0:
        xor = xx
    if xx % 4 == 1:
        xor = 1
    if xx % 4 == 2:
        xor = xx + 1
    if xx % 4 == 3:
        xor = 0
    drop = xor
    m = mm
    for index in range(30):
        if m ^ drop <= xx:
            drop ^= m
        m >>= 1
    #print(xor, xor ^ drop)
    sys.stdout.write(str(xor) + " " + str(xor ^ drop) + "\n")
SubtaskSumTestVerdictTimeMemory
subtask10/0
1Accepted18ms11572 KiB
subtask215/15
2Accepted27ms12112 KiB
subtask30/15
3Time limit exceeded564ms12840 KiB
subtask420/20
4Accepted17ms12444 KiB
subtask50/50
5Time limit exceeded601ms13144 KiB
6Time limit exceeded558ms13308 KiB