結果

問題 No.431 死亡フラグ
ユーザー ohagi_1182ohagi_1182
提出日時 2017-10-13 11:52:47
言語 Java21
(openjdk 21)
結果
AC  
実行時間 134 ms / 2,000 ms
コード長 531 bytes
コンパイル時間 2,248 ms
コンパイル使用メモリ 74,144 KB
実行使用メモリ 41,524 KB
最終ジャッジ日時 2024-04-28 17:25:09
合計ジャッジ時間 5,149 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 127 ms
40,892 KB
testcase_01 AC 134 ms
41,020 KB
testcase_02 AC 130 ms
41,196 KB
testcase_03 AC 129 ms
41,232 KB
testcase_04 AC 128 ms
41,104 KB
testcase_05 AC 115 ms
39,780 KB
testcase_06 AC 128 ms
41,076 KB
testcase_07 AC 127 ms
41,024 KB
testcase_08 AC 127 ms
41,080 KB
testcase_09 AC 131 ms
40,860 KB
testcase_10 AC 132 ms
41,524 KB
testcase_11 AC 131 ms
41,240 KB
testcase_12 AC 128 ms
41,168 KB
testcase_13 AC 116 ms
40,252 KB
testcase_14 AC 129 ms
40,912 KB
testcase_15 AC 132 ms
41,096 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