【SPOJ】Substrings(后缀自动机) 题面 "Vjudge" 题意:给定一个长度为$len$的串,求出长度为1~len的子串中,出现最多的出现了多少次 题解 出现次数很好处理,就是$right/endpos$集合的大小 那么,直接构建$SAM$ 求出每个位置的$right$集合大小 直接更 ...
分类:
其他好文 时间:
2018-02-13 13:27:14
阅读次数:
147
Given a string, your task is to count how many palindromic substrings in this string. The substrings with different start indexes or end indexes are c ...
分类:
其他好文 时间:
2018-02-10 17:02:42
阅读次数:
119
The string APPAPT contains two PAT's as substrings. The first one is formed by the 2nd, the 4th, and the 6th characters, and the second one is formed ...
分类:
其他好文 时间:
2018-02-01 00:16:57
阅读次数:
174
Given a string, your task is to count how many palindromic substrings in this string. The substrings with different start indexes or end indexes are c ...
分类:
其他好文 时间:
2018-01-30 16:21:58
阅读次数:
175
Given a string, your task is to count how many palindromic substrings in this string. The substrings with different start indexes or end indexes are c ...
分类:
其他好文 时间:
2018-01-20 16:25:02
阅读次数:
157
题意是求一个字符串每个长度的子串出现次数最多的那个出现了多少次,也就是求每个到根的最长路的right集合最大值 。 先建后缀自动机,然后将每个前缀所在的集合的初值设为1,因为所有前缀的right集合肯定不相同,而且它们包含了所有位置。 接下来按到根的最长距离从大到小排序,将right集合累加到par ...
分类:
其他好文 时间:
2018-01-19 18:47:38
阅读次数:
213
Give a string s, count the number of non-empty (contiguous) substrings that have the same number of 0's and 1's, and all the 0's and all the 1's in th ...
分类:
其他好文 时间:
2018-01-13 20:59:17
阅读次数:
177
You are given a string S which consists of 250000 lowercase latin letters at most. We define F(x) as the maximal number of times that some string with ...
分类:
其他好文 时间:
2018-01-11 20:27:39
阅读次数:
155
不相同子串个数。 参考那篇论文。 cpp include include include using namespace std; int n, m, p, x[1005], y[1005], c[1005], sa[1005], rnk[1005], hei[1005]; int ans, T; ...
分类:
其他好文 时间:
2018-01-11 11:32:13
阅读次数:
143
【CF316G3】Good Substrings 题意:给出n个限制(p,l,r),我们称一个字符串满足一个限制当且仅当这个字符串在p中的出现次数在[l,r]之间。现在想问你S的所有本质不同的子串中,有多少个满足所有限制。 |S|,|p|<=10^5,n<=10。 题解:比较简单的后缀自动机题,我们 ...
分类:
其他好文 时间:
2017-12-31 13:35:25
阅读次数:
114