{"trustable":false,"sections":[{"title":"","value":{"format":"HTML","content":"\u003cscript type\u003d\u0027text/x-mathjax-config\u0027\u003eMathJax.Hub.Config({tex2jax: { inlineMath: [[\u0027$\u0027,\u0027$\u0027],[\u0027\\[\u0027,\u0027\\]\u0027]] } }); \u003c/script\u003e\n\u003cscript type\u003d\u0027text/javascript\u0027 src\u003d\u0027https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.1/MathJax.js?config\u003dTeX-AMS-MML_HTMLorMML\u0027\u003e\u003c/script\u003e\n\u003cscript type\u003d\u0027text/javascript\u0027\u003esetTimeout(function(){MathJax.Hub.Queue([\u0027Typeset\u0027, MathJax.Hub, \u0027description-container\u0027]);}, 2000);\u003c/script\u003e\n\u003chtml\u003e\n \u003chead\u003e\u003c/head\u003e\n \u003cbody\u003e\n \u003cp\u003e有一座三角形的金字塔上有许多金币。小明从塔顶(第一层)出发向下走收集金币,每走到一个节点就可以收集该节点处所有的金币。若小明在第k层的i号位置时,小明向下走的时候只能走到k+1层的i号位置或i+1号位置。\u003c/p\u003e \n \u003cp\u003e\u003cbr\u003e 现在给出一个三角形数塔,请帮助小明找出一条从第一层到达底层的路径,使获得的金币数最多\u003c/p\u003e \n \u003c/body\u003e\n\u003c/html\u003e"}},{"title":"Input","value":{"format":"HTML","content":"\u003chtml\u003e\n \u003chead\u003e\u003c/head\u003e\n \u003cbody\u003e\n 第一行一个正整数 N,表示数塔的层数 N(1\u0026lt;\u003dN\u0026lt;\u003d100)。 第二行起,第 i 行有 i 个数,第 j 个数对应从左到右数第 j 个节点上的金币数,共 N 行。\n \u003c/body\u003e\n\u003c/html\u003e"}},{"title":"Output","value":{"format":"HTML","content":"\u003chtml\u003e\n \u003chead\u003e\u003c/head\u003e\n \u003cbody\u003e\n 一行一个数,表示能获得的最多的金币数\n \u003c/body\u003e\n\u003c/html\u003e"}},{"title":"Sample Input","value":{"format":"HTML","content":"\u003cpre\u003e6\n88 \n97 26 \n39 16 47 \n94 25 66 4 \n64 49 20 36 27 \n37 87 29 37 10 40\u003c/pre\u003e"}},{"title":"Sample Output","value":{"format":"HTML","content":"\u003cpre\u003e469\u003c/pre\u003e"}}]}