37002023-03-02 11:29:53DoraTáblajátékpython3Accepted 50/5017ms14088 KiB
K = int(input())
lepesek = list(map(int, input().split()))
szint = 0
szel = 0

for item in lepesek:
    if item == 0:
        szint += 1
        szel *= 2
    elif item == 1:
        szint += 1
        szel = szel * 2 + 1
    elif item == 2:
        szint -= 1
        szel //= 2  # we can move to the right from an even index
    elif item == 3:
        szel -= 1
    elif item == 4:
        szel += 1

print(szint)
print(bin(szel)[2:])
SubtaskSumTestVerdictTimeMemory
base50/50
1Accepted0/017ms11448 KiB
2Accepted0/017ms11764 KiB
3Accepted3/317ms11868 KiB
4Accepted3/317ms12024 KiB
5Accepted3/317ms12480 KiB
6Accepted3/317ms12380 KiB
7Accepted3/317ms12848 KiB
8Accepted3/317ms12624 KiB
9Accepted3/317ms13096 KiB
10Accepted3/317ms12964 KiB
11Accepted3/317ms13336 KiB
12Accepted3/317ms13312 KiB
13Accepted4/417ms13812 KiB
14Accepted4/417ms13964 KiB
15Accepted4/417ms13852 KiB
16Accepted4/417ms14088 KiB
17Accepted4/417ms13888 KiB