Palindrome Partitioning IIGiven a strings, cutsinto some substrings such that every substring is a palindrome.Return the minimum cuts needed for a pal...
分类:
其他好文 时间:
2015-11-11 06:21:31
阅读次数:
344
Given a strings1, we may represent it as a binary tree by partitioning it to two non-empty substrings recursively.Below is one possible representation...
分类:
其他好文 时间:
2015-10-30 20:12:45
阅读次数:
207
Given a strings, cutsinto some substrings such that every substring is a palindrome.Return the minimum cuts needed for a palindrome partitioning ofs.E...
分类:
其他好文 时间:
2015-10-09 11:39:04
阅读次数:
240
Problem:Given a strings1, we may represent it as a binary tree by partitioning it to two non-empty substrings recursively.Below is one possible repres...
分类:
其他好文 时间:
2015-09-20 23:51:57
阅读次数:
257
给定一个字符串,求不相同的子串的个数。假如给字符串“ABA";排列的子串可能:A B AAB BAABA 共3*(3+1)/2=6种;后缀数组表示时:AABABA对于A和AB height[i]=1;表明一个长度公共,所以ABA中多出现了A这个子串,所以6-1=5;...
分类:
编程语言 时间:
2015-09-12 14:45:06
阅读次数:
168
比赛的时候一直往离线+数据结构上想 sigh,不过最后正解中也的确带有 "离线处理"------------------------------------------------------------------------------------------------------------...
分类:
其他好文 时间:
2015-09-06 08:32:43
阅读次数:
215
题目大意:RT分析:练手题目....后缀数组确实很强大.....多理解height数组, 切勿使用模版,后缀数组本身就有很多细节,多犯错更有利理解这个算法。代码如下:===================================================================...
分类:
其他好文 时间:
2015-09-04 18:22:14
阅读次数:
174
Given a string, find the length of the longest substring without repeating characters. For example, the longest substring without repeating letters fo...
分类:
其他好文 时间:
2015-09-03 01:52:10
阅读次数:
287
1.题目描述:点击打开链接
2.解题思路:本题利用dp解决。不过这个dp的思路的确比太容易想到。需要观察规律才能发现。我们可以从贡献值的角度考虑。以题目中给的样例来说明这种方法。
通过观察相邻两个w值,我们会发现一个事实:每个大区间都包含了小区间的解(这里的解即原题中的sum值)。但是这...
分类:
其他好文 时间:
2015-08-30 14:23:31
阅读次数:
153
1093. Count PAT's (25)时间限制120 ms内存限制65536 kB代码长度限制16000 B判题程序Standard作者CAO, PengThe stringAPPAPTcontains twoPAT's as substrings. The first one is form...
分类:
其他好文 时间:
2015-08-27 02:12:40
阅读次数:
134