結果

問題 No.431 死亡フラグ
ユーザー HEGO55HEGO55
提出日時 2017-05-20 22:55:14
言語 Java21
(openjdk 21)
結果
AC  
実行時間 137 ms / 2,000 ms
コード長 532 bytes
コンパイル時間 2,101 ms
コンパイル使用メモリ 79,028 KB
実行使用メモリ 57,760 KB
最終ジャッジ日時 2023-10-19 04:16:08
合計ジャッジ時間 5,092 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 133 ms
57,464 KB
testcase_01 AC 133 ms
57,356 KB
testcase_02 AC 133 ms
57,508 KB
testcase_03 AC 136 ms
57,488 KB
testcase_04 AC 135 ms
57,504 KB
testcase_05 AC 134 ms
57,508 KB
testcase_06 AC 136 ms
57,536 KB
testcase_07 AC 137 ms
57,504 KB
testcase_08 AC 133 ms
57,504 KB
testcase_09 AC 134 ms
57,488 KB
testcase_10 AC 133 ms
57,716 KB
testcase_11 AC 136 ms
57,760 KB
testcase_12 AC 135 ms
57,536 KB
testcase_13 AC 135 ms
57,340 KB
testcase_14 AC 134 ms
57,464 KB
testcase_15 AC 134 ms
57,536 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;
class No431{
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		int[] number = new int[4];
		int deadCount = 0;
		
		for(int i=0; i<number.length; i++){
			number[i] = sc.nextInt();
		}
		
		for(int j=0; j<number.length-1; j++){
			if(number[j] == 1){
				deadCount++;
			}
		}
		
		if(number[3] == 1){
			System.out.println("SURVIVED");
		}
		
		if(number[3] != 1){
			if(deadCount >= 2){
				System.out.println("DEAD");
			}else{
				System.out.println("SURVIVED");
			}
		}
	}
}
0