QOJ.ac

QOJ

Limite de temps : 1 s Limite de mémoire : 256 MB Points totaux : 100 Hackable ✓

#1357. 돌 잡기 게임

Statistiques

Yuto와 Platina는 돌 잡기 게임을 하려고 합니다. 이 게임은 2차원 좌표 평면에서 진행되며, 특이하게도 $x$ 좌표와 $y$ 좌표가 모두 $0$ 이상 $10^9$ 이하인 영역만을 게임판으로 사용합니다.

게임판 위에는 하나의 흰 돌과 $N$개의 검은 돌이 있습니다. 처음에 흰 돌은 $(0, 0)$에 위치하며, $i$번째 검은 돌은 $(x_i, y_i)$에 위치합니다. 게임 시작 시점과 진행 도중에 두 개 이상의 돌이 같은 위치에 있을 수 있습니다.

Yuto의 차례가 되면, 흰 돌이 $(x, y)$에 있을 때 이를 $(x + 1, y)$ 또는 $(x, y + 1)$로 이동시킵니다.

Platina의 차례가 되면, 그녀는 원하는 검은 돌 하나를 골라, 그 돌이 $(x, y)$에 있다면 $(x - 1, y)$ 또는 $(x, y - 1)$로 이동시킵니다.

플레이어들은 번갈아 가며 차례를 가지며, Yuto가 먼저 시작합니다. 흰 돌이 게임판을 벗어나면 Yuto가 승리하고, 그전에 흰 돌과 어떤 검은 돌이 같은 위치에 있게 되면 Platina가 승리합니다. 특히, 처음에 $(0, 0)$에 검은 돌이 있다면 게임이 시작되기도 전에 Platina가 승리합니다.

두 플레이어 모두 완벽하게 게임을 수행한다고 할 때, 게임판이 너무 커서 미리 누가 이길지 알고 싶습니다. 누가 게임에서 승리할지 구하세요.

입력

첫 번째 줄에는 검은 돌의 개수 $N$이 주어집니다 ($1 \le N \le 3 \cdot 10^5$).

다음 $N$개의 줄 중 $i$번째 줄에는 $i$번째 검은 돌의 위치를 나타내는 두 정수 $x_i$와 $y_i$가 주어집니다 ($0 \le x_i, y_i \le 10^9$).

출력

누가 게임에서 승리할지 출력하세요. 이름의 첫 글자는 대문자여야 합니다.

예제

입력 1

1
0 1

출력 1

Yuto

입력 2

2
2 3
3 2

출력 2

Platina

입력 3

2
0 2
2 1

출력 3

Platina

Editorials

IDTypeStatusTitlePosted ByLast UpdatedActions
#594Editorial Open集训队作业 解题报告 by 朱乐轩Qingyu2026-01-02 22:43:29 Download

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.