- 博客(6)
- 收藏
- 关注
原创 后缀数组 - 模板
void work(int *s, int n, int m) { int *x = t; int *y = t2; for (int i = 1; i <= m; i++) c[i] = 0; for (int i = 1; i <= n; i++) c[x[i] = s[i]]++; for (int i = 1; i <= m; i++) c[...
2018-04-06 12:41:18
251
原创 Dijkstra(Heap) - 模板
#include <queue>#include <vector>struct Edge { int u, v, dist;};struct Heapnode { int d, u; bool operator < (const Heapnode &rhs) const { return d > rhs...
2018-02-26 18:09:39
244
原创 Tarjan - 模板
1、求双连通分量#include <vector>#include <stack>struct Edge { int u, v;}int pre[maxn], isct[maxn], bccno[maxn];int dfs_clock, bcc_cnt;vector<int> G[maxn], bcc[maxn];stack<i...
2018-02-26 17:29:27
253
原创 匈牙利 - 模板
int nx, ny;int edge[maxn][maxn];int cx[maxn], cy[maxn];bool vis[maxn];int path(int u) { int v; for (v = 1; v <= ny; v++) { if (edge[u][v] && !vis[v]) { vis[...
2018-02-23 10:40:56
246
原创 BellmanFord(费用流) - 模板
struct Edge { int from, to, cap, flow, cost;};struct MCMF { int n, m, s, t; vector<Edge> edges; vector<int> G[maxn]; int inq[maxn]; int d[maxn]; int p[maxn];...
2018-02-22 23:43:18
216
原创 Dinic - 模板
struct Edge { int from, to, cap, flow;}; struct Dinic { int n, m, s, t; vector<Edge> edges; vector<int> G[maxn]; bool vis[maxn]; int d[maxn]; int cur[maxn];...
2018-02-21 23:37:27
214
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人