QOJ.ac

QOJ

Time Limit: 1 s Memory Limit: 256 MB Total points: 100 Hackable ✓

#1357. ストーンキャッチゲーム

Statistics

Yuto と Platina は石取り鬼ごっこをすることにした。このゲームは二次元座標平面上で行われる。珍しいことに、ゲーム盤として使用されるのは $x$ 座標と $y$ 座標がともに $0$ 以上 $10^9$ 以下の範囲のみである。

ゲーム盤上には、白い石が $1$ つと黒い石が $N$ 個ある。最初、白い石は $(0, 0)$ にあり、$i$ 番目の黒い石は $(x_i, y_i)$ にある。ゲーム開始時およびゲーム中、2つ以上の石が同じ位置に存在することもある。

Yuto の手番では、白い石が $(x, y)$ にあるとき、それを $(x + 1, y)$ または $(x, y + 1)$ のいずれかに移動させる。

Platina の手番では、彼女は好きな黒い石を $1$ つ選び、それが $(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$ 番目の黒い石の位置を表す2つの整数 $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.