27022023-01-18 22:21:24kristofIntervallumXOR kihíváspython3Time limit exceeded 35/100559ms11772 KiB
from sys import stdin, stdout
import sys
import os

def main() :
    N = int(input())
    for i in range(N) :
        if i > 90000 :
            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
            while x != 0 :
                x >>= 1
                drop |= x
        os.write(1, bytes(str(xor) + " " + str(drop) + "\n", 'ascii'))
#   print(xor, drop)
main()
SubtaskSumTestVerdictTimeMemory
subtask10/0
1Accepted17ms11468 KiB
subtask215/15
2Accepted21ms11456 KiB
subtask30/15
3Time limit exceeded518ms11732 KiB
subtask420/20
4Accepted17ms11772 KiB
subtask50/50
5Time limit exceeded559ms4716 KiB
6Time limit exceeded519ms4576 KiB