27002023-01-18 22:18:32kristofIntervallumXOR kihíváspython3Wrong answer 35/100514ms12452 KiB
from sys import stdin, stdout
import sys
import os

def main() :
    N = int(input())
    for i in range(N) :
        if i > 80000 :
            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
1Accepted18ms11360 KiB
subtask215/15
2Accepted21ms11588 KiB
subtask30/15
3Wrong answer416ms11816 KiB
subtask420/20
4Accepted17ms11984 KiB
subtask50/50
5Time limit exceeded514ms12316 KiB
6Time limit exceeded514ms12452 KiB