码迷,mamicode.com
首页 >  
搜索关键字:longest substring wi    ( 8067个结果
Manacher处理回文的方法
这里,我介绍一下O(n)回文串处理的一种方法。Manacher算法.原文地址:http://zhuhongcheng.wordpress.com/2009/08/02/a-simple-linear-time-algorithm-for-finding-longest-palindrome-sub-...
分类:其他好文   时间:2014-11-26 18:38:27    阅读次数:167
[leetcode]Longest Substring with At Most Two Distinct Characters
很明显的2 pointer问题。。。当满足条件的时候后面的指针加,不满足条件的时候前面的指针加,直到满足条件。。。class Solution {public: int lengthOfLongestSubstringTwoDistinct(string s) { int sta...
分类:其他好文   时间:2014-11-26 16:10:45    阅读次数:336
c# asp.net 生成唯一订单号
c# asp.net 生成唯一订单号string OrderNo = DateTime.Now.Year.ToString().Substring(2, 2) + DateTime.Now.Month.ToString().PadLeft(2, '0') + DateTime.Now.Day.ToS...
分类:Windows程序   时间:2014-11-26 15:47:54    阅读次数:225
字符串中字符右移
var value=0.041991;//04.1991 var value_str; if(String(value).length>8){ value_str=String(value).substring(0,8); }else{ value_str=String(value); } var temp_str = {str: value_str, startIndex: 1...
分类:其他好文   时间:2014-11-26 14:29:38    阅读次数:172
Leetcode-Substring with Concatenation of All Words
You are given a string, S, and a list of words, L, that are all of the same length. Find all starting indices of substring(s) in S that is a concatena...
分类:其他好文   时间:2014-11-26 10:56:13    阅读次数:182
nyoj-914-Yougth的最大化
http://acm.nyist.net/JudgeOnline/problem.php?pid=914Yougth的最大化时间限制:1000ms | 内存限制:65535KB难度:4描述Yougth现在有n个物品的重量和价值分别是Wi和Vi,你能帮他从中选出k个物品使得单位重量的价值最大吗?输入有...
分类:其他好文   时间:2014-11-25 23:06:37    阅读次数:292
【LeetCode】Palindrome Partitioning
Palindrome PartitioningGiven a strings, partitionssuch that every substring of the partition is a palindrome.Return all possible palindrome partitioni...
分类:其他好文   时间:2014-11-25 22:48:55    阅读次数:241
javascript知识点小节
1.类型转换:parseInt\parseFloat\Number\==2.本地对象的方法:String:concat\split\substring\substr\match\replaceNumber:toFixedArray:concat\join\slice\spliceRegExp:exe...
分类:编程语言   时间:2014-11-25 20:33:08    阅读次数:259
jstl
1 选择分支 0.00 ${royalties } 2 判断 在线 离线 3. 三目运算 ${fn:length(pr.req_remark)>21 ? fn:substring(pr.req_remark,0,21) : pr.req_rem...
分类:Web程序   时间:2014-11-25 17:50:58    阅读次数:199
【枚举】【最小生成树】【kruscal】bzoj3754 Tree之最小方差树
发现,若使方差最小,则使Σ(wi-平均数)最小即可。因为权值的范围很小,所以我们可以枚举这个平均数,每次把边权赋成(wi-平均数)2,做kruscal。但是,我们怎么知道枚举出来的平均数是不是恰好是我们的这n-1条边的呢? 就在更新答案的时候加个特判就行了。 1 #include 2 #includ...
分类:其他好文   时间:2014-11-25 13:58:02    阅读次数:180
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!