QOJ.ac

QOJ

実行時間制限: 1 s メモリ制限: 1024 MB 満点: 100 ハック可能 ✓

#18692. 초현실 수

統計

Putata와 Budada가 새로운 게임을 하고 있다. 처음에는 $n$개의 돌 더미가 있다. 두 플레이어가 번갈아 가며 게임을 진행하며, Putata가 먼저 시작한다. 각 라운드에서, Putata의 차례라면 그는 더미 하나를 선택하여 양의 정수 개의 돌을 제거할 수 있다. Budada의 차례라면 그는 더미 하나를 선택하여 정확히 하나의 돌을 제거할 수 있다. 더미가 비게 되면, 그 더미는 사라지며 남은 라운드에서 선택할 수 없다. 마지막 돌을 가져가는 플레이어가 게임에서 승리한다.

Putata와 Budada 모두 똑똑하여 항상 자신이 이기기 위한 최선의 방법을 선택할 것이므로, 누가 게임에서 이길지 궁금해하며 당신에게 도움을 요청한다. 두 플레이어가 최적으로 플레이할 때 승자를 구하여라.

입력

첫 번째 줄에는 정수 $n$ ($1 \leq n \leq 10^5$)이 주어지며, 이는 돌 더미의 개수를 나타낸다.

두 번째 줄에는 $n$개의 양의 정수 $a_i$ ($1 \leq a_i \leq 10^9$)가 주어지며, 각 더미에 있는 돌의 개수를 나타낸다.

출력

한 줄을 출력한다. Putata가 게임에서 이기면 Putata를 출력한다. 그렇지 않으면 Budada를 출력한다.

예제

입력 1

6
1 1 4 5 1 4

출력 1

Putata

입력 2

2
1 1

출력 2

Budada

Discussions

About Discussions

The discussion section is only for posting: General Discussions (problem-solving strategies, alternative approaches), and Off-topic conversations.

This is NOT for reporting issues! If you want to report bugs or errors, please use the Issues section below.

Open Discussions 0
No discussions in this category.

Issues

About Issues

If you find any issues with the problem (statement, scoring, time/memory limits, test cases, etc.), you may submit an issue here. A problem moderator will review your issue.

Guidelines:

  1. This is not a place to publish discussions, editorials, or requests to debug your code. Issues are only visible to you and problem moderators.
  2. Do not submit duplicated issues.
  3. Issues must be filed in English or Chinese only.
Active Issues 0
No issues in this category.
Closed/Resolved Issues 0
No issues in this category.