模板 templates
有需要自取,不保证正确性。
- 源文件缺省源
#include <bits/stdc++.h>
#define REP(i, l, r) for (int i = (l); i <= (r); ++ i)
#define DEP(i, r, l) for (int i = (r); i >= (l); -- i)
#define fi first
#define se second
#define pb emplace_back
#define mems(x, v) memset((x), (v), sizeof(x))
#define SZ(x) (int)(x).size()
#define ALL(x) (x).begin(), (x).end()
#define ppc(x) __builtin_popcount(x)
using namespace std;
namespace Milkcat {
typedef long long LL;
typedef pair<LL, LL> pii;
const int N = 1e6 + 5;
int main() {
return 0;
}
}
int main() {
cin.tie(0)->sync_with_stdio(0);
int T = 1;
while (T --) Milkcat::main();
return 0;
}
- 图
struct Graph {
struct edge { int from, to, next; LL w; } e[N]; int cnt, n, head[N];
void ins(int u, int v, LL w = 0) { e[++ cnt] = {u, v, head[u], w}, n = max({n, u, v}), head[u] = cnt; }
void twi(int u, int v, LL w = 0) { ins(u, v, w), ins(v, u, w); }
void clear() { for (int i = 1; i <= cnt; i ++) head[e[i].from] = 0; cnt = 0; }
#define FEG(u, v, W, G, i) \
for (LL i = G.head[u], v = G.e[i].to, W = G.e[i].w; i; i = G.e[i].next, v = G.e[i].to, W = G.e[i].w)
}
- data_maker:https://www.luogu.com.cn/paste/glshokk5
- 数据结构:https://www.luogu.com.cn/paste/5ryvg095
- 数学:https://www.luogu.com.cn/paste/dmzv92l5
- 图论:https://www.luogu.com.cn/paste/21sipca0
- 串串:https://www.luogu.com.cn/paste/wvftoted
- 容器:https://www.luogu.com.cn/paste/b41byn3m
- 调试:https://www.luogu.com.cn/paste/bcj62aku
- 高精:https://www.luogu.com.cn/paste/cw2opid4
- poly:https://www.luogu.com.cn/paste/jre9h3m3
- 最新 poly 板子:https://www.luogu.com.cn/record/269125472
别人的:
- 线性 RMQ:https://www.luogu.com/paste/5dx822qb