码迷,mamicode.com
首页 >  
搜索关键字:pascals triangle    ( 1342个结果
pku ppt some problem
The Triangle http://poj.org/problem?id=1163暴力dfs的话,每个节点有两条路可以走,那么n个节点复杂度就是2^n n=100 超时 dp来做 就优化成 n^2记忆化搜索,就能优化成n^2 因为一个点最多算一次,以后会直接返回dp i j 。 dp i j ....
分类:其他好文   时间:2014-09-14 11:19:27    阅读次数:185
【LeetCode】【Python题解】Pascal's Triangle
仅用一行实现!...
分类:编程语言   时间:2014-09-14 00:09:26    阅读次数:249
UVA - 11186-Circum Triangle
有个以坐标原点为圆心的圆,给出圆上的点的关于x轴的夹角,以及圆的半径,求圆上点所能构成的三角形的面积和 我的做法: 先算出每个点的坐标,枚举所有三个点的组合,叉积求面积 我的代码: #include #include #include #include #include #include #include #include #include #include usi...
分类:其他好文   时间:2014-09-12 22:12:14    阅读次数:235
UVA 11178 Morley’s Theorem(莫雷定理 计算几何)
Morley’s Theorem Input: Standard Input Output: Standard Output  Morley’s theorem states that that the lines trisecting the angles of an arbitrary plane triangle meet at the vertices of an equilat...
分类:其他好文   时间:2014-09-12 15:07:13    阅读次数:184
Leetcode dfs&dp Triangle
Triangle  Total Accepted: 17536 Total Submissions: 65508My Submissions Given a triangle, find the minimum path sum from top to bottom. Each step you may move to adjacent numbers on the row...
分类:其他好文   时间:2014-09-11 07:42:01    阅读次数:194
[LeetCode] Pascal's Triangle II
1 public class Solution { 2 public List getRow(int rowIndex) { 3 List result = new ArrayList(); 4 for (int i=0; i=0; j--) { 6 ...
分类:其他好文   时间:2014-09-10 21:02:51    阅读次数:180
Pascal's Triangle II <leetcode>
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-09-09 15:07:48    阅读次数:167
leetcode 之 Triangle
Triangle...
分类:其他好文   时间:2014-09-09 13:20:38    阅读次数:144
Triangle
[leetcode]Triangle...
分类:其他好文   时间:2014-09-09 12:46:58    阅读次数:161
Pascal's Triangle II
[leetcode]Pascal's Triangle II...
分类:其他好文   时间:2014-09-09 12:45:05    阅读次数:118
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!