码迷,mamicode.com
首页 >  
搜索关键字:pascals triangle    ( 1342个结果
Leetcode[119]-Pascal's Triangle II
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?分析:通过递归设置vector的值,变量i表示当前...
分类:其他好文   时间:2015-06-09 13:51:09    阅读次数:96
LeetCode之“动态规划”:Triangle
题目链接 题目要求: 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 exam...
分类:其他好文   时间:2015-06-09 13:25:22    阅读次数:102
Leetcode[118]-Pascal's Triangle
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] ]分析: 第j=0列全为1,第j==i列时,都为1 其它列 a[2][1]...
分类:其他好文   时间:2015-06-09 10:06:02    阅读次数:132
Pascal's Triangle I,II
题目来自于Leetcode https://leetcode.com/problems/pascals-triangle/ Given numRows, generate the first numRows of Pascal's triangle. For example, given numRows = 5, Return [ [1], [1,1],...
分类:其他好文   时间:2015-06-09 00:57:01    阅读次数:158
【Pascal's Triangle】cpp
题目: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...
分类:其他好文   时间:2015-06-09 00:51:13    阅读次数:122
【Pascal's Triangle II 】cpp
题目: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 onl...
分类:其他好文   时间:2015-06-09 00:45:04    阅读次数:115
Pascal's Triangle II 杨辉三角
1 class Solution { 2 public: 3 vector getRow(int rowIndex) { 4 vector> tri; 5 if(rowIndex==0) 6 { 7 vector c;...
分类:其他好文   时间:2015-06-08 23:09:21    阅读次数:133
【LeetCode】Triangle 解决报告
【称号】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...
分类:其他好文   时间:2015-06-08 19:07:41    阅读次数:85
POJ 2954-Triangle(计算几何+皮克定理)
题目地址:POJ 2954 题意:给出三角形的三个顶点,求内部格点的个数。 思路:形同POJ 1265。 #include #include #include #include #include #include #include #include #include #include #include using namespace std; typedef long ...
分类:其他好文   时间:2015-06-08 14:59:03    阅读次数:91
poj1163The Triangle(简单DP)
转载请注明出处:viewmode=contents">http://blog.csdn.net/u012860063?viewmode=contents题目链接:http://poj.org/problem?id=1163---------------------------------------...
分类:其他好文   时间:2015-06-08 13:22:28    阅读次数:110
1342条   上一页 1 ... 82 83 84 85 86 ... 135 下一页
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!