結果

問題 No.431 死亡フラグ
ユーザー AoiroFukurou
提出日時 2016-12-18 13:34:58
言語 Java
(openjdk 23)
結果
AC  
実行時間 135 ms / 2,000 ms
コード長 444 bytes
コンパイル時間 3,678 ms
コンパイル使用メモリ 77,508 KB
実行使用メモリ 41,392 KB
最終ジャッジ日時 2024-12-14 08:16:31
合計ジャッジ時間 6,729 ms
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 16
権限があれば一括ダウンロードができます

ソースコード

diff #

package yukicoder;

import java.util.Scanner;

public class No_431 {
public static void main(String[] args) {
	int dead = 0;
	int survived = 0;
	Scanner sc = new Scanner(System.in);
	for(int i = 0; i < 3; i++){
		int D = sc.nextInt();
		if(D == 1){
			dead++;
		}
	}
	int S = sc.nextInt();
	if(S == 1){
		survived++;
	}
	sc.close();
	if(dead >= 2 && survived == 0){
		System.out.println("DEAD");
	}else{
		System.out.println("SURVIVED");
	}
}
}
0