結果

問題 No.431 死亡フラグ
ユーザー fkwnw3_1243fkwnw3_1243
提出日時 2017-05-03 21:37:04
言語 Java21
(openjdk 21)
結果
AC  
実行時間 63 ms / 2,000 ms
コード長 907 bytes
コンパイル時間 3,042 ms
コンパイル使用メモリ 76,216 KB
実行使用メモリ 51,000 KB
最終ジャッジ日時 2023-10-12 08:02:47
合計ジャッジ時間 4,455 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 60 ms
50,976 KB
testcase_01 AC 59 ms
50,640 KB
testcase_02 AC 63 ms
50,704 KB
testcase_03 AC 61 ms
50,632 KB
testcase_04 AC 59 ms
50,952 KB
testcase_05 AC 59 ms
50,500 KB
testcase_06 AC 60 ms
50,684 KB
testcase_07 AC 61 ms
50,612 KB
testcase_08 AC 60 ms
50,708 KB
testcase_09 AC 59 ms
50,736 KB
testcase_10 AC 58 ms
50,504 KB
testcase_11 AC 59 ms
50,676 KB
testcase_12 AC 58 ms
50,612 KB
testcase_13 AC 59 ms
50,516 KB
testcase_14 AC 59 ms
51,000 KB
testcase_15 AC 59 ms
50,424 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.stream.Stream;

import static java.lang.System.in;

public class Main {
    public static void main(String[] args) throws IOException {
        BufferedReader reader = new BufferedReader(new InputStreamReader(in));
        String[] inputs = reader.readLine().split(" ");
        int[] flags = Stream.of(inputs).mapToInt(Integer::parseInt).toArray();

        if(flags[3]==1) {
            System.out.println("SURVIVED");
        } else {
            int deadCounter = 0;
            for (int i = 0; i < 3; i++) {
                if (flags[i] == 1) {
                    deadCounter += 1;
                }
            }

            if(deadCounter>=2){
                System.out.println("DEAD");
            } else {
                System.out.println("SURVIVED");
            }
        }
    }
}
0