結果

問題 No.441 和か積
ユーザー Hiroaki KonoHiroaki Kono
提出日時 2017-10-27 19:32:52
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 698 bytes
コンパイル時間 3,121 ms
コンパイル使用メモリ 72,480 KB
実行使用メモリ 56,044 KB
最終ジャッジ日時 2023-08-14 03:20:25
合計ジャッジ時間 8,925 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 116 ms
55,744 KB
testcase_01 AC 117 ms
55,936 KB
testcase_02 AC 115 ms
55,728 KB
testcase_03 AC 116 ms
55,704 KB
testcase_04 AC 118 ms
55,824 KB
testcase_05 AC 121 ms
55,928 KB
testcase_06 AC 121 ms
55,828 KB
testcase_07 AC 120 ms
55,908 KB
testcase_08 AC 121 ms
55,464 KB
testcase_09 AC 120 ms
55,652 KB
testcase_10 AC 121 ms
55,744 KB
testcase_11 WA -
testcase_12 AC 121 ms
56,028 KB
testcase_13 AC 117 ms
55,996 KB
testcase_14 AC 117 ms
55,736 KB
testcase_15 AC 117 ms
55,652 KB
testcase_16 AC 118 ms
55,924 KB
testcase_17 AC 119 ms
55,844 KB
testcase_18 AC 118 ms
55,712 KB
testcase_19 AC 120 ms
55,592 KB
testcase_20 AC 120 ms
55,824 KB
testcase_21 AC 121 ms
55,876 KB
testcase_22 AC 120 ms
55,704 KB
testcase_23 AC 119 ms
55,368 KB
testcase_24 AC 117 ms
54,008 KB
testcase_25 AC 118 ms
54,408 KB
testcase_26 AC 121 ms
55,608 KB
testcase_27 AC 114 ms
55,708 KB
testcase_28 AC 118 ms
55,696 KB
testcase_29 AC 117 ms
55,944 KB
testcase_30 AC 118 ms
55,776 KB
testcase_31 AC 119 ms
55,840 KB
testcase_32 AC 119 ms
56,044 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