
模板
yysys
yysys
展开
-
【中国剩余定理模板】
LL a[maxn], b[maxn], n;void extend_gcd(LL a, LL b, LL &d, LL &x, LL &y){ if(b == 0) { d = a, x = 1, y = 0; } else { extend_gcd(b, a%b, d, y, x), y -= x*(a/b); }}void extend_chinese_reminde原创 2014-07-17 14:58:42 · 666 阅读 · 0 评论 -
【AC自动机模板】(转自木子日匀大神)
今天写了转载 2014-06-30 19:05:58 · 631 阅读 · 0 评论 -
【KMP】 模板
char p[maxn], t[maxn];void get(void) { next[0] = next[1] = 0; int i, j; for(i = 1; i <= m; i++) { j = next[i]; while(j && p[i] != p[j]) j=next[j]; ne原创 2014-06-29 16:57:07 · 428 阅读 · 0 评论