HDU 3394 Railway 点双连通分量
来源:互联网 发布:淘宝在哪里查看扣分 编辑:程序博客网 时间:2024/06/09 19:41
判断有多少条边属于多个环或不属于环。
首先一个双连通分量内,
- 如果边数=点数,那么所有点构成一个环
- 如果边数>点数,那么肯定有多个环,而且所有边都处于多个环内。
明天贴代码?
Railway
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)
Total Submission(s): 1604 Accepted Submission(s): 601
Problem Description
There are some locations in a park, and some of them are connected by roads. The park manger needs to build some railways along the roads, and he would like to arrange tourist routes to each circuit. If a railway belongs to more than one tourist routes, there might be clash on it, and if a railway belongs to none tourist route, it doesn’t need to build.
Now we know the plan, and can you tell us how many railways are no need to build and how many railways where clash might happen.
Input
The Input consists of multiple test cases. The first line of each test case contains two integers, n (0 < n <= 10000), m (0 <= m <= 100000), which are the number of locations and the number of the railways. The next m lines, each line contains two integers, u, v (0 <= u, v < n), which means the manger plans to build a railway on the road between u and v.
You can assume that there is no loop and no multiple edges.
The last test case is followed by two zeros on a single line, which means the end of the input.
Output
Output the number of railways that are no need to build, and the number of railways where clash might happen. Please follow the format as the sample.
Sample Input
8 10
0 1
1 2
2 3
3 0
3 4
4 5
5 6
6 7
7 4
5 7
0 0
Sample Output
1 5
- HDU 3394 Railway 点双连通分量
- HDU 3394 Railway 点双连通分量
- HDU 3394 Railway 点双连通分量
- hdu 3394 Railway【点双连通分量、桥、割点】
- HDU 3394 Railway(点双连通分量+桥)
- HDU 3394 Railway(点双连通分量的应用)
- HDU 3394Railway 点双连通分量 + 桥
- HDU 3394 Railway(点双连通分量)
- hdu 3394 Railway(Tarjan,点双连通分量)
- HDU3394 Railway(点双连通分量)
- HDU 3390 Railway 边双连通分量
- HDU3394.Railway——点双连通分量
- hdu 3749 点双连通分量
- 点双连通分量
- 点双连通分量
- 点双连通分量
- 点双连通分量
- 【HDU】3394 Railway 点双连通求块
- python生成格雷码
- Android 图片三级缓存之内存缓存(告别软引用(SoftRefrerence)和弱引用(WeakReference))
- Unity dll 热更新 前奏
- Git学习总结
- TLD学习(3)-最近邻分类器(NN)
- HDU 3394 Railway 点双连通分量
- 程序员为什么应该尽量避免争吵
- 【SPOJ-TSHOW1】Amusing numbers【二进制】
- 关于mysql如何添加InnoDB
- 栈stack和队列queue的常用基本函数
- 2016年全国研究生招生考试成绩
- innodb 多版本并发控制原理详解
- lua 中 . 和 : 的区别
- 前端与移动开发---菜鸟进阶计划002