201803-1(Python实现)

2019-12-09  本文已影响0人  tmax
reList = list( map(int, input().split()) )

output = 0
count = 0

for ele in reList:
    if ele == 2:
        count += 1
    else:
        count = 0
    if count == 0:
        if ele == 1:
            output += 1
    else:
        output += count*2
print(output)
上一篇下一篇

猜你喜欢

热点阅读