Problem 67
Maximum Path Sum II
By starting at the top of the triangle below and moving to adjacent numbers on the row below, the maximum total from top to bottom is
That is,
Find the maximum total from top to bottom in triangle.txt(right click and ‘Save Link/Target As…’), a 15K text file containing a triangle with one-hundred rows.
NOTE: This is a much more difficult version of Problem 18. It is not possible to try every route to solve this problem, as there are
最大路径和(二)
从下面展示的三角形的顶端出发,不断移动到在下一行与其相邻的元素,能够得到的最大路径和是
如上图,最大路径和为
在文本文件[triangle.txt] (https://projecteuler.net/project/resources/p067_triangle.txt)中包含了一个一百行的三角形,求从其顶端出发到达底部,所能够得到的最大路径和。
注意:这是第18题的强化版。由于总路径一共有
Be the first person to leave a comment!