minux_sufe
minux_sufe
全部文章
题解
算法(2)
归档
标签
去牛客网
登录
/
注册
Code Rush
0x00
全部文章
/ 题解
(共28篇)
tarjan缩点找出拓扑图中的最长链
#include <bits/stdc++.h> using namespace std; typedef long long LL; const int N=100005; const int M=2000005; const LL P=1000007; // hash code ...
scc
图论
tarjan
缩点
2020-07-02
0
488
tarjan缩点
#include <bits/stdc++.h> using namespace std; const int N=105; const int M=10005; int n; int head[N], E=0; // 邻接表建图 int dfn[N], low[N], ts=0; ...
scc
图论
tarjan
缩点
2020-07-01
0
414
tarjan缩点
#include <bits/stdc++.h> using namespace std; const int N=10005; const int M=50005; int n, m, E=0, scc_cnt=0; int head[N], id[N], sz[N], dout[N...
scc
图论
tarjan
缩点
2020-07-01
0
493
倍增LCA求解
#include <bits/stdc++.h> using namespace std; const int N=100005; const int M=N*2; int n, m; struct Edge{ int v, ne; }e[M]; int depth[N], ...
LCA
倍增
2020-07-01
0
606
倍增LCA
#include <bits/stdc++.h> using namespace std; const int N=40005; const int M=2*N; int head[N], depth[N], fa[N][16]; // 2^16-1=65535>40000 可...
LCA
倍增
2020-06-30
0
551
在线建图SPFA
#include <bits/stdc++.h> using namespace std; const int N=30; const int M=80; // 统计出差分系统方程组的个数不超过80个 const int K=1005; int a[N], r[N], dist[N],...
图论
前缀和
2020-06-29
0
531
SPFA求解
#include <bits/stdc++.h> using namespace std; const int N=1005; const int M=10005+10005+1005; const int INF=0x3f3f3f3f; int n, m1, m2, E=0; in...
图论
2020-06-29
0
580
kruskal求解
问题需要转化一下思路,转化为找一个权值, 当去掉权值的边后, 剩余的连通块的数量要. #include <bits/stdc++.h> using namespace std; const int N=505; // NC上本题数据范围缺失, 从LOJ上查询到1<=n<=5...
图论
2020-06-24
0
455
首页
上一页
1
2
3
下一页
末页