Given an indexk, return thekthrow of the Pascal's triangle.For example, givenk= 3,Return[1,3,3,1].Note:Could you optimize your algorithm to use onlyO(...
分类:
其他好文 时间:
2014-11-06 16:41:45
阅读次数:
165
GivennumRows, generate the firstnumRowsof Pascal's triangle.For example, givennumRows= 5,Return[ [1], [1,1], [1,2,1], [1,3,3,1], [1,4,6,4,1]...
分类:
其他好文 时间:
2014-11-06 16:27:43
阅读次数:
182
Test.javapackage package1;public class Test { double side1 = -1 , side2 = -1 , side3 = -1 , area = -1; boolean triangle; public double ge...
分类:
Web程序 时间:
2014-11-05 09:11:13
阅读次数:
208
题目描述:
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],
...
分类:
其他好文 时间:
2014-11-04 19:41:37
阅读次数:
205
对于第2个pascal triangle,通过观察可以发现,其实只需要2个额外的变量来记录,于是就设了个tmp数组。整体有点DP问题中的滚动数组的感觉。 1 #include 2 #include 3 using namespace std; 4 5 class Solution { 6 pu...
分类:
其他好文 时间:
2014-11-02 17:48:31
阅读次数:
193
Area in Triangle
博客原文地址:
题目大意:...
分类:
其他好文 时间:
2014-11-02 15:04:45
阅读次数:
167
Given an indexk, return thekthrow of the Pascal's triangle.For example, givenk= 3,Return[1,3,3,1].Note:Could you optimize your algorithm to use onlyO(...
分类:
其他好文 时间:
2014-11-02 12:11:32
阅读次数:
138
GivennumRows, generate the firstnumRowsof Pascal's triangle.For example, givennumRows= 5,Return[ [1], [1,1], [1,2,1], [1,3,3,1], [1,4,6,4,1]...
分类:
其他好文 时间:
2014-11-02 07:04:34
阅读次数:
190
A n * m grid as follow:
Count the number of triangles, three of whose vertice must be grid-points.
Note that the three vertice of the triangle must not be in a line(the right picture is not a...
分类:
其他好文 时间:
2014-10-31 22:20:02
阅读次数:
264
Given an indexk, return thekthrow of the Pascal's triangle.For example, givenk= 3,Return[1,3,3,1].Note:Could you optimize your algorithm to use onlyO(...
分类:
其他好文 时间:
2014-10-31 08:47:11
阅读次数:
158