1008 Elevator
注意点
- 在同一层的时候时间还是要加上
python3代码
data_list = list(map(int, input().split(" ")[1:]))time = 0floor = 0for num in data_list: if num > floor: time += 6*(num-floor) + 5 elif num < floor: time += 4*(floor-num) + 5 else: time += 5 floor = numprint(time)