{"trustable":false,"prependHtml":"\u003cstyle type\u003d\"text/css\"\u003e\n section pre {\n display: block;\n padding: 9.5px;\n margin: 0 0 10px;\n font-size: 13px;\n line-height: 1.42857143;\n word-break: break-all;\n word-wrap: break-word;\n color: #333;\n background: rgba(255, 255, 255, 0.5);\n border: 1px solid #ccc;\n border-radius: 6px;\n }\n\u003c/style\u003e\n\u003cscript\u003e\n window.katexOptions \u003d {\n delimiters: [\n {left: \u0027\\\\(\u0027, right: \u0027\\\\)\u0027, display: false},\n {left: \u0027\\\\[\u0027, right: \u0027\\\\]\u0027, display: true}\n ]\n };\n\u003c/script\u003e\n","sections":[{"title":"Problem Statement","value":{"format":"HTML","content":"\u003ch3\u003e\u003c/h3\u003e\n\u003cp\u003e现有 \u003cb\u003eN\u003c/b\u003e 个石头,分别标记为 \u003cb\u003e1, 2, ..., N\u003c/b\u003e。对于每一个 \u003cb\u003ei\u003c/b\u003e (\u003cb\u003e1 ≤ i ≤ N\u003c/b\u003e)有一个高度记为 \u003cb\u003eh\u003csub\u003ei\u003c/sub\u003e\u003c/b\u003e.\u003c/p\u003e \n\u003cp\u003e现有一只青蛙在石头 \u003cb\u003e1\u003c/b\u003e 上,它想通过一些跳跃到达石头 \u003cb\u003eN\u003c/b\u003e:\u003c/p\u003e \n\u003cul\u003e \n \u003cli\u003e如果青蛙此时在石头 \u003cb\u003ei\u003c/b\u003e 上,那么它可以跳到石头 \u003cb\u003ei + 1\u003c/b\u003e 或者石头 \u003cb\u003ei + 2\u003c/b\u003e,这次跳跃需要消耗它 \u003cb\u003e|h\u003csub\u003ei\u003c/sub\u003e - h\u003csub\u003ej\u003c/sub\u003e|\u003c/b\u003e 能量,其中 \u003cb\u003ej\u003c/b\u003e 为青蛙跳跃到达的石头序号。\u003c/li\u003e \n\u003c/ul\u003e \n\u003cp\u003e找到青蛙到达石头 \u003cb\u003eN\u003c/b\u003e 消耗能量可能的最小值。\u003c/p\u003e"}},{"title":"Constraints","value":{"format":"HTML","content":"\u003ch3\u003e\u003c/h3\u003e\n\u003cul\u003e \n \u003cli\u003e输入的所有值都是整数。\u003c/li\u003e \n \u003cli\u003e\u003cb\u003e2 ≤ N ≤ 10\u003csup\u003e5\u003c/sup\u003e\u003c/b\u003e\u003c/li\u003e \n \u003cli\u003e\u003cb\u003e1 ≤ h\u003csub\u003ei\u003c/sub\u003e ≤ 10\u003csup\u003e4\u003c/sup\u003e\u003c/b\u003e\u003c/li\u003e \n\u003c/ul\u003e"}},{"title":"Input","value":{"format":"HTML","content":"\u003ch3\u003e\u003c/h3\u003e\n\u003cp\u003e标准输入格式如下:\u003c/p\u003e \n\u003cpre\u003e\u003cb\u003eN\u003c/b\u003e\n\u003cb\u003eh\u003csub\u003e1\u003c/sub\u003e\u003c/b\u003e \u003cb\u003eh\u003csub\u003e2\u003c/sub\u003e\u003c/b\u003e \u003cb\u003e...\u003c/b\u003e \u003cb\u003eh\u003csub\u003eN\u003c/sub\u003e\u003c/b\u003e\n\u003c/pre\u003e"}},{"title":"Output","value":{"format":"HTML","content":"\u003ch3\u003e\u003c/h3\u003e\n\u003cp\u003e输出消耗能量可能的最小值。\u003c/p\u003e"}},{"title":"Sample Input 1","value":{"format":"HTML","content":"\u003ch3\u003e\u003c/h3\u003e\n\u003cpre\u003e4\n10 30 40 20\n\u003c/pre\u003e"}},{"title":"Sample Output 1","value":{"format":"HTML","content":"\u003ch3\u003e\u003c/h3\u003e\n\u003cpre\u003e30\n\u003c/pre\u003e \n\u003cp\u003e如果青蛙跳跃按照以下顺序: \u003cb\u003e1\u003c/b\u003e → \u003cb\u003e2\u003c/b\u003e → \u003cb\u003e4\u003c/b\u003e,那么青蛙需要消耗的能量为 \u003cb\u003e|10 - 30| + |30 - 20| \u003d 30\u003c/b\u003e。\u003c/p\u003e"}},{"title":"Sample Input 2","value":{"format":"HTML","content":"\u003ch3\u003e\u003c/h3\u003e\n\u003cpre\u003e2\n10 10\n\u003c/pre\u003e"}},{"title":"Sample Output 2","value":{"format":"HTML","content":"\u003ch3\u003e\u003c/h3\u003e\n\u003cpre\u003e0\n\u003c/pre\u003e \n\u003cp\u003e如果青蛙跳跃按照以下顺序:\u003cb\u003e1\u003c/b\u003e → \u003cb\u003e2\u003c/b\u003e,那么青蛙需要消耗的能量为 \u003cb\u003e|10 - 10| \u003d 0\u003c/b\u003e。\u003c/p\u003e"}},{"title":"Sample Input 3","value":{"format":"HTML","content":"\u003ch3\u003e\u003c/h3\u003e\n\u003cpre\u003e6\n30 10 60 10 60 50\n\u003c/pre\u003e"}},{"title":"Sample Output 3","value":{"format":"HTML","content":"\u003ch3\u003e\u003c/h3\u003e\n\u003cpre\u003e40\n\u003c/pre\u003e \n\u003cp\u003e如果青蛙跳跃按照以下顺序:\u003cb\u003e1\u003c/b\u003e → \u003cb\u003e3\u003c/b\u003e → \u003cb\u003e5\u003c/b\u003e → \u003cb\u003e6\u003c/b\u003e,那么青蛙消耗的能量为 \u003cb\u003e|30 - 60| + |60 - 60| + |60 - 50| \u003d 40\u003c/b\u003e。\u003c/p\u003e"}}]}