結果

問題 No.431 死亡フラグ
ユーザー atkrymatkrym
提出日時 2016-10-18 11:32:31
言語 Java21
(openjdk 21)
結果
AC  
実行時間 114 ms / 2,000 ms
コード長 520 bytes
コンパイル時間 1,846 ms
コンパイル使用メモリ 74,784 KB
実行使用メモリ 41,348 KB
最終ジャッジ日時 2024-05-02 02:26:59
合計ジャッジ時間 4,286 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 101 ms
39,856 KB
testcase_01 AC 105 ms
41,204 KB
testcase_02 AC 112 ms
41,136 KB
testcase_03 AC 113 ms
41,348 KB
testcase_04 AC 114 ms
39,964 KB
testcase_05 AC 109 ms
40,768 KB
testcase_06 AC 101 ms
40,312 KB
testcase_07 AC 107 ms
40,620 KB
testcase_08 AC 111 ms
41,204 KB
testcase_09 AC 99 ms
40,220 KB
testcase_10 AC 111 ms
41,328 KB
testcase_11 AC 98 ms
39,900 KB
testcase_12 AC 111 ms
41,236 KB
testcase_13 AC 102 ms
39,952 KB
testcase_14 AC 105 ms
40,876 KB
testcase_15 AC 109 ms
40,900 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