```
class Solution {
public:
int minimumTotal(vector<vector<int> > &triangle) {
int cur=triangle.size()-2;
for(;cur>=0;cur--)
for(int i=0;i<=cur;i++)
triangle[cur][i]=min(triangle[cur+1][i],triangle[cur+1][i+1])+triangle[cur][i];
return triangle[0][0];
}
};
```