后缀数组
    
            
摘要:论文参见09年《后缀数组---处理字符串有力的工具》。我参考了http://sbp810050504.blog.51cto.com/2799422/705445这位大牛的博客。先附已经亲手调好的求suffix[],rank[],height[]三个数组的代码。很多后缀数组的题目都是建立在这三个数组之上的。#include <iostream>#include <string.h>#include <stdio.h>#define maxn 1000using namespace std;int wa[1000],wb[1000],wv[1000],w[100
        
阅读全文
 
        
            
    Codeforces Round #107 (Div. 1) 某字符串任何子串都为回文串
    
            
摘要:Any its substring with length equal tokis a palindrome.对于一个长度为n的串,任何它的长度为k的字串都是回文串。该串具有这样的性质:如果k为偶数,母串所有字符都相等;aaaaaa如果k为奇数,母串最多由两种字母组成;abababaView Code #include <iostream>#include <math.h>#define MOD 1000000007using namespace std;long long ppow(long long x,long long y){ long long res=1; 
        
阅读全文