結果

問題 No.431 死亡フラグ
ユーザー bellbell
提出日時 2021-02-15 11:51:42
言語 Java21
(openjdk 21)
結果
AC  
実行時間 116 ms / 2,000 ms
コード長 543 bytes
コンパイル時間 3,478 ms
コンパイル使用メモリ 72,560 KB
実行使用メモリ 56,188 KB
最終ジャッジ日時 2023-09-30 05:33:52
合計ジャッジ時間 6,290 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 112 ms
56,176 KB
testcase_01 AC 111 ms
55,900 KB
testcase_02 AC 109 ms
55,612 KB
testcase_03 AC 113 ms
55,688 KB
testcase_04 AC 112 ms
55,744 KB
testcase_05 AC 109 ms
55,688 KB
testcase_06 AC 107 ms
55,660 KB
testcase_07 AC 113 ms
55,876 KB
testcase_08 AC 112 ms
55,784 KB
testcase_09 AC 109 ms
55,604 KB
testcase_10 AC 113 ms
56,188 KB
testcase_11 AC 109 ms
55,804 KB
testcase_12 AC 108 ms
55,604 KB
testcase_13 AC 116 ms
55,976 KB
testcase_14 AC 108 ms
55,652 KB
testcase_15 AC 116 ms
55,844 KB
権限があれば一括ダウンロードができます

ソースコード

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