码迷,mamicode.com
首页 >  
搜索关键字:pascals triangle ii    ( 7733个结果
UVA LIVE-4413 - Triangle Hazard
给个图,告诉R,P,Q三点的坐标,求出A,B,C三点的坐标 我的做法: 根据梅涅劳斯定理列出三个二元一次方程组,求出pb,qc,ra的长度,然后用点位移求出A,B,C三点的坐标即可 我的代码: #include #include #include #include #include #include #include #include #include #inclu...
分类:其他好文   时间:2014-09-16 12:38:10    阅读次数:274
Colidity--Triangle
判断数组中是否存在满足形成三角形的条件的三个数。判断连续相邻的三个数即可;可以证明当步相邻的时候存在的的话,那么就一定会有一组相邻的是满足的。 1 // you can use includes, for example: 2 #include 3 4 // you can write to s.....
分类:其他好文   时间:2014-09-16 12:11:50    阅读次数:218
Unique Paths II <leetcode>
Follow up for "Unique Paths":Now consider if some obstacles are added to the grids. How many unique paths would there be?An obstacle and empty space i...
分类:其他好文   时间:2014-09-16 10:38:30    阅读次数:236
Jump Game II (leetcode) DP的两种思路
第一种思路是: dp(i):到位置i所需要的最少步数 dp(i)一定是递增的,所以从j=A[i]开始(从最远的位置开始),更新数组直到dp(j+i) 如果去掉,会TLE int jump(int A[], int n) { int* dp = new int[n];//dp[i]到i所需的最小步数 memset(dp, 0x3f, sizeof(int)...
分类:其他好文   时间:2014-09-16 01:38:29    阅读次数:241
Permutations II [leetcode]
防止产生重复的排列字串,即在排列时不会重复的交换 第一种思路是在递归函数中用set检查当前交换的数字是否已经换过, 如{0,1,0,2}中start=0时: 交换num[0]和num[0],并产生start=1的子排列 交换num[0]和num[1],并产生start=1的子排列 交换num[0]和num[2],并产生start=1的子排列(产生重复) 交换num[0]和n...
分类:其他好文   时间:2014-09-16 00:20:19    阅读次数:228
HDU 1002-A + B Problem II(大数类)
A + B Problem II Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 215173    Accepted Submission(s): 41521 Problem Description I have...
分类:其他好文   时间:2014-09-15 22:54:26    阅读次数:194
Exercise 1.11---1.12 Pascal's Triangle
1.11 F'ibonates函数的变种,略过。1.12题目:The following pattern of numbers is called Pascal's triangle. 1 1 1 1 2 1 1 3 3 11 4 6 4 1.......
分类:其他好文   时间:2014-09-15 17:25:09    阅读次数:227
Remove Duplicates from Sorted List II
[leetcode]Remove Duplicates from Sorted List II...
分类:其他好文   时间:2014-09-15 11:22:01    阅读次数:192
Week2(9月19日):我要加一些例子来说明
Part I:提问===========================Part II:Ch02 从零开始实例学习2===========================要点:
分类:其他好文   时间:2014-09-15 11:13:08    阅读次数:179
[LeetCode] Reverse Linked List II @ Python
原题地址:https://oj.leetcode.com/problems/reverse-linked-list-ii/题意:Reverse a linked list from positionmton. Do it in-place and in one-pass.For example:Gi...
分类:编程语言   时间:2014-09-14 23:38:47    阅读次数:239
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!