2529 | 2023-01-16 17:52:16 | kristof | IntervallumXOR kihívás | python3 | Wrong answer 0/100 | 579ms | 12732 KiB |
N = int(input())
for i in range(N):
asd = int(input())
a = [0 for i in range(len(str(bin(asd)[2:])))]
b = len(bin(asd)[2:])
for i in range(asd+1):
for index, j in enumerate(str(bin(i)[2:]).zfill(b)):
if j == "1":
a[index] += 1
TempVar = [0 for i in range(len(a))]
def ListToInt(InputList):
ReturnValue = 0
for i, value in enumerate(InputList):
if value == 1:
ReturnValue += 2**(len(InputList)-i-1)
return ReturnValue
for i, value in enumerate(a):
if int(value) % 2 == 0 and value != 0:
TempVar[i] += 1
if ListToInt(TempVar) > asd:
TempVar[i] -=1
a = 0
Kihagyndo = ListToInt(TempVar)
for i in range(asd+1):
if i == Kihagyndo:
continue
else:
a ^= i
print(a)
Subtask | Sum | Test | Verdict | Time | Memory | ||
---|---|---|---|---|---|---|---|
subtask1 | 0/0 | ||||||
1 | Wrong answer | 18ms | 12732 KiB | ||||
subtask2 | 0/15 | ||||||
2 | Time limit exceeded | 579ms | 5008 KiB | ||||
subtask3 | 0/15 | ||||||
3 | Time limit exceeded | 563ms | 5172 KiB | ||||
subtask4 | 0/20 | ||||||
4 | Time limit exceeded | 554ms | 5348 KiB | ||||
subtask5 | 0/50 | ||||||
5 | Time limit exceeded | 578ms | 5588 KiB | ||||
6 | Time limit exceeded | 578ms | 5616 KiB |