![](https://img-blog.csdnimg.cn/20201014180756927.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
强联通分量
Lifel
dcoi 蒟蒻一枚 欢迎交流~~~qq:1627767186
展开
-
bzoj1051(缩点)
tarjan缩点后,若有出度为0的,输出其强联通块的大小,否则无解#include<iostream>#include<cstdio>#include<cmath>#include<cstring>#include<algorithm>#define fo(i,a,b) for(int i=a;i<=b;i++)#define fod(i,a,b) for(int i=a;i>=b;i-原创 2017-09-11 18:58:45 · 346 阅读 · 0 评论 -
bzoj1529: [POI2005]ska Piggy banks(tarjan||并查集)
题目大意:求联通块的数量 显然可以想到tarjan缩点之后统计出度为0的点的数量 但这题会MLE#include<iostream>#include<cstdio>#include<cmath>#include<cstring>#include<algorithm>#define fo(i,a,b) for(int i=a;i<=b;i++)#define fod(i,a,b) fo原创 2017-09-11 20:02:11 · 337 阅读 · 0 评论