結果

問題 No.431 死亡フラグ
ユーザー AoiroFukurouAoiroFukurou
提出日時 2016-12-18 13:34:58
言語 Java19
(openjdk 21)
結果
AC  
実行時間 124 ms / 2,000 ms
コード長 444 bytes
コンパイル時間 3,250 ms
コンパイル使用メモリ 73,384 KB
実行使用メモリ 56,096 KB
最終ジャッジ日時 2023-08-21 00:48:47
合計ジャッジ時間 6,055 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 124 ms
56,076 KB
testcase_01 AC 121 ms
56,072 KB
testcase_02 AC 121 ms
55,664 KB
testcase_03 AC 120 ms
55,616 KB
testcase_04 AC 122 ms
55,960 KB
testcase_05 AC 123 ms
55,936 KB
testcase_06 AC 122 ms
55,956 KB
testcase_07 AC 121 ms
55,784 KB
testcase_08 AC 122 ms
56,056 KB
testcase_09 AC 124 ms
56,024 KB
testcase_10 AC 122 ms
55,612 KB
testcase_11 AC 123 ms
55,640 KB
testcase_12 AC 121 ms
55,656 KB
testcase_13 AC 120 ms
55,740 KB
testcase_14 AC 120 ms
56,096 KB
testcase_15 AC 124 ms
55,800 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