|시간 제한||메모리 제한||제출||정답||맞힌 사람||정답 비율|
|4 초 (추가 시간 없음)||1024 MB||4||4||4||100.000%|
A new two-player game simulates two countries fighting over a territory. This territory contains a number of strategic positions which are suitable for setting up war camps. The players take turns setting up a camp at one of these spots.
In this territory, there are also a number of trails that connect two positions each. Whenever a player sets up a new camp, this player will send a small group of soldiers over every adjacent trail that leads to an enemy encampment. Each of these groups of soldiers will raid the enemy camp. In other words, for every trail, the second player to capture one of the incident positions can launch at most one raid over this trail. When every strategic position has been claimed, the game ends. The player that performed the most raids wins the game.
Assuming both players play optimally, who wins?
The input consists of:
There is at most one trail between every pair of strategic positions.
If the player who goes first wins, output "
player 1". If the player who goes second wins, output "
player 2". If the players tie, output "
3 3 1 2 2 3 1 3
2 1 1 2
5 7 3 4 2 1 4 5 1 4 1 3 2 3 2 4