经典题目,杨辉三角,输入行数,生成杨辉三角的数组...
分类:
其他好文 时间:
2014-10-24 16:42:49
阅读次数:
176
The number of steps
Time Limit: 1000ms Memory limit: 65536K 有疑问?点这里^_^
题目描述
Mary stands in a strange maze, the maze looks like a triangle(the first layer have one room,the ...
分类:
其他好文 时间:
2014-10-22 20:22:52
阅读次数:
235
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-21 19:38:03
阅读次数:
251
杨辉三角,分别求前n行和第n行。
【求杨辉三角前n行】
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,...
分类:
其他好文 时间:
2014-10-20 19:32:35
阅读次数:
190
Delta-wave
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)
Total Submission(s): 5782 Accepted Submission(s): 2204
Problem Description
A triangle fiel...
分类:
其他好文 时间:
2014-10-19 18:43:34
阅读次数:
213
大模拟:枚举6个方向,检查每个0能否移动
Puzzle
Time Limit: 2 Seconds Memory Limit: 65536 KB
Little Georgie likes puzzles very much. Recently he has found a wooden triangle in the box with old toys. The...
分类:
其他好文 时间:
2014-10-18 18:25:06
阅读次数:
311
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-10-18 05:23:21
阅读次数:
275
1、将tri初始化为[1],当rowIndex=0时,return的结果是:1,而题目要求应该是:[1],故将tri初始化为[[1]],返回结果设置为tri[0]即可满足要求;2、最开始第二层循环是从1到i进行遍历,这样就不好控制数据的更新,因为更新第j个数据要用到原tri行的第j-1个数据,而此时...
分类:
其他好文 时间:
2014-10-17 21:55:39
阅读次数:
264