結果

問題 No.441 和か積
ユーザー takeya_okino
提出日時 2017-06-21 15:48:38
言語 Java
(openjdk 23)
結果
AC  
実行時間 132 ms / 1,000 ms
コード長 775 bytes
コンパイル時間 2,283 ms
コンパイル使用メモリ 74,428 KB
実行使用メモリ 54,284 KB
最終ジャッジ日時 2024-06-27 03:54:10
合計ジャッジ時間 7,515 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 30
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    String A = sc.next();
    String B = sc.next();
    String ans = "";
    if(A.equals("0")) {
      if(B.equals("0")) {
        ans = "E";
      } else {
        ans = "S";
      }  
    } else if(A.equals("1")) {
      ans = "S";
    } else if(A.equals("2")) {
      if(B.equals("0")) {
        ans = "S";
      } else if(B.equals("1")) {
        ans = "S";
      } else if(B.equals("2")) {
        ans = "E";
      } else {
        ans = "P";
      }
    } else {
      if(B.equals("0")) {
        ans = "S";
      } else if(B.equals("1")) {
        ans = "S";
      } else {
        ans = "P";
      }  
    }
    System.out.println(ans);
  }
}
0