import os import sys def test(): brick = input() if brick=='0': pass else: brick = brick.split(" ") for i in range(0,len(brick)): brick[i]=int(brick[i]) s=brick[0]*5+brick[1]*6 if len(brick)>2: for i in range(2,len(brick)): if brick[i]>brick[i-1]: s=s+(brick[i]-brick[i-1])*6 else: s = s + (brick[i-1]-brick[i])*4 else: pass print(s) test() test()
HDU 1008 Elevator Python实现
最新推荐文章于 2021-02-15 21:16:35 发布