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

建议使用的浏览器:

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

1567:2006

题目描述
When the old year is leaving and the New Year is coming, people are always looking back over the past while looking forward to the future.

"What do you think is the most important events in the past year 2006?", a friend asked me.

"Well, maybe the World Cup.", I replied.

"Yeah, do you know, in a football match, how to arrange a proper match table for a group?"

"That's easy. In the World Cup, there are only 4 teams in a group. Everyone knows how to do it."

"Yes, it's easy for four-team’s arrangement. But if there are six teams or more games, can you arrange that?"

"OK, let me have a try". I answered.

In fact, I tried many times to solve the problem, but got failure in the end. Can you help me?
输入解释
The input contains data for several test cases.

Each case contains a single even integer, which is less than 2007, indicate the number of teams in a group.
and n-1 lines followed, indicate the match table.each line indicate one round in the contest.For example,
4
1-2 3-4 // the first round
1-3 2-4 // the second round
1-4 2-3 // the third round
输出解释
For each test case output "Yes" means the match table is correct, or "No" otherwise.
输入样例
2
1-2
4
1-2 3-4 
1-3 2-4 
1-4 2-3 
4
1-3 2-4 
1-2 3-4 
1-4 2-3 
4
1-2 3-2 
1-3 2-4 
1-4 2-3
输出样例
Yes
Yes
Yes
No
来自杭电HDUOJ的附加信息
Author xuezaiyue
Recommend 8600

该题目是Virtual Judge题目,来自 杭电HDUOJ

题目来源 Happy 2007

源链接: HDU-1567

最后修改于 2020-10-25T22:46:05+00:00 由爬虫自动更新

共提交 399

通过率 67.42%
时间上限 内存上限
1000/1000MS(Java/Others) 32768/32768K(Java/Others)