码迷,mamicode.com
首页 >  
搜索关键字:pascals triangle pas    ( 2128个结果
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 fo...
分类:其他好文   时间:2014-11-08 09:15:14    阅读次数:187
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 fol...
分类:其他好文   时间:2014-11-06 17:19:34    阅读次数:189
Pascal's Triangle II
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
Pascal's Triangle
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
Delphi 设计模式:《HeadFirst设计模式》Delphi7代码---状态模式[转]
{没有应用状态模式的代码}//工程文件program Project1;{$APPTYPE CONSOLE}uses uGumballMachine in 'uGumballMachine.pas';var aGumballMachine: TGumballMachine;begin aGumbal...
分类:Windows程序   时间:2014-11-05 14:40:01    阅读次数:283
【jsp 练习】 给定三角形三边判断是否能组成三角形及计算面积
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
[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 following triangle [ [2], ...
分类:其他好文   时间:2014-11-04 19:41:37    阅读次数:205
【二分图】【最大匹配】【匈牙利算法】洛谷 P2071 座位安排 seat.cpp/c/pas
∵每个座位可以坐俩人,所以拆点最大匹配。 1 #include 2 #include 3 #include 4 using namespace std; 5 #define N 2001 6 vectorG[N::iterator ITER; 8 int mat[N<<2]; 9 bool vis[...
分类:编程语言   时间:2014-11-04 19:32:32    阅读次数:305
string 字符串函数
首部 function SameText(const S1, S2: string): Boolean; $[SysUtils.pas功能 返回两个字符串是否相等说明 不区分大小写参考 例子 CheckBox1.Checked := SameText(Edit1.Text, Edit2.Text);...
分类:其他好文   时间:2014-11-03 14:29:58    阅读次数:171
leetcode-pascal triangle I&&II
对于第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
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!