QOJ.ac

QOJ

Límite de tiempo: 1 s Límite de memoria: 1024 MB Puntuación total: 100 Hackeable ✓

#18692. 超現実数

Estadísticas

PutataとBudadaは新しいゲームをしている。最初に、$n$ 個の山がある。二人のプレイヤーが交互にゲームを行い、Putataが先手である。各ラウンドで、もしPutataの番なら、彼は任意の山を選び、そこから任意の正の数の石を取り除くことができる。もしBudadaの番なら、彼は任意の山を選び、そこからちょうど1個の石を取り除くことができる。山が空になると、その山は消え、以降のラウンドで選ぶことはできない。最後の石を取り除いたプレイヤーが勝ちである。

PutataとBudadaはどちらも賢く、常に自分が勝つための最善の手を選ぶため、彼らは誰が勝つのか疑問に思い、あなたに助けを求めた。両者が最適にプレイしたときの勝者を求めよ。

入力

1行目には整数 $n$ ($1 \leq n \leq 10^5$) が与えられる。これは山の数を表す。

2行目には $n$ 個の正整数 $a_i$ ($1 \leq a_i \leq 10^9$) が与えられる。これは各山の石の数を表す。

出力

1行で出力せよ。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.