![](https://img-blog.csdnimg.cn/20201014180756724.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
字符串
米夏Offical
这个作者很懒,什么都没留下…
展开
-
BKDRHash
一个简单的hash #include #include using namespace std; unsigned ans=0; unsigned BKDRHash(char *str) { unsigned seed = 131; // 31 131 1313 13131 131313 etc.. unsigned hash = 0; while (*str)has原创 2016-04-27 14:51:44 · 369 阅读 · 0 评论 -
hdu2222
ac自动机,模板题 #include #include using namespace std; const int MAXN = 500000+5; const int LEN = 50+5; const int SIGMA = 26; char a[LEN],b[MAXN*2]; int trie[MAXN][SIGMA],q[MAXN],f[MAXN],val[MAXN],vis[MA原创 2016-04-27 15:05:01 · 193 阅读 · 0 评论 -
AC自动机(HDU2222 HDU3065)
//HDU2222 #include <bits/stdc++.h> using namespace std; const int MAXN = 500000 + 5; const int SIGMA = CHAR_MAX; int f[MAXN], last[MAXN]; struct trie { int ch[MAXN][SIGMA]; int val[MA...原创 2016-04-24 17:30:06 · 249 阅读 · 0 评论 -
后缀数组
//后缀数组,尚有bug #include <iostream> #include <cstdio> #include <cstring> #include <algorithm> //#define rep(i, a, b) for(int i=a;i<b;i++) using namespace std; const int MAXN ...原创 2016-04-24 17:36:01 · 201 阅读 · 0 评论