随笔分类 - 字符串——KMP
摘要:简介: 做hdu4300看到的题解,除了kmp还可以用字符串hash做 模板: 1 typedef unsigned long long ull; 2 const int maxn=100000+10; 3 const ull base = 163; 4 char s[maxn],t[maxn];
阅读全文
摘要:关于子串的查找 1 char a[maxn],b[maxn]; 2 int lena,lenb,net[maxn]; 3 void getnet() { ///得到next数组 4 lenb=strlen(b); 5 net[0]=-1; 6 int i=0,j=-1; 7 while(i<lenb
阅读全文

浙公网安备 33010602011771号