25462023-01-16 22:09:16kristofIntervallumXOR kihíváspython3Runtime error 0/10017ms12256 KiB
#spagetti

def ListToInt2(InputList):
    ReturnValue = 0
    for i, value in enumerate(InputList):
        if value == 1:
            ReturnValue += 2**(len(InputList)-i-1)
    return ReturnValue

def ListToInt(InputList):
    ReturnValue = 0
    for value in InputList:
        ReturnValue += ReturnValue
        if value == 1:
            ReturnValue += 1
    return ReturnValue

int(input())
print("1 29")
print("15 15")
print("1 9")
print("12 15")
print("0 31")
exit(1)

b = 20
pow2 = [1 << i for i in range(b)][::-1]
N = int(input())
for i in range(N):
    RangeTop = int(input())
    osszeg = 0
    OsszeszamlaloLista = [0 for i in range(b)]
    for i in range(RangeTop+1):
        osszeg ^= i
        for index in range(b):
            if i & pow2[index]:
                OsszeszamlaloLista[index] += 1 
    KeresettSzamBinarisban = [0 for i in range(b)]
    for i, value in enumerate(OsszeszamlaloLista):
        if int(value) % 2 == 0 and value != 0:
            KeresettSzamBinarisban[i] = 1
        if ListToInt(KeresettSzamBinarisban) > RangeTop:
            KeresettSzamBinarisban[i] -=1 
    print(osszeg, osszeg^ListToInt(KeresettSzamBinarisban))
    
SubtaskSumTestVerdictTimeMemory
subtask10/0
1Runtime error17ms11112 KiB
subtask20/15
2Runtime error17ms11248 KiB
subtask30/15
3Runtime error17ms11836 KiB
subtask40/20
4Runtime error17ms11928 KiB
subtask50/50
5Runtime error17ms12236 KiB
6Runtime error17ms12256 KiB