绝世好题
You cannot submit for this problem because the contest is ended. You can click "Open in Problem Set" to view this problem in normal mode.
Background
小 去爬山啦!
Description
小 有两种方式爬山:
1.
爬
从一个山峰爬到相邻山峰,花费 。2.
瞬移
移到任意一个山峰,花费
小 想知道他从 号山峰开始经过 个山峰所需要的最小体力。
Format
Input
第一行两个整数 。 然后 个数字,代表山峰的高度 。
Output
一行,代表答案
Samples
6 5
100 1 3 0 10 100
7
Limitation
保证答案不超 long long
。
菜就多练
- Status
- Done
- Rule
- IOI(Strict)
- Problem
- 19
- Start at
- 2024-3-2 19:15
- End at
- 2024-4-13 11:15
- Duration
- 1000 hour(s)
- Host
- Partic.
- 3