码迷,mamicode.com
首页 >  
搜索关键字:poj1226 substrings    ( 386个结果
HDU - 5008 Boring String Problem (后缀数组+二分+RMQ)
Problem Description In this problem, you are given a string s and q queries. For each query, you should answer that when all distinct substrings of string s were sorted lexicographically, which ...
分类:其他好文   时间:2014-10-03 16:56:54    阅读次数:249
bnu oj 34985 Elegant String (矩阵+dp)
Elegant String We define a kind of strings as elegant string: among all the substrings of an elegant string, none of them is a permutation of "0, 1,…, k". Let function(n, k) be the numbe...
分类:其他好文   时间:2014-09-30 18:43:49    阅读次数:248
[leetcode] Scramble String @python
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...
分类:编程语言   时间:2014-09-30 02:51:41    阅读次数:394
POJ - 3415 Common Substrings(后缀数组求长度不小于 k 的公共子串的个数+单调栈优化)
Description A substring of a string T is defined as: T( i, k)= TiTi+1... Ti+k-1, 1≤ i≤ i+k-1≤| T|. Given two strings A, B and one integer K, we define S, a set of triples (i, j, k): S = ...
分类:其他好文   时间:2014-09-29 14:38:51    阅读次数:277
POJ - 3693 Maximum repetition substring(后缀数组求重复次数最多的连续重复子串)
Description The repetition number of a string is defined as the maximum number R such that the string can be partitioned into R same consecutive substrings. For example, the repetition number of ...
分类:其他好文   时间:2014-09-28 19:34:34    阅读次数:417
uva 10829 - L-Gap Substrings(后缀数组)
题目链接:uva 10829 - L-Gap Substrings 题目大意:给定一个字符串,问有多少字符串满足UVU的形式,要求U非空,V的长度为g。 解题思路;对字符串的正序和逆序构建后缀数组,然后枚举U的长度l,每次以长度l分区间,在l和l+d+g所在的两个区间上确定U的最大长度。 #include #include #include #include using n...
分类:其他好文   时间:2014-09-05 23:53:42    阅读次数:387
[leecode]Scramble String
Scramble StringGiven a strings1, we may represent it as a binary tree by partitioning it to two non-empty substrings recursively.Below is one possible...
分类:其他好文   时间:2014-09-02 00:17:33    阅读次数:260
LeetCode: Scramble String
LeetCode: Scramble StringGiven a string s1, we may represent it as a binary tree by partitioning it to two non-empty substrings recursively.Below is o...
分类:其他好文   时间:2014-09-01 22:42:34    阅读次数:308
字符串 自己看看留个纪念而已
题目poj1226(可暴力,可后缀数组)//题意:给定n个串,求一个最大子串长度,//使得它或者它的逆向串在每个串中出现。 //思路:先求出最短的串sho[],然后枚举答案长度ans(len~1)。//于是sho[]就被分成了len-ans+1个子串pos[],//再分别求出这些字串的反串inv[]...
分类:其他好文   时间:2014-09-01 15:24:43    阅读次数:183
UVA 10829 - L-Gap Substrings(后缀数组)
UVA 10829 - L-Gap Substrings 题目链接 题意:一个字符串如果形如UGU,的形式,G的长度为L,那么称这个字符串为L串,给定一个字符串,问这个字符串子串为g串的个数 思路:做这题前先做了POJ3693,有一个思想就是枚举长度分段,这样的话对于一个U长度为l的而言,只要在当前位置和当前位置之后(l + g)的位置分别向前向后找lcp,两个lcp加起来的长度...
分类:其他好文   时间:2014-08-23 20:24:21    阅读次数:349
386条   上一页 1 ... 34 35 36 37 38 39 下一页
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!