![](https://img-blog.csdnimg.cn/20201014180756918.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
图的联通性
文章平均质量分 73
even_bao
这个作者很懒,什么都没留下…
展开
-
【USACO】The Cow Prom
【题目链接】 点击打开链接【算法】 tarjan求强连通分量【代码】 #include<bits/stdc++.h> #define MAXN 20005 using namespace std; int i,N,M,u,v,id,cnt; int dfn[MAXN],low[MAXN],vis[MAXN]; vector<in...原创 2018-02-14 15:24:41 · 257 阅读 · 0 评论 -
【HAOI 2006】 受欢迎的牛
【题目链接】 点击打开链接【算法】 先用tarjan缩点,然后找出度为零的点,即可【代码】 #include<bits/stdc++.h> using namespace std; #define MAXN 500010 struct Edge { int to,nxt; } e[MAXN]; int i,tot,...原创 2018-05-18 19:01:02 · 100 阅读 · 0 评论 -
【IOI 1996】 Network of Schools
【题目链接】 点击打开链接【算法】 对于第一问,将这个图缩点,输出出度为零的点的个数 对于第二问,同样将这个图缩点,输出入度为零、出度为零的点的个数的最大值【代码】 #include <algorithm> #include <bitset> #include <cctype> #includ...原创 2018-05-18 21:05:30 · 423 阅读 · 0 评论 -
【Jsoi2010】连通数
【题目链接】 点击打开链接【算法】 直接暴力dfs一遍,即可【代码】 #include<bits/stdc++.h> using namespace std; #define MAXN 2010 int i,j,n,ans; char st[MAXN]; vector<int> e[MAXN]; bool vis...原创 2018-04-30 13:22:39 · 286 阅读 · 0 评论 -
【POJ 3352】 Road Construction
【题目链接】 点击打开链接【算法】 tarjan算法求边双联通分量【代码】 #include <algorithm> #include <bitset> #include <cctype> #include <cerrno> #include <clocale> #include &...原创 2018-06-12 18:47:48 · 245 阅读 · 0 评论 -
【POJ 1144】 Network
【题目链接】 点击打开链接【算法】 Tarjan算法求割点【代码】 #include <algorithm> #include <bitset> #include <cctype> #include <cerrno> #include <clocale> #include <...原创 2018-06-10 10:42:56 · 123 阅读 · 0 评论