結果

問題 No.441 和か積
ユーザー Hiroaki KonoHiroaki Kono
提出日時 2017-10-27 19:32:52
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 698 bytes
コンパイル時間 3,054 ms
コンパイル使用メモリ 74,648 KB
実行使用メモリ 54,284 KB
最終ジャッジ日時 2024-05-01 16:12:18
合計ジャッジ時間 7,737 ms
ジャッジサーバーID
(参考情報)
judge5 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 111 ms
53,908 KB
testcase_01 AC 98 ms
52,692 KB
testcase_02 AC 98 ms
54,232 KB
testcase_03 AC 111 ms
53,976 KB
testcase_04 AC 105 ms
53,044 KB
testcase_05 AC 111 ms
53,776 KB
testcase_06 AC 99 ms
52,920 KB
testcase_07 AC 115 ms
54,060 KB
testcase_08 AC 102 ms
52,908 KB
testcase_09 AC 118 ms
54,052 KB
testcase_10 AC 108 ms
52,904 KB
testcase_11 WA -
testcase_12 AC 114 ms
54,116 KB
testcase_13 AC 110 ms
53,692 KB
testcase_14 AC 111 ms
53,940 KB
testcase_15 AC 106 ms
52,868 KB
testcase_16 AC 117 ms
53,932 KB
testcase_17 AC 118 ms
53,772 KB
testcase_18 AC 114 ms
53,880 KB
testcase_19 AC 117 ms
53,828 KB
testcase_20 AC 120 ms
53,900 KB
testcase_21 AC 113 ms
53,828 KB
testcase_22 AC 114 ms
54,060 KB
testcase_23 AC 112 ms
54,056 KB
testcase_24 AC 110 ms
52,964 KB
testcase_25 AC 115 ms
54,284 KB
testcase_26 AC 118 ms
54,020 KB
testcase_27 AC 117 ms
53,696 KB
testcase_28 AC 118 ms
54,032 KB
testcase_29 AC 108 ms
54,012 KB
testcase_30 AC 105 ms
52,764 KB
testcase_31 AC 102 ms
53,388 KB
testcase_32 AC 110 ms
52,856 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

public class No441 {

    public static void main(String[] args) {
        Scanner s = new Scanner(System.in);
        String a = s.next();
        String b = s.next();
        int aa = compareWithTwo(a);
        int bb = compareWithTwo(b);
        if (aa == 0 && bb == 0) {
            System.out.println("E");
        } else if (aa >= 0 && bb >= 0) {
            System.out.println("P");
        } else {
            System.out.println("S");
        }
    }

    private static int compareWithTwo(String str) {
        if (str.length() == 1) {
            int num = Integer.parseInt(str);
            return Integer.compare(num, 2);
        }
        return 1;
    }
}
0