結果

問題 No.431 死亡フラグ
ユーザー cande398cande398
提出日時 2017-10-08 15:06:29
言語 Java21
(openjdk 21)
結果
AC  
実行時間 117 ms / 2,000 ms
コード長 442 bytes
コンパイル時間 2,618 ms
コンパイル使用メモリ 75,128 KB
実行使用メモリ 54,180 KB
最終ジャッジ日時 2024-04-28 13:25:37
合計ジャッジ時間 5,206 ms
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 114 ms
53,980 KB
testcase_01 AC 112 ms
52,852 KB
testcase_02 AC 101 ms
53,016 KB
testcase_03 AC 113 ms
54,064 KB
testcase_04 AC 110 ms
53,596 KB
testcase_05 AC 113 ms
54,180 KB
testcase_06 AC 105 ms
52,952 KB
testcase_07 AC 111 ms
54,128 KB
testcase_08 AC 112 ms
53,868 KB
testcase_09 AC 107 ms
52,696 KB
testcase_10 AC 110 ms
53,084 KB
testcase_11 AC 109 ms
53,528 KB
testcase_12 AC 117 ms
53,896 KB
testcase_13 AC 106 ms
52,972 KB
testcase_14 AC 115 ms
53,696 KB
testcase_15 AC 101 ms
52,836 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

public class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int[] num = new int[4];
    int count = 0;
    for(int i=0;i<4;i++){
      num[i] = sc.nextInt();
      count += num[i];
    }
    if(num[3] == 1){
      System.out.println("SURVIVED");
    }
    else if(count>=2){
      System.out.println("DEAD");
    }
    else{
      System.out.println("SURVIVED");
    }
  }
}
0