問題一覧 > 通常問題

No.201 yukicoder Janken

レベル : / AI推定難易度 : 127 / 実行時間制限 : 1ケース 5.000秒 / メモリ制限 : 512 MB / 標準ジャッジ問題
タグ : (AC するまで非表示) / 解いたユーザー数 463
作問者 : koyumeishi
お気に入りにしたユーザー ProblemId : 436 / 自分の提出
問題文最終更新日: 2026-06-25 06:44:25
This statement was translated by AI (claude-opus-5-5, effort medium) and may contain errors or differ in nuance from the original. The original statement takes precedence. Back to the original
yukicoder contest 102 (順位表) の他の問題:

Problem Statement

What is yukicoder janken?

 You play rock-paper-scissors (janken), and the player with more yurufuwa points wins.

You are given the names, yurufuwa points, and janken hands of the two players of yukicoder janken. Output the name of the winner.
If both players have equal yurufuwa points, it is a draw. Output "-1".

Input

The first line contains the first player's name $S_A$, yurufuwa points $P_A$, and janken hand played $X_A$.
The second line contains the second player's name $S_B$, yurufuwa points $P_B$, and janken hand played $X_B$.
For the janken hands, '$R$' represents rock, '$S$' represents scissors, and '$P$' represents paper.

$S_A$ $P_A$ $X_A$
$S_B$ $P_B$ $X_B$

The input also satisfies the following constraints.
$S_A \neq S_B$
$1 \leq |S_A|, |S_B| \leq 100$
$S_A$, $S_B$ are strings consisting only of lowercase letters 'a'-'z' and uppercase letters 'A'-'Z'
$0 \leq P_A, P_B < 10^{10000}$
$P_A$, $P_B$ are integers with no leading zeros
$X_A$, $X_B$ are each one of '$R$', '$S$', '$P$'

Output

Output the name of the winner. However, in the case of a draw, output "-1".
Print a newline at the end.

Sample

Sample 1
Input
Alice 114 R
Bob 514 S
Output
Bob

In ordinary janken, Alice, who played R (rock), would beat Bob, who played S (scissors), but since this is yukicoder janken, Bob, who has more yurufuwa points, wins.

Sample 2
Input
touritsu 99999999999999999999 P
Peter 99999999999999999998 R
Output
touritsu

This is a battle between hardcore yurufuwa players touritsu and Peter. It is close, but touritsu wins.

Sample 3
Input
Taro 0 R
Hanako 0 S
Output
-1

The two players are still beginners and have no yurufuwa points. With 0 points each, it is a draw.

提出するには、Twitter 、GitHub、 Googleもしくは右上の雲マークをクリックしてアカウントを作成してください。