码迷,mamicode.com
首页 >  
搜索关键字:pascals triangle ii    ( 7733个结果
Codeforces Round #195 (Div. 2) A. Vasily the Bear and Triangle
水题,注意数据范围即可#include #include #include using namespace std;typedef pair Point;int main(){ int x,y; cin >> x >>y; Point a,b; if((x>0 && y > ...
分类:其他好文   时间:2014-06-16 10:47:47    阅读次数:226
[leetcode]Remove Duplicates from Sorted List II @ Python
原题地址:https://oj.leetcode.com/problems/remove-duplicates-from-sorted-list-ii/题意:Given a sorted linked list, delete all nodes that have duplicate number...
分类:编程语言   时间:2014-06-16 10:40:35    阅读次数:340
[leetcode]Search in Rotated Sorted Array II @ Python
原题地址:https://oj.leetcode.com/problems/search-in-rotated-sorted-array-ii/题意:Follow up for "Search in Rotated Sorted Array":What ifduplicatesare allowed...
分类:编程语言   时间:2014-06-16 08:20:54    阅读次数:307
[leetcode]Jump Game II @ Python
原题地址:https://oj.leetcode.com/problems/jump-game-ii/题意:Given an array of non-negative integers, you are initially positioned at the first index of the ...
分类:编程语言   时间:2014-06-12 17:38:49    阅读次数:323
Leetcode:Reverse Linked List II 反转链表区间
Reverse Linked List IIReverse a linked list from positionmton. Do it in-place and in one-pass.For example:Given 1->2->3->4->5->NULL, m= 2 andn= 4,retu...
分类:其他好文   时间:2014-06-12 07:03:54    阅读次数:308
[LeetCode] Remove Duplicates from Sorted Array II [27]
移除数组中重复次数超过2次以上出现的数,但是可以允许重复2次。 这个题类似Remove Duplicates from Sorted Array,第一个想法很直接就是计数,超过2次的就忽略,依据这个思路的代码见代码一; 上面的思路可行,但是代码看着比较冗余,判断比较多。再来想想原来的数组,该数组是排好序的,如果一个数出现3次以上,那么必有A[i] == A[i-2]。所以根据这个关系可以写出比较精简的代码二。详见代码。...
分类:其他好文   时间:2014-06-10 19:18:39    阅读次数:250
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!