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

建议使用的浏览器:

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

2233:GAME AGAIN!

题目描述
Alice and Bob often play games together, and they always like to play new games. Now they have thought out a new game named "ESCAPE". What is the game like? This new game is played on an undirected graph, which they draw before the game, and they play game in turn. Each turn a player can choose a vertex, which is adjacent to the last vertex chosen by his opponent (in the first turn, the player can choose any vertex) and not be chosen before. The player who does not have vertex to choose loses. Suppose that Alice always plays first and they both do their best in the game. Now given the graph, can you predict who will win the game?
输入解释
The first line of the input contains a single integer T, which is the number of test cases. Then T cases follow. Each test case contains multiple lines. The first line consists of two integers N (1 <= N <= 50) and M, which indicate the number of vertices and the number of edges. In the following M line, each contains a pair of integers a and b (1 <= a, b <= N), which means that there is an edge between a and b.
输出解释
For each test case, in a single line, output "alice", if Alice will win the game, "bob", if Bob will win, otherwise output "I don't know".
输入样例
2
2 1
1 2
3 2
1 2
2 3
输出样例
bob
alice

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

题目来源 POJ Monthly,dodo

源链接: POJ-2233

最后修改于 2020-10-29T06:27:13+00:00 由爬虫自动更新

共提交 0

通过率 --%
时间上限 内存上限
1000 65536