結果

問題 No.441 和か積
ユーザー yagi2
提出日時 2017-04-15 19:16:06
言語 Java
(openjdk 23)
結果
AC  
実行時間 142 ms / 1,000 ms
コード長 586 bytes
コンパイル時間 2,425 ms
コンパイル使用メモリ 75,716 KB
実行使用メモリ 41,524 KB
最終ジャッジ日時 2024-06-27 03:49:56
合計ジャッジ時間 8,097 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 30
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.math.BigInteger;
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        BigInteger A = new BigInteger(sc.next());
        BigInteger B = new BigInteger(sc.next());

        BigInteger S = A.add(B);
        BigInteger P = A.multiply(B);

        if (S.compareTo(P) > 0) {
            System.out.println("S");
        } else if (S.compareTo(P) < 0) {
            System.out.println("P");
        } else if (S.compareTo(P) == 0) {
            System.out.println("E");
        }
    }
}
0