88892024-02-02 21:59:13radocziaronTáblajátékpython3Wrong answer 1/5018ms13704 KiB
k = int(input("k: "))
lista = list(map(int,input("lista: ").split()))
x = 0
y = 0

for i in range(k):
    if lista[i] == 0:
        x = 2*x
        y += 1
    elif lista[i] == 1:
        x = (2*x)+1
        y += 1
    elif lista[i] == 2:
        if x % 2 == 0:
            x = x // 2
        else:
            x = (x-1) // 2
        y -= 1
    elif lista[i] == 3:
        x -= 1
    elif lista[i] == 4:
        x += 1
print(y)
print(format(x,"b"))
SubtaskSumTestVerdictTimeMemory
base1/50
1Wrong answer0/018ms11568 KiB
2Wrong answer0/017ms11844 KiB
3Wrong answer0/317ms11972 KiB
4Wrong answer0/317ms12196 KiB
5Wrong answer0/318ms12540 KiB
6Wrong answer0/317ms12712 KiB
7Wrong answer0/317ms12832 KiB
8Wrong answer0/317ms13156 KiB
9Wrong answer0/317ms13180 KiB
10Wrong answer0/317ms12916 KiB
11Wrong answer0/317ms13184 KiB
12Wrong answer0/317ms13324 KiB
13Wrong answer0/417ms13484 KiB
14Wrong answer0/417ms13620 KiB
15Wrong answer0/417ms13704 KiB
16Wrong answer0/417ms13508 KiB
17Partially correct1/417ms13492 KiB