连通图
文章平均质量分 53
A798283635
这个作者很懒,什么都没留下…
展开
-
HDU 1269 (Tarjan算法求有向图中强连通分量数目)
#include<bits/stdc++.h> #define maxn 10000+5 using namespace std; vector<int>mp[maxn]; int vis[maxn],dfn[maxn],low[maxn]; int n,m,cnt,sig; void init() { memset(low,0,sizeof(low)); memset(dfn,0,sizeof(dfn)); memset(vis,0,sizeof(vis)); for(i原创 2018-06-29 14:04:10 · 276 阅读 · 0 评论 -
Tarjan算法
1.求有向图强连通分量个数 1.1vector模板#include<stdio.h>//此代码仅供参考,用于求一个图存在多少个强连通分量 #include<string.h> #include<vector> #include<algorithm> using namespace std; #define maxn 10000+5 vector...原创 2018-06-29 14:06:34 · 172 阅读 · 0 评论 -
HDU3836 (求至少加几条边使其强连通分量为1)
Problem DescriptionTo prove two sets A and B are equivalent, we can first prove A is a subset of B, and then prove B is a subset of A, so finally we got that these two sets are equivalent. You are to ...原创 2018-06-30 19:14:57 · 220 阅读 · 0 评论 -
POJ 1236
#include <map> #include <set> #include <queue> #include <stack> #include <vector> #include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <iostream> #include <algorith原创 2018-07-01 10:46:09 · 167 阅读 · 0 评论