結果

問題 No.431 死亡フラグ
ユーザー kenji_shioya
提出日時 2016-10-22 19:51:39
言語 Java
(openjdk 23)
結果
AC  
実行時間 139 ms / 2,000 ms
コード長 505 bytes
コンパイル時間 3,963 ms
コンパイル使用メモリ 74,428 KB
実行使用メモリ 41,516 KB
最終ジャッジ日時 2024-11-23 17:40:39
合計ジャッジ時間 6,535 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 16
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

public class Exercise155 {
  public static void main(String[] args){
    String sStr = "SURVIVED";
    String dStr = "DEAD";
    Scanner sc = new Scanner(System.in);

    int count = 0;
    for(int i = 0; i < 3; i++){
      if(sc.nextInt() == 1){
        count++;
      }
    }
    int s = sc.nextInt();
    if(s == 1){
      System.out.println(sStr);
    }else{
      if(count < 2){
        System.out.println(sStr);
      }else{
        System.out.println(dStr);
      }
    }
  }
}
0