結果

問題 No.431 死亡フラグ
ユーザー yagi2
提出日時 2017-04-15 22:57:54
言語 Java
(openjdk 23)
結果
AC  
実行時間 126 ms / 2,000 ms
コード長 621 bytes
コンパイル時間 2,190 ms
コンパイル使用メモリ 74,544 KB
実行使用メモリ 41,508 KB
最終ジャッジ日時 2024-07-18 18:10:37
合計ジャッジ時間 4,927 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 16
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        boolean isAlive = true;

        int cnt = 0;
        for (int i = 0; i < 3; i++) {
            if (Integer.parseInt(sc.next()) == 1) {
                cnt++;
            }
        }
        if (cnt >= 2) {
            isAlive = false;
        }
        if (Integer.parseInt(sc.next()) == 1) {
            isAlive = true;
        }

        if (isAlive) {
            System.out.println("SURVIVED");
        } else {
            System.out.println("DEAD");
        }
    }
}
0