图论
文章平均质量分 58
Kylin_Black
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
缩点模板
题目:洛谷3389缩点本质上就是把一些可以相互到达(强连通分量)的点看成一个点,然后构建一个新图,方便计算。#include<iostream> using namespace std; const int N=10005; const int M=100005; int n,m,head[N],dfn[N],low[N],vis[N],s[N],top,cnt,ans; int He...原创 2018-02-26 15:07:14 · 562 阅读 · 0 评论 -
割点模板
#include<iostream> using namespace std; const int N=1e5+5; int n,m,num,head[N],dfn[N],low[N],cnt,f[N],ans; bool b[N]; struct edge{ int to,next; }e[N<<1]; void add(int x,int y){e[++num]=(e...原创 2018-03-01 09:04:36 · 295 阅读 · 0 评论 -
Tarjan_LCA模板
#include<iostream> #include<cstdlib> #include<cctype> using namespace std; int father[500010],head[500010],qhead[500010],que[500010],cnt,x,y,n,m,s; struct Edge{ int next,to; }edge[1...原创 2018-03-01 09:05:43 · 286 阅读 · 0 评论 -
SPFA负环
题目#include<iostream> #include<cstring> using namespace std; const int N=200005; int n,m,T,head[N],dis[N],num; bool vis[N],flag; struct node{ int to,next,w; }edge[N<<1]; void SPFA(in...原创 2018-03-01 09:07:59 · 311 阅读 · 0 评论 -
Floyed最小环模板
#include<iostream> #include<cstring> using namespace std; const int inf(0x1f1f1f1f); int n,m,map[105][105],d[105][105],ans=inf,what[3],p[105][105]; void print(int x,int y){ if(!p[x][y]) ...原创 2018-03-01 09:08:54 · 298 阅读 · 0 评论 -
缩点
#include<iostream> using namespace std; const int N=10005; const int M=100005; int n,m,head[N],dfn[N],low[N],vis[N],s[N],top,cnt,ans,num; int Head[N],w[N],D[N],F[N],tot,in[N]; struct node{ int ...原创 2018-03-01 09:09:54 · 1123 阅读 · 0 评论
分享