結果

問題 No.431 死亡フラグ
ユーザー AoiroFukurouAoiroFukurou
提出日時 2016-12-18 13:34:58
言語 Java21
(openjdk 21)
結果
AC  
実行時間 132 ms / 2,000 ms
コード長 444 bytes
コンパイル時間 3,551 ms
コンパイル使用メモリ 78,864 KB
実行使用メモリ 54,408 KB
最終ジャッジ日時 2024-05-08 06:34:00
合計ジャッジ時間 6,404 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 113 ms
53,000 KB
testcase_01 AC 112 ms
52,788 KB
testcase_02 AC 132 ms
54,236 KB
testcase_03 AC 125 ms
54,408 KB
testcase_04 AC 125 ms
54,160 KB
testcase_05 AC 125 ms
53,884 KB
testcase_06 AC 130 ms
54,128 KB
testcase_07 AC 127 ms
53,912 KB
testcase_08 AC 128 ms
54,160 KB
testcase_09 AC 129 ms
53,996 KB
testcase_10 AC 129 ms
54,104 KB
testcase_11 AC 126 ms
54,184 KB
testcase_12 AC 129 ms
54,152 KB
testcase_13 AC 124 ms
54,028 KB
testcase_14 AC 127 ms
53,832 KB
testcase_15 AC 123 ms
54,156 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

package yukicoder;

import java.util.Scanner;

public class No_431 {
public static void main(String[] args) {
	int dead = 0;
	int survived = 0;
	Scanner sc = new Scanner(System.in);
	for(int i = 0; i < 3; i++){
		int D = sc.nextInt();
		if(D == 1){
			dead++;
		}
	}
	int S = sc.nextInt();
	if(S == 1){
		survived++;
	}
	sc.close();
	if(dead >= 2 && survived == 0){
		System.out.println("DEAD");
	}else{
		System.out.println("SURVIVED");
	}
}
}
0