当前你的浏览器版本过低,网站已在兼容模式下运行,兼容模式仅提供最小功能支持,网站样式可能显示不正常。
请尽快升级浏览器以体验网站在线编辑、在线运行等功能。

建议使用的浏览器:

谷歌Chrome 火狐Firefox Opera浏览器 微软Edge浏览器 QQ浏览器 360浏览器 傲游浏览器

3713:Transferring Sylla

题目描述

After recapturing Sylla, the Company plans to establish a new secure system, a transferring net! The new system is designed as follows:

The Company staff choose N cities around the nation which are connected by "security tunnels" directly or indirectly. Once a week, Sylla is to be transferred to another city through the tunnels. As General ordered, the transferring net must reach a certain security level that there are at least 3 independent paths between any pair of cities a, b. When General says the paths are independent, he means that the paths share only a and b in common.

Given a design of a transferring net, your work is to inspect whether it reaches such security level.

输入解释

The input consists of several test cases.
For each test case, the first line contains two integers, N ≤ 500 and M ≤ 20000. indicating the number of cities and tunnels.
The following M lines each contains two integers a and b (0 ≤ a, b < N), indicating the city a and city b are connected directly by a tunnel.

The input ends by two zeroes.

输出解释

For each test case output "YES" if it reaches such security level, "NO" otherwise.

输入样例
4 6
0 1
0 2
0 3
1 2
1 3
2 3

4 5
0 1
0 2
0 3
1 2
1 3

7 6
0 1
0 2
0 3
1 2
1 3
2 3

0 0
输出样例
YES
NO
NO

该题目是Virtual Judge题目,来自 北京大学POJ

源链接: POJ-3713

最后修改于 2020-10-29T07:08:55+00:00 由爬虫自动更新

共提交 1

通过率 0.0%
时间上限 内存上限
5000 65536