結果

問題 No.431 死亡フラグ
ユーザー bell
提出日時 2021-02-15 11:51:42
言語 Java
(openjdk 23)
結果
AC  
実行時間 137 ms / 2,000 ms
コード長 543 bytes
コンパイル時間 2,892 ms
コンパイル使用メモリ 74,468 KB
実行使用メモリ 41,720 KB
最終ジャッジ日時 2024-07-22 23:30:32
合計ジャッジ時間 5,318 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 16
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
        int d1=sc.nextInt();
        int d2=sc.nextInt();
        int d3=sc.nextInt();
        int s=sc.nextInt();
        int count=0;

        if(d1==1)count++;
        if(d2==1)count++;
        if(d3==1)count++;
        if(s==1)count=0;

        if(count >= 2){
            System.out.println("DEAD");
        }else if(count <2){
            System.out.println("SURVIVED");
        }

        sc.close();
	}
}

0