码迷,mamicode.com
首页 >  
搜索关键字:unique paths ii    ( 12050个结果
Leetcode | Longest Palindromic Substring
Given a string S, find the longest palindromic substring in S. You may assume that the maximum length of S is 1000, and there exists one unique longes...
分类:其他好文   时间:2014-05-16 21:15:37    阅读次数:454
lightoj 1427 - Substring Frequency (II) AC自动机
模板题,找来测代码。注意有相同单词//#pragma comment(linker, "/STACK:1024000000,1024000000")#include#include#include#include#include#include#include#include#include#inc...
分类:其他好文   时间:2014-05-16 05:45:11    阅读次数:403
leetcode第一刷_Unique Paths
从左上到右下,只能向右或向下,问一共有多少种走法。 这个问题当然可以用递归和dp来做,递归的问题是很可能会超时,dp的问题是需要额外空间。 其实没有其他限制条件的话,这个问题有个很简单的解法。给定一个格子,假设是m*n的,从左上角走到右下角的总步数是确定了的,(m+n-2)嘛,即在竖直方向一定要走m-1步,在水平方向一定要走n-1步。那有多少种解法就相当于确定什么时候往下走,什么时候往右走,也...
分类:其他好文   时间:2014-05-14 00:41:02    阅读次数:447
LeetCode---Remove Duplicates from Sorted List II
题目链接题意: 给出单链表的head指针, 要求去除链表中所有出现重复的元素, 如1->2->3->3->4->4->5, 返回1->2->5这题纠结了有两天, 重要的是把思路想清楚然后就可以痛苦的A掉, 不然老是会绕来绕去...我的大体思路是这样的: 使用三个指针 pre保存链表中前一个没有出现重...
分类:其他好文   时间:2014-05-13 18:54:51    阅读次数:237
c++ 名字粉碎(name mangling)
转自Ibm:Name mangling is the encoding of function and variable names into unique names so that linkers can separate common names in the language. Type n...
分类:编程语言   时间:2014-05-13 18:18:53    阅读次数:421
Leetcode 树 Unique Binary Search Trees
本文为senlie原创,转载请保留此地址:http://blog.csdn.net/zhengsenlie Unique Binary Search Trees  Total Accepted: 13478 Total Submissions: 37858 Given n, how many structurally unique BST's (bin...
分类:其他好文   时间:2014-05-13 15:21:22    阅读次数:291
Leetcode 贪心 Best Time to Buy and Sell StockII
本文为senlie原创,转载请保留此地址:http://blog.csdn.net/zhengsenlie Best Time to Buy and Sell Stock II  Total Accepted: 13030 Total Submissions: 36467 Say you have an array for which the ith ...
分类:其他好文   时间:2014-05-13 14:08:39    阅读次数:414
关联容器 — hash_set
容器hash_set是以hash table为底层机制的,几乎所有的操作都是转调用hash table提供的接口。由于插入无法存储相同的键值,所以hash_set的插入操作全部都使用hash table的insert_unique接口,代码如下: pair insert(const value_type& obj) { pair p = rep.insert_unique(obj); ...
分类:其他好文   时间:2014-05-13 06:33:44    阅读次数:303
python自定义查找文件内容
#!/usr/bin/envpython#coding:utf8#此脚本为查找递归目录下所有文件匹配的内容importos,sys,tabdefpaths(path):list_path=os.walk(path)all_file=[]forp,d,flinlist_path:forfinfl:pfile=os.path.join(p,f)ifos.path.isdir(pfile):paths(pfile)all_file.append(pfile)returnall..
分类:编程语言   时间:2014-05-13 03:49:34    阅读次数:426
数据库索引类型和引擎
数据库索引类型和引擎一、数据库索引1、索引的优缺点优点:能够加快查询速度(相当于书的目录)缺点:会降低插入、更新表的速度,需要占用磁盘存储空间2、索引的类型INDEX:普通索引UNIQUE:唯一索引FULLTEXT:全文索引PRIMARYKEY:主键FOREIGNKEY:外键*不同的索引有不同的作..
分类:数据库   时间:2014-05-13 00:52:56    阅读次数:1435
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!