文章分类 -  acm数据结构-后缀数组SA

whu1564 求字符串的所有循环子串第k大 :后缀数组模板
摘要:原题少了当前的字符,不过并无差别利用sa数组可以很方便的求出来== 1 #include 2 #include 3 #include 4 using namespace std; 5 struct SA{ 6 int sa[2000005],t[2000005],t2[2000005],c[20... 阅读全文

posted @ 2015-04-28 11:25 xiao_xin 阅读(200) 评论(0) 推荐(0)

hdu3518 后缀数组标准模板:出现两次及以上子串数目
摘要:字符串最后切记别忘了加上一个与前面不同的小标志!!然后此题还是利用height函数把每一个所枚举的长度为i的重复串个数计算出来,然后多少个不同的ans++ 1 #include 2 #include 3 #include 4 using namespace std; 5 char s[200005]... 阅读全文

posted @ 2014-11-08 01:26 xiao_xin 阅读(118) 评论(0) 推荐(0)

hdu1403 后缀数组模板 求最长公共子串
摘要:用一个未用过的字符连接两个字符串,求后缀数组相邻项来自不同穿的--最大height值即可。 1 #include 2 #include 3 #include 4 using namespace std; 5 char s[200005]; 6 7 int sa[200005],t[200005],... 阅读全文

posted @ 2014-11-07 22:07 xiao_xin 阅读(102) 评论(0) 推荐(0)

导航