結果

問題 No.431 死亡フラグ
ユーザー tanson
提出日時 2025-10-05 00:25:56
言語 Standard ML
(MLton 20210117)
結果
AC  
実行時間 1 ms / 2,000 ms
コード長 567 bytes
コンパイル時間 7,393 ms
コンパイル使用メモリ 689,656 KB
実行使用メモリ 7,716 KB
最終ジャッジ日時 2025-10-05 00:26:05
合計ジャッジ時間 4,261 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 16
権限があれば一括ダウンロードができます

ソースコード

diff #

fun readInt () =
    valOf (TextIO.scanStream (Int.scan StringCvt.DEC) TextIO.stdIn)


val () =
    let
        val d1 = readInt ()
        val d2 = readInt ()
        val d3 = readInt ()
        val s = readInt ()
                        
        val isDeathByFlag =
            2 <=
            List.foldl
                (fn (d, acc) => d + acc)
                0
                [d1, d2, d3]

        val ans =
            if isDeathByFlag = false orelse s = 1
            then "SURVIVED"
            else "DEAD"
       
    in
        print (ans ^ "\n")
    end
0