码迷,mamicode.com
首页 >  
搜索关键字:pascals triangle ii    ( 7733个结果
leetcode第一刷_Linked List Cycle II
这道题稍微有点意思,知道答案发现,呀,这么简单就能做啊。我一开始想的是,相遇之后用另一个指针怎么走,然后满足什么关系之后能推出来,其实不用这么麻烦。是很简单的数学关系,我画个图说一下。 S1代表的是链表进入环之前的长度,a代表当两个指针相遇时,走一步的指针在环里走的长度,S2代表的是环的周长,那么根据条件,相遇时,走两步的指针走的距离是走一步的两倍,我们得到公式: (S1+a)*2 =...
分类:其他好文   时间:2014-05-10 10:29:57    阅读次数:364
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 fol...
分类:其他好文   时间:2014-05-08 21:08:25    阅读次数:407
fzu 2171 线段树 lazy标记
http://acm.fzu.edu.cn/problem.php?pid=2171 Problem 2171 防守阵地 II Accept: 73Submit: 256Time Limit: 3000 mSecMemory Limit :...
分类:其他好文   时间:2014-05-07 18:41:12    阅读次数:440
leetcode第一刷_ Palindrome Partitioning II
这道题还挺复杂的,回来看了好一会儿才想起当时怎么想的。。上道题刚说不要打表,这道题就用了打表。。 总的思路是这样的,从后面往前面打表,最后一个位置的最小分割一定是0,那往前呢,如果当前考虑的位置是start,并且substr(s, i)是回文的,那么如果已知i+1开始的分割次数,那么start这个位置的分割应该就是start原来的和i+1开始的分割次数加1之间的最小值。DP的思想,很直接。 但...
分类:其他好文   时间:2014-05-07 07:37:39    阅读次数:307
Codechef Not a Triangle题解
找出一个数组中的三个数,三个数不能组成三角形。 三个数不能组成三角形的条件是:a + b 两边和小于第三边。 这个问题属于三个数的组合问题了。暴力法可解,但是时间效率就是O(n*n*n)了,很慢。 不过既然是组合问题就必定可以使用排序后处理的方法降低时间效率的。 这里降低时间效率的方法是: 选一个最大的数c,然后选两个小数a和b,其中a 这样可以把时间效率降到O(n*n)...
分类:其他好文   时间:2014-05-07 06:32:23    阅读次数:289
[2013山东ACM省赛] The number of steps (概率DP,数学期望)
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 seco...
分类:其他好文   时间:2014-05-07 06:15:59    阅读次数:427
[问题2014S11] 复旦高等代数II(13级)每周一题(第十一教学周)
[问题2014S11] 设 \(A,B\) 为 \(n\) 阶实对称阵, \(p(A),p(B),p(A+B)\) 分别为 \(A,B,A+B\) 的正惯性指数, 证明: \[p(A+B)\leq p(A)+p(B).\]
分类:其他好文   时间:2014-05-03 23:22:18    阅读次数:256
POJ 1673 三角形垂心
EXOCENTER OF A TRIANGLE Time Limit: 1000MS   Memory Limit: 10000K Total Submissions: 3209   Accepted: 1259 Description Given a triangle ABC, the Extriangles of ABC are cons...
分类:其他好文   时间:2014-05-03 21:14:28    阅读次数:340
JBPM学习(六):详解流程图
概念: 流程图的组成: a. 活动 Activity / 节点 Node b. 流转 Transition / 连线(单向箭头) c. 事件   1.流转(Transition) a) 一般情况一个活动中可以指定一个或多个Transition i. 开始活动(Start)中只能有一个Transition。 ii. 结束活动(End)中没有Transitio...
分类:其他好文   时间:2014-05-03 20:53:19    阅读次数:311
codechef Sums in a Triangle题解
Let's consider a triangle of numbers in which a number appears in the first line, two numbers appear in the second line, three in the third line, etc. Develop a program which will compute the largest ...
分类:其他好文   时间:2014-05-03 17:32:22    阅读次数:284
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!