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
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
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
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
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
题目大意:给定一个字符串,问有多少字符串满足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
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 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
题目链接
题意:一个字符串如果形如UGU,的形式,G的长度为L,那么称这个字符串为L串,给定一个字符串,问这个字符串子串为g串的个数
思路:做这题前先做了POJ3693,有一个思想就是枚举长度分段,这样的话对于一个U长度为l的而言,只要在当前位置和当前位置之后(l + g)的位置分别向前向后找lcp,两个lcp加起来的长度...
分类:
其他好文 时间:
2014-08-23 20:24:21
阅读次数:
349