
连通图
文章平均质量分 73
蘑菇小哲
在通往梦想的道路上奋力潜行
展开
-
图论500题
图论500题 =============================以下是最小生成树+并查集====================================== 【HDU】 1213 How Many Tables 基础并查集★ 1272 小希的迷宫 基础并查集★ 1325&&poj1308转载 2014-04-09 19:27:17 · 945 阅读 · 0 评论 -
ZOJ 3795 Grouping(强联通分量 + 缩点 + Dp)
Problem Description:Suppose there are N people in ZJU, whose ages are unknown. We have some messages about them. Thei-th message shows that the age of person si is not smaller than the age of pers原创 2015-04-19 22:52:25 · 627 阅读 · 0 评论 -
HDU 4751 Divide Groups(判断是否为二分图)
#include #include #include #include #include #include #include #include #define LL long long#define FOR(i, x, y) for(int i=x;i<=y;i++)using namespace std;const int MAXN = 100 + 10;struct E原创 2015-04-02 11:27:21 · 590 阅读 · 0 评论 -
UVA 315 Network(无向图求割点)
题目大意A Telephone Line Company (TLC) is establishing a new telephone cable network. They are connecting several places numbered by integers from 1 to N. No two places have the same number. The lines a原创 2015-02-23 17:56:30 · 921 阅读 · 0 评论 -
HDU 1875 畅通工程
ACM 图论 最小生成树原创 2014-09-04 20:11:59 · 644 阅读 · 0 评论 -
HDU 4940 Destroy Transportation system (瞎搞)
tim点击打开链接原创 2014-08-13 10:37:12 · 582 阅读 · 0 评论 -
POJ 2186 Popular Cows(Tarjan算法求强连通分量)
解题思路: 最基础的强连通分量,利用Tarjan算法原创 2014-08-08 15:35:13 · 533 阅读 · 0 评论 -
POJ 2762 Going from u to v or from v to u?(强连通分量+缩点)
解题思路: 给定一个有向图,是否满足任意两点之间都有路径可原创 2014-08-08 15:27:03 · 516 阅读 · 0 评论 -
POJ 2553 The Bottom of a Graph(Tarjan,强连通分量)
POJ Tarjan算法求强连通分量原创 2014-08-08 16:22:33 · 581 阅读 · 0 评论 -
LA 3211 Now or Later(2-SAT问题)
题目大意: N架飞机需要着陆,每架飞机原创 2014-08-06 15:35:40 · 701 阅读 · 0 评论 -
UVA 11324 The Largest Clique (强连通分量+缩点+dp)
解题思路: 在最优方案中,原创 2014-08-06 13:28:47 · 495 阅读 · 0 评论 -
UVA 1395 Slim Span
题目大意: 给出一个n(n <= 100 ) 节点的图,求苗条度(最大边 减去 最小边 的值)最小的生成树。解题思路: 首先按照权值,把边从小到大排序,然后从小到大枚举起始边,当所有点连通时停止,记录最小的一个苗条度。原创 2014-06-20 18:00:13 · 612 阅读 · 0 评论 -
BZOJ 1015 星球大战
逆序并查集#include #include #include #include #include #include #include using namespace std;const int maxn = 1000000 + 10;vectorG[maxn];int f[maxn];int Bo[maxn];int List[maxn];int ans[maxn]原创 2014-07-28 15:33:18 · 643 阅读 · 0 评论 -
HDU 1269 迷宫城堡 (强联通分量,Tarjan算法)
Problem Description:为了训练小希的方向感,Gardon建立了一座大城堡,里面有N个房间(NInput:输入包含多组数据,输入的第一行有两个数:N和M,接下来的M行每行有两个数a和b,表示了一条通道可以从A房间来到B房间。文件最后以两个0结束。Output:对于输入的每组数据,如果任意两个房间都是相互连接的,输出"Yes",否则输出"No"。S原创 2015-04-08 15:44:32 · 645 阅读 · 0 评论