摘要:        
http://poj.org/problem?id=3080	还是和3450一样的。code:#include<cstdio>//最长公共子串#include<cstring>#defineMax(a,b)a>b?a:bconstintmaxn=650;intwa[maxn],wb[maxn],wv[maxn],ws[maxn],rank[maxn],height[maxn],sa[maxn],s[maxn],loc[maxn];charstr[61],ans[101];boolvis[101];intm;intcmp(int*r,inta,intb,intl){    阅读全文
        posted @ 2012-04-10 22:16
追逐.
阅读(233)
评论(0)
推荐(0)
            
        
        
摘要:        
http://poj.org/problem?id=3450	假期做过这题,当时是用KMP做的,这次用后缀数组。	把n个字符串连接起来,中间用不同的且输入串中不会出现的字符隔开,对新生成串的每个字符根据所在原子串划分区域,用Loc数组标记。	二分公共子串长度,查找相邻的后缀中是否有连续n个后缀的height值大于枚举值,且分属于n个不同的串。code:#include<cstdio>//最长公共子串#include<cstring>#defineMax(a,b)a>b?a:bconstintmaxn=805000;intwa[maxn],wb[maxn],wv[m    阅读全文
        posted @ 2012-04-10 21:21
追逐.
阅读(1028)
评论(4)
推荐(0)
 
                    
                     
                    
                 
                    
                 
 
         浙公网安备 33010602011771号
浙公网安备 33010602011771号