模板合集
cwyupengju
这个作者很懒,什么都没留下…
展开
-
Miller_Rabin大素数测试 与 Pollard_rho整数分解模版
#include cstdio> #include cstring> #include cstdlib> #include algorithm> using namespace std; typedef __int64 LL; const int Times = 20; LL factor[100], l; LL gcd(LL a, LL b)原创 2016-08-04 10:59:24 · 305 阅读 · 0 评论 -
ac自动机模板
指针版写法:struct node { int val; node *next[26]; node *fail; node() { val = 0; for(int i = 0; i 26; i++) next[i] = NULL;原创 2016-08-04 11:08:51 · 282 阅读 · 0 评论 -
离线求lca模板
tarjan离线求 lca ,dfs+并查集 复杂度 n +q int fa[maxn],head[maxn];int qhead[maxn];//询问的链表头 struct node{int to,next,lca;};node edge[maxn],qedge[maxq];//用链表记录询问,加双向,初值k=0bool vist[maxn];int find(i原创 2016-08-04 11:14:19 · 218 阅读 · 0 评论