传送门 要不是有负权边,我才不写spfa...... #include <iostream> #include <stdio.h> #include <string.h> #include <ve…
分类:OI/ACM
【模板】后缀数组(UOJ 35)
传送门 一些说明: 必须保证s[1...n]为题中字符串,且不能有ASCII为0;从s[n+1]开始必须均为0 rk[1...n]为1...n中的任意数,而sa[1...n]一定为1...n的一个排列 tsa表示仅以第二…
【模板】基数排序(Luogu P1177)
传送门 思想:从低到高按每一位排序,基数任选,这里用的是二进制 #include <iostream> #include <stdio.h> #include <string.h> #include &…
【模板】AC自动机(Luogu P3808 & P3796 & P5357)
求出现的模式串的个数:Luogu P3808 【模板】AC自动机(简单版) #include <iostream> #include <stdio.h> #include <string.h> #inc…
【模板】KMP(Luogu P3375)
传送门 #include <iostream> #include <stdio.h> #include <string.h> #define MAX_N 1000005 using namespace …
【模板】树链剖分(Luogu P3384)
传送门 #include <iostream> #include <stdio.h> #include <string.h> #include <vector> #define MAX_N 100…
【模板】线段树(Luogu P3373)
传送门 #include <iostream> #include <stdio.h> #include <string.h> #define MAX_N 400005 #define int long …
【模板】Dijkstra(Luogu P4779)
传送门 #include <iostream> #include <stdio.h> #include <string.h> #include <vector> #include <queu…
【模板】树状数组(Luogu P3374 & P3368)
传送门(单点修改区间查询) #include <iostream> #include <stdio.h> #include <string.h> #define MAX_N 500005 using n…
【模板】最小生成树(Kruskal)(Luogu P3366)
传送门 #include <iostream> #include <stdio.h> #include <string.h> #include <algorithm> #define MAX_N …