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-07-06 13:57:54
阅读次数:
155
题目大意:
问的是m个字符串里,都出现过的子串。子串也可以出现在这个串的逆序串中。
思路分析:
居然wa在全5个 “a” 的数据上。
二分的时候下界不能为0。。
思路大致上是把原串和逆序串全部处理出来,放入str中,然后在每个串中间加一个没有出现过的。
此处注意输入不仅仅是字母。
然后跑一遍后缀数组。
然后用标记计数就好了。
#include
#include ...
分类:
其他好文 时间:
2014-07-06 10:07:36
阅读次数:
202
SPOJ Problem Set (classical)
694. Distinct Substrings
Problem code: DISUBSTR
Given a string, we need to find the total number of its distinct substrings.
Input
T- number of ...
分类:
其他好文 时间:
2014-07-03 16:32:42
阅读次数:
212
Given a string s1, we may represent it as a binary tree by partitioning it to two non-empty substrings recursively.
分类:
其他好文 时间:
2014-07-02 10:03:09
阅读次数:
175
UVA 12718 Dromicpalin Substrings(寻找字符串连续子串的回文)...
分类:
其他好文 时间:
2014-07-02 09:45:05
阅读次数:
214
题目大意:
求串中不同的子串的个数。
思路分析:
子串一定是某一个后缀的前缀。
所以我们把每一个后缀拿出来,分析它有多少个前缀,然后除去它与sa数组中前面那个后缀相同的前缀。
最后也就是 ans = segma (n-sa[i] + height[i])....
#include
#include
#include
#include
#define maxn 1...
分类:
其他好文 时间:
2014-07-02 07:23:21
阅读次数:
182
题目
Given a string s1, we may represent it as a binary tree by partitioning it to two non-empty substrings recursively.
Below is one possible representation of s1 = "great":
great
/...
分类:
其他好文 时间:
2014-06-29 23:16:19
阅读次数:
312
给一个原串,以及那些字符是坏的,现在问你可以从原串中取出多少个不同子串,使得其所含的坏字符的个数不超过一个定数。这个题目网上有各种各样的解法。如hash,tire。我说一下我的解法。解法一:后缀自动机dp。f[][]保存到达某个状态,前面已经有的坏字符的个数的时候的字符串数量。这样按照拓扑序列一直递...
分类:
其他好文 时间:
2014-06-24 14:14:07
阅读次数:
169
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-06-04 20:11:38
阅读次数:
303
【题目】
Given a string s1, we may represent it as a binary tree by partitioning it to two non-empty substrings recursively.
Below is one possible representation of s1 = "great":
great
/ gr eat
/ \ / g r e at
/ ...
分类:
其他好文 时间:
2014-06-01 09:41:05
阅读次数:
196