###### triangle
#include<iostream>
#include<algorithm>
#include<vector>
using namespace std;
int minimumTotal(vector<vector<int>>&triangle)
{
for(int i=triangle.size()-2;i>=0;--i)
{
for(int j=0;j<=i;++j)
triangle[i][j]+=min(triangle[i+1][j],triangle[i+1][j+1]);

}
return triangle[0][0];
}
int main()
{
vector<vector<int>>triangle;
vector<int>v;
v.push_back(2);
triangle.push_back(v);
v.clear();
v.push_back(3);
v.push_back(4);
triangle.push_back(v);
v.clear();
v.push_back(6);
v.push_back(5);
v.push_back(7);
triangle.push_back(v);
v.clear();
v.push_back(4);
v.push_back(1);
v.push_back(8);
v.push_back(3);
triangle.push_back(v);
cout<<minimumTotal(triangle)<<endl;
return 0;
}

#### Triangle -- LeetCode

2014-04-09 02:52:23

#### 【LeetCode】120. Triangle 基于C++和Java的分析及解法，动态规划

2016-05-15 21:05:31

#### Pascal's Triangle -- LeetCode

2014-04-10 00:56:26

#### Triangle Count算法

2015-12-08 19:54:27

#### 【LeetCode-119】 Pascal's Triangle II(C++)

2016-09-08 11:34:45

#### Java program

2013年12月02日 749B 下载

#### 关于TRIANGLE二维三角网格生成器在windows下的配置说明

2014-06-18 21:21:09

#### Heron and His Triangle（HDU 6222 找规律+大数）

2017-12-02 17:42:44

#### 【leetcode】Pascal's Triangle II (python)

2014-07-28 20:27:22

#### Triangle源程序

2015-03-07 22:24:59

triangle