Pascal's Triangle:GivennumRows, generate the firstnumRowsof Pascal's triangle.For example, givennumRows= 5,Return[ [1], [1,1], [1,2,1], [1,3...
分类:
编程语言 时间:
2015-01-08 07:02:25
阅读次数:
225
TriangleGiven a triangle, find the minimum path sum from top to bottom. Each step you may move to adjacent numbers on the row below.For example, given...
分类:
编程语言 时间:
2015-01-07 23:20:51
阅读次数:
267
https://oj.leetcode.com/problems/pascals-triangle/http://blog.csdn.net/linhuanmars/article/details/23311527publicclassSolution{
publicList<List<Integer>>generate(intnumRows){
List<List<Integer>>toReturn=newArrayList<>();
if(nu..
分类:
其他好文 时间:
2015-01-06 18:15:51
阅读次数:
126
https://oj.leetcode.com/problems/pascals-triangle-ii/http://blog.csdn.net/linhuanmars/article/details/23311629publicclassSolution{
publicList<Integer>getRow(introwIndex)
{
//SolutionA:
//returngetRow_OKSpace(rowIndex);
//SolutionB:
returngetRow_Extra..
分类:
其他好文 时间:
2015-01-06 18:15:30
阅读次数:
117
https://oj.leetcode.com/problems/triangle/http://blog.csdn.net/linhuanmars/article/details/23230657publicclassSolution{
publicintminimumTotal(List<List<Integer>>triangle)
{
//SolutionA:
//returnminimumTotal_MaintainSums(triangle);
//SolutionB:..
分类:
其他好文 时间:
2015-01-06 18:12:52
阅读次数:
152
Given an index k, return the kth row of the Pascal's triangle.
For example, given k = 3,
Return [1,3,3,1].
Note:
Could you optimize your algorithm to use only O(k) extra space?
与Pascal's Tr...
分类:
其他好文 时间:
2015-01-04 17:18:04
阅读次数:
169
Given a triangle, find the minimum path sum from top to bottom. Each step you may move to adjacent numbers on the row below.
For example, given the following triangle
[
[2],
[3,4],
[...
分类:
其他好文 时间:
2015-01-04 17:09:16
阅读次数:
125
1914: [Usaco2010 OPen]Triangle Counting 数三角形Time Limit: 10 SecMemory Limit: 64 MBSubmit: 272Solved: 143[Submit][Status]Description在一只大灰狼偷偷潜入Farmer Don...
分类:
其他好文 时间:
2015-01-04 16:51:02
阅读次数:
159
Given numRows, generate the first numRows of Pascal's triangle.
For example, given numRows = 5,
Return
[
[1],
[1,1],
[1,2,1],
[1,3,3,1],
[1,4,6,4,1]
]
Pascal的每一层以1开始和结束 并且自第二位起 其值...
分类:
其他好文 时间:
2015-01-04 15:21:19
阅读次数:
111
经典的DP问题,DP思想也很直接:直接贴代码: 1 #include 2 #include 3 #include 4 #include 5 using namespace std; 6 const int max_size=1001; 7 int n, a[max_size][max_size]; ...
分类:
其他好文 时间:
2015-01-01 19:44:21
阅读次数:
224