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
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
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
{没有应用状态模式的代码}//工程文件program Project1;{$APPTYPE CONSOLE}uses uGumballMachine in 'uGumballMachine.pas';var aGumballMachine: TGumballMachine;begin aGumbal...
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
∵每个座位可以坐俩人,所以拆点最大匹配。 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
首部 function SameText(const S1, S2: string): Boolean; $[SysUtils.pas功能 返回两个字符串是否相等说明 不区分大小写参考 例子 CheckBox1.Checked := SameText(Edit1.Text, Edit2.Text);...
分类:
其他好文 时间:
2014-11-03 14:29:58
阅读次数:
171
对于第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