結果

問題 No.431 死亡フラグ
ユーザー Maeda
提出日時 2025-08-25 16:04:31
言語 Java
(openjdk 23)
結果
AC  
実行時間 120 ms / 2,000 ms
コード長 460 bytes
コンパイル時間 2,396 ms
コンパイル使用メモリ 77,608 KB
実行使用メモリ 46,624 KB
最終ジャッジ日時 2025-08-25 16:04:37
合計ジャッジ時間 5,299 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 16
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

public class Main {
    public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
        int deadCount = 0;
        for(int i = 0 ; i < 3 ; i ++){
        	if(scan.nextInt() == 1){
        		deadCount++;
        	}
        }
		
		int survivedFlg = scan.nextInt();
		if(survivedFlg == 1 || survivedFlg == 0 && deadCount < 2){
			System.out.println("SURVIVED");
		}
		else{
			System.out.println("DEAD");
		}
    }
}
0