码迷,mamicode.com
首页 >  
搜索关键字:pascals triangle ii    ( 7733个结果
Unique Paths II
这题在Unique Paths的基础上增加了一些obstacle的位置,应该说增加的难度不大,但是写的时候对细节的要求多了很多,比如,第一列的初始化会受到之前行的第一列的结果的制约。另外对第一行的初始化,也要分if else赋值。很容易出现初始化不正确的情况。 代码: class Solut...
分类:其他好文   时间:2014-07-24 05:06:08    阅读次数:221
C# in Depth Third Edition 学习笔记-- 值类型和引用
I. C#中值类型和引用类型1. 类class 引用类型,结构struct值类型2. 数组是引用类型,即使元素是值类型,int[]是引用类型3. 枚举是值类型enum4. 委托类型delegate是引用类型5. 接口类型interface是引用类型,但可以由值类型实现。II. 值的表达式:表达式“2...
分类:其他好文   时间:2014-07-23 22:12:37    阅读次数:265
LeetCode_51totalNQueens [N-Queens II]
#pragma warning(disable:4996) #include <Windows.h> #include <tchar.h> #include <cstdio> /* submit time : 1 request : Follow up for N-Queens problem. Now, instead outputting board configura...
分类:其他好文   时间:2014-07-23 18:13:56    阅读次数:284
HDU 4513 吉哥系列故事——完美队形II manacher求最长回文
题目来源:吉哥系列故事——完美队形II 题意:中文 思路:在manacher算法向两边扩展的时候加判断 保证非严格递减就行了 #include #include #include using namespace std; const int maxn = 100110; int a[maxn<<1]; int b[maxn<<1]; int dp[maxn<<1]; int manac...
分类:其他好文   时间:2014-07-23 17:18:54    阅读次数:381
[不明觉厉] 下一个排列
函数实现原理如下:在当前序列中,从尾端往前寻找两个相邻元素,前一个记为*i,后一个记为*ii,并且满足*i =0;i--) { if(num[i]=0;i--) { if(num[i]>num[p]) break; ...
分类:其他好文   时间:2014-07-23 16:14:51    阅读次数:171
Linked List Cycle leetcode II java (寻找链表环的入口)
题目:Given a linked list, return the node where the cycle begins. If there is no cycle, return null.Follow up:Can you solve it without using extra spac....
分类:编程语言   时间:2014-07-23 12:02:46    阅读次数:304
Linked List Cycle leetcode java (链表检测环)
题目:Given a linked list, determine if it has a cycle in it.Follow up:Can you solve it without using extra space?题解:这道题连带着II是很经典的,在看CC150时候,纠结这个问题纠结了很久....
分类:编程语言   时间:2014-07-23 12:02:26    阅读次数:311
Remove Duplicates from Sorted List II leetcode java
题目:Given a sorted linked list, delete all nodes that have duplicate numbers, leaving only distinct numbers from the original list.For example,Given 1....
分类:编程语言   时间:2014-07-23 12:01:46    阅读次数:312
【LeetCode】Single Number II
题目 Given an array of integers, every element appears three times except for one. Find that single one. Note: Your algorithm should have a linear runtime complexity. Could you implement it wit...
分类:其他好文   时间:2014-07-23 00:13:17    阅读次数:331
【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-07-22 22:40:36    阅读次数:238
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!