結果

問題 No.431 死亡フラグ
ユーザー ohagi_1182ohagi_1182
提出日時 2017-10-13 11:52:47
言語 Java21
(openjdk 21)
結果
AC  
実行時間 121 ms / 2,000 ms
コード長 531 bytes
コンパイル時間 1,836 ms
コンパイル使用メモリ 71,848 KB
実行使用メモリ 56,152 KB
最終ジャッジ日時 2023-08-11 00:15:54
合計ジャッジ時間 4,749 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 117 ms
55,292 KB
testcase_01 AC 116 ms
55,856 KB
testcase_02 AC 118 ms
55,344 KB
testcase_03 AC 119 ms
55,368 KB
testcase_04 AC 116 ms
55,940 KB
testcase_05 AC 117 ms
56,152 KB
testcase_06 AC 117 ms
55,980 KB
testcase_07 AC 118 ms
55,712 KB
testcase_08 AC 117 ms
55,940 KB
testcase_09 AC 118 ms
55,680 KB
testcase_10 AC 121 ms
55,576 KB
testcase_11 AC 117 ms
55,960 KB
testcase_12 AC 118 ms
55,644 KB
testcase_13 AC 117 ms
55,280 KB
testcase_14 AC 118 ms
55,784 KB
testcase_15 AC 119 ms
55,732 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int l = sc.nextInt();
		int m = sc.nextInt();
		int n = sc.nextInt();
		int s = sc.nextInt();
		if(s == 1) {
			System.out.println("SURVIVED");
		} else {
			int cntDead = 0;
			if (l == 1) {
				cntDead++;
			}
			if(m == 1) {
				cntDead++;
			}
			if(n == 1) {
				cntDead++;
			}
			if(cntDead >= 2) {
				System.out.println("DEAD");
			} else {
				System.out.println("SURVIVED");
			}
		}
	}
}
0