結果

問題 No.431 死亡フラグ
ユーザー jimanojimano
提出日時 2018-01-13 17:15:57
言語 Java21
(openjdk 21)
結果
AC  
実行時間 111 ms / 2,000 ms
コード長 565 bytes
コンパイル時間 3,388 ms
コンパイル使用メモリ 72,216 KB
実行使用メモリ 56,300 KB
最終ジャッジ日時 2023-08-25 15:50:21
合計ジャッジ時間 5,629 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 111 ms
55,748 KB
testcase_01 AC 108 ms
55,952 KB
testcase_02 AC 105 ms
56,008 KB
testcase_03 AC 103 ms
55,904 KB
testcase_04 AC 104 ms
56,252 KB
testcase_05 AC 106 ms
55,812 KB
testcase_06 AC 110 ms
56,020 KB
testcase_07 AC 103 ms
55,664 KB
testcase_08 AC 104 ms
55,892 KB
testcase_09 AC 102 ms
56,012 KB
testcase_10 AC 105 ms
55,896 KB
testcase_11 AC 111 ms
55,824 KB
testcase_12 AC 105 ms
55,744 KB
testcase_13 AC 102 ms
55,980 KB
testcase_14 AC 111 ms
56,300 KB
testcase_15 AC 111 ms
55,360 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

package me.yukicoder.lv1;

import java.util.Scanner;

public class No0431 {
	public static void main(String[] args) {
		try (Scanner sc = new Scanner(System.in)) {
			int[] flg = new int[3];
			for (int i = 0; i < 3; i++) {
				flg[i] = sc.nextInt();
			}
			int S = sc.nextInt();

			System.out.println(checkFlg(S, flg));
		}
	}

	static String checkFlg(int S, int[] flg) {
		if (S == 1) {
			return "SURVIVED";
		}

		int cntDeadFlg = 0;
		for (int f : flg) {
			if (f == 1)
				cntDeadFlg++;
		}
		if (cntDeadFlg < 2)
			return "SURVIVED";

		return "DEAD";
	}
}
0