随笔分类 - 字符串
摘要:建trie树,刚好字符串是反向的,直接在原图上向前搜索就OK了……………… 可怜的我竟然用了RK来hash,在test67那里T了…… 贴个RK的 trie树简便快捷啊……
阅读全文
摘要:#include #include #include #include using namespace std;const int MAX=1e5+7;char s1[MAX],s2[MAX],s3[MAX];char getdif(char a,char b){ for(int i=0;in||c...
阅读全文
摘要:由于最长不超过30个字符(由K的范围确定),于是,枚举所有的字符串,二分中使用二分就可以确定第K小了。#include #include #include #include using namespace std;char str[20010];int bits[32];int save[32][2...
阅读全文
摘要:Manacher算法,相当于求回文串。关于Manacher,转http://blog.sina.com.cn/s/blog_70811e1a01014esn.html现在进入正题:首先,在字符串s中,用rad[i]表示第i个字符的回文半径,即rad[i]尽可能大,且满足:s[i-rad[i],i-1...
阅读全文

浙公网安备 33010602011771号