19662022-12-12 16:29:46kdbTáblajátékpython3Accepted 50/5017ms13224 KiB
input()
row = 0
col = 0
for x in input().split():
    if x == '0':
        col *= 2
        row += 1
    elif x == '1':
        col = col * 2 + 1
        row += 1
    elif x == '2':
        col //= 2
        row -= 1
    elif x == '3':
        col -= 1
    elif x == '4':
        col += 1
print(row)
print(bin(col)[2:])
SubtaskSumTestVerdictTimeMemory
base50/50
1Accepted0/017ms11104 KiB
2Accepted0/017ms11360 KiB
3Accepted3/317ms11360 KiB
4Accepted3/316ms11592 KiB
5Accepted3/317ms12148 KiB
6Accepted3/317ms12308 KiB
7Accepted3/317ms12096 KiB
8Accepted3/316ms12336 KiB
9Accepted3/316ms12316 KiB
10Accepted3/317ms12704 KiB
11Accepted3/317ms12640 KiB
12Accepted3/317ms12712 KiB
13Accepted4/417ms12960 KiB
14Accepted4/417ms13148 KiB
15Accepted4/417ms12968 KiB
16Accepted4/417ms13016 KiB
17Accepted4/416ms13224 KiB