Logo
(追記) (追記ここまで)

23368번 - Entering Enemy Encampment 다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
4 초 (추가 시간 없음) 1024 MB42201852.941%

문제

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:

  • One line containing two integers $n$ (1ドル \leq n \leq 20$), the number of strategic positions, and $m$ (0ドル \leq m \leq \frac{n(n-1)}{2}$), the number of trails.
  • $m$ lines, each containing two integers $a$ and $b$ (1ドル \leq a, b \leq n,ドル $a\neq b$), indicating that there is a trail between position $a$ and position $b$.

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 "tie".

제한

예제 입력 1

3 3
1 2
2 3
1 3

예제 출력 1

tie

예제 입력 2

2 1
1 2

예제 출력 2

player 2

예제 입력 3

5 7
3 4
2 1
4 5
1 4
1 3
2 3
2 4

예제 출력 3

player 1

힌트

출처

ICPC > Regionals > Europe > Northwestern European Regional Contest > Benelux Algorithm Programming Contest > BAPC 2021 Preliminaries E번

  • 문제를 만든 사람: Reinier Schmiermann
(追記) (追記ここまで)

출처

대학교 대회

  • 사업자 등록 번호: 541-88-00682
  • 대표자명: 최백준
  • 주소: 서울시 서초구 서초대로74길 29 서초파라곤 412호
  • 전화번호: 02-521-0487 (이메일로 연락 주세요)
  • 이메일: contacts@startlink.io
  • 통신판매신고번호: 제 2017-서울서초-2193 호

AltStyle によって変換されたページ (->オリジナル) /