
后缀数组
u010660276
这个作者很懒,什么都没留下…
展开
-
后缀数组hdu4961
Online JudgeOnline ExerciseOnline TeachingOnline ContestsExercise AuthorF.A.QHand In HandOnline AcmersForum | DiscussStatistical ChartsProblem ArchiveRealtime Judge Statu原创 2014-08-01 10:22:59 · 561 阅读 · 0 评论 -
Codeforces Round #244 (Div. 2)(强连通分量,后缀数组)
A. Police Recruits#include#include#include#includeusing namespace std;int n;int main(){ //freopen("in.txt","r",stdin); cin>>n; int ans=0,x,p=0; for(int i=0;i<n;i++) {原创 2014-05-23 20:08:33 · 868 阅读 · 0 评论 -
后缀数组poj1226
题意:求最长的公共子串,使她后者是他的翻转串在每个原创 2014-07-30 16:30:22 · 487 阅读 · 0 评论 -
后缀数组(出现两次的子串且不重叠)hdu3518
Online JudgeOnline ExerciseOnline TeachingOnline ContestsExercise AuthorF.A.QHand In HandOnline AcmersForum | DiscussStatistical ChartsProblem ArchiveRealtime Judge Statu原创 2014-07-31 22:11:16 · 647 阅读 · 0 评论 -
后缀数组(不同的回文字串)hdu3948
调了一上午终于调出来了,这都是什么错误,为什么原创 2014-07-06 11:21:13 · 731 阅读 · 0 评论 -
后缀数组(好)uva10829
L-Gap SubstringsOutput: Standard Output If a string is in the form UVU, where Uis not empty, andV has exactly L characters, we say UVUis anL-Gap string. For example, abcbabc is a 1-Gapstri原创 2014-09-14 21:52:19 · 965 阅读 · 1 评论 -
后缀数组(2014西安网络赛)hdu5008
Online JudgeOnline ExerciseOnline TeachingOnline ContestsExercise AuthorF.A.QHand In HandOnline AcmersForum | DiscussStatistical ChartsProblem ArchiveRealtime Judge Statu原创 2014-09-14 19:38:36 · 1124 阅读 · 0 评论 -
后缀数组+hash+hdu4029
Online JudgeOnline ExerciseOnline TeachingOnline ContestsExercise AuthorF.A.QHand In HandOnline AcmersForum | DiscussStatistical ChartsProblem ArchiveRealtime Judge Statu原创 2014-09-26 22:51:34 · 502 阅读 · 0 评论 -
后缀数组hdu4436(2012现场赛)
Online JudgeOnline ExerciseOnline TeachingOnline ContestsExercise AuthorF.A.QHand In HandOnline AcmersForum | DiscussStatistical ChartsProblem ArchiveRealtime Judge Statu原创 2014-08-03 14:05:15 · 544 阅读 · 0 评论 -
后缀数组(poj3729)
Language:DefaultFacer’s stringTime Limit: 3000MS Memory Limit: 65536KTotal Submissions: 1766 Accepted: 529DescriptionMinifacer was very happy these days原创 2015-01-06 18:49:26 · 481 阅读 · 0 评论 -
树链剖分+后缀数组CF504E
E. Misha and LCP on Treetime limit per test8 secondsmemory limit per test512 megabytesinputstandard inputoutputstandard outputMisha has a tree with characters written on转载 2015-02-05 21:54:03 · 505 阅读 · 0 评论 -
Codeforces Round #305 (Div. 1)E. Mike and Friends 后缀数组+RMQ+线段树
E. Mike and Friendstime limit per test3 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputWhat-The-Fatherland is a strange country! All pho原创 2015-05-29 14:29:49 · 859 阅读 · 0 评论 -
后缀数组+贪心+poj3623
Best Cow Line, GoldTime Limit: 5000MS Memory Limit: 65536KTotal Submissions: 4488 Accepted: 1664DescriptionFJ is about to take his N (1 ≤ N ≤ 30,000) cows to th原创 2014-07-30 13:36:34 · 591 阅读 · 0 评论 -
后缀数组poj2774(hdu1403)ural1517
思路:把两个串拼接起来然后求原创 2014-07-01 10:53:07 · 461 阅读 · 0 评论 -
KMP(后缀数组)uva11475
题意:给定一个串,只能在后面添加字符,使其成为一个回文串。思路:反转后求rev的next函数,然后与原串进行匹配,找到已经是回文的位置,输出#include#include#include#include#includeusing namespace std;const int maxn=100100;int next[maxn];string a,rev;void ge原创 2014-03-18 15:14:06 · 1002 阅读 · 0 评论 -
后缀数组(多个穿的最长公共子串)+KMP+poj3080
跟Life Forms很像原创 2014-07-10 22:34:28 · 633 阅读 · 0 评论 -
后缀数组(长度不小于k的公共子串的个数)
把两个串拼接起来,中间用神奇地‘$'字符隔开。然后用倍增算法求sa数组、rank数组、height数组,然后利用height数组统计第一个串称A串的所有后缀与第二个串B串的所有后缀所共有的长度大于k的子串。 上面的逻辑过程容易理解,用aa和aa就能推出为什么答案是5,子串a有2个,aa有1个,2*2 + 1*1 = 5.问题的关键是要找出各个子串总匹配数(子串相等称为匹配)。height数转载 2014-07-04 18:56:12 · 781 阅读 · 0 评论 -
后缀数组+LCP+多个串找公共子序列+uva11107
详见训练指南,需要注意的细节太多了#include#include#include#include#includeusing namespace std;const int MAXN=100010;int n;struct Suffix{ int s[MAXN],sa[MAXN]; int height[MAXN],rank[MAXN]; int c[原创 2014-02-24 20:56:33 · 595 阅读 · 0 评论 -
后缀数组(每个字符串至少出现两次且不重叠的最长子串)spoj220
调了一晚上死活没调出来,原创 2014-07-05 21:45:44 · 625 阅读 · 0 评论 -
后缀数组(最长回文字串)ural1297
也可以用KMP做具体参见原创 2014-07-03 17:32:06 · 475 阅读 · 0 评论 -
后缀数组+二分poj3261
题意:找出一个最长的并且重复次数至少为k次的子串。原创 2014-07-01 11:43:06 · 446 阅读 · 0 评论 -
后缀数组(不可重叠重复子串)poj1743
思路:二分答案,然后遍历height数组,看能不能找到原创 2014-07-03 09:57:52 · 503 阅读 · 0 评论 -
后缀数组hdu4622
Online JudgeOnline ExerciseOnline TeachingOnline ContestsExercise AuthorF.A.QHand In HandOnline AcmersForum | DiscussStatistical ChartsProblem ArchiveRealtime Judge Statu原创 2014-08-02 17:02:46 · 681 阅读 · 0 评论 -
后缀数组(重复次数最多的连续重复子串)好poj3693+spoj687
在后缀数组神文中也这题的题解。比较容易理解的部分就是枚举长度为L,然后看长度为L的字符串最多连续出现几次。既然长度为L的串重复出现,那么str[0],str[l],str[2*l]……中肯定有两个连续的出现在字符串中。那么就枚举连续的两个,然后从这两个字符前后匹配,看最多能匹配多远。即以str[i*l],str[i*l+l]前后匹配,这里是通过查询suffix(i*l),suffi原创 2014-07-03 21:59:54 · 673 阅读 · 0 评论 -
后缀数组(不相同子串的个数)spoj694
突然发现前面写的后缀数组不太对,拍出来的sa原创 2014-07-03 14:13:50 · 581 阅读 · 0 评论 -
2013 Multi-University Training Contest 9(hdu 4686 - 4691)dp(好)+矩阵快速幂+一般图匹配带花树+后缀数组
A - 1001DescriptionAn Arc of Dream is a curve defined by following function:AoD(n)=∑n−1i=0ai∗biAoD(n)=\sum_{i=0}^{n-1}a_i*b_iwhere a0=A0a_0 = A_0 ai=ai−1∗AX+AYa_i = a_{i-1}*AX+AY b0=B0b_0 = B_0 bi=原创 2015-08-27 14:38:32 · 507 阅读 · 0 评论