結果

問題 No.431 死亡フラグ
ユーザー atkrymatkrym
提出日時 2016-10-18 11:32:31
言語 Java21
(openjdk 21)
結果
AC  
実行時間 123 ms / 2,000 ms
コード長 520 bytes
コンパイル時間 1,965 ms
コンパイル使用メモリ 71,316 KB
実行使用メモリ 56,248 KB
最終ジャッジ日時 2023-08-14 14:22:36
合計ジャッジ時間 4,840 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 123 ms
55,704 KB
testcase_01 AC 120 ms
56,072 KB
testcase_02 AC 122 ms
56,220 KB
testcase_03 AC 123 ms
55,980 KB
testcase_04 AC 123 ms
55,368 KB
testcase_05 AC 121 ms
55,400 KB
testcase_06 AC 123 ms
55,836 KB
testcase_07 AC 122 ms
55,992 KB
testcase_08 AC 120 ms
55,636 KB
testcase_09 AC 120 ms
55,740 KB
testcase_10 AC 122 ms
56,000 KB
testcase_11 AC 122 ms
55,596 KB
testcase_12 AC 123 ms
55,968 KB
testcase_13 AC 119 ms
55,808 KB
testcase_14 AC 122 ms
55,688 KB
testcase_15 AC 121 ms
56,248 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

public class Main {
    private static Scanner sc = new Scanner(System.in);
    public static void main(String[] args) throws Exception {
        int d = 0;
        for (int i=0;i<3;i++) {
            if (sc.nextInt() == 1) d++;
        }
        
        int s = sc.nextInt();
        
        if (s > 0) {
            System.out.println("SURVIVED");
        } else if (d > 1) {
            System.out.println("DEAD");
        } else {
            System.out.println("SURVIVED");
        }
    }
}
0