問題一覧 > 通常問題

No.441 Sum or Product

レベル : / AI推定難易度 : 450 / 実行時間制限 : 1ケース 1.000秒 / メモリ制限 : 256 MB / 標準ジャッジ問題
タグ : (AC するまで非表示) / 解いたユーザー数 532
作問者 : ctyl_0 / テスター : 🍡yurahuna
お気に入りにしたユーザー ProblemId : 1227 / 自分の提出
問題文最終更新日: 2026-06-27 07:52:23
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 153 (順位表) の他の問題:

Problem Statement

You are given two non-negative integers $A,B$. Determine which is larger, the sum $A+B$ or the product $A\times B$. Print "S" if the sum is larger, "P" if the product is larger, and "E" if they are equal.

Input

$A$ $B$

$0\leq A\leq 10^{200}, 0\leq B\leq 10^{200}$ (Note that the values may not fit in a 64-bit integer type.)

Output

Print "S" if the sum is larger, "P" if the product is larger, and "E" if they are equal. Print a newline at the end.

Sample

Sample 1
Input
5 0
Output
S

Since $5+0 > 5\times0$, the sum is larger.

Sample 2
Input
2 2
Output
E

Since $2+2=2\times2$, the two are equal.

Sample 3
Input
148356891374098124128871958712904 3951732985701928409731964831409
Output
P

The input may not fit in a 64-bit integer type.

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