B16 - Frog 1
https://atcoder.jp/contests/tessoku-book/tasks/dp_a
提出
code: python
n = int(input())
h = list(map(int, input().split()))
# 0 1 2 3
# 10 30 40 20
# dpi := i にいるときの最小
dp = 0 * n
dp0 = 0
dp1 = abs(h0 - h1)
for i in range(2, n):
dpi = min(dpi-2 + abs(hi - hi-2), dpi-1 + abs(hi - hi-1))
print(dp-1)