結果

問題 No.431 死亡フラグ
ユーザー gemmarogemmaro
提出日時 2020-04-09 10:09:15
言語 Elixir
(1.15.6)
結果
AC  
実行時間 604 ms / 2,000 ms
コード長 381 bytes
コンパイル時間 1,044 ms
コンパイル使用メモリ 55,056 KB
実行使用メモリ 50,936 KB
最終ジャッジ日時 2023-08-30 00:02:17
合計ジャッジ時間 12,117 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 592 ms
49,764 KB
testcase_01 AC 591 ms
49,144 KB
testcase_02 AC 586 ms
49,196 KB
testcase_03 AC 593 ms
49,872 KB
testcase_04 AC 593 ms
50,936 KB
testcase_05 AC 593 ms
49,228 KB
testcase_06 AC 591 ms
49,048 KB
testcase_07 AC 594 ms
49,772 KB
testcase_08 AC 597 ms
49,368 KB
testcase_09 AC 591 ms
49,112 KB
testcase_10 AC 593 ms
49,376 KB
testcase_11 AC 590 ms
49,240 KB
testcase_12 AC 595 ms
49,200 KB
testcase_13 AC 593 ms
49,900 KB
testcase_14 AC 597 ms
49,052 KB
testcase_15 AC 604 ms
50,228 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

defmodule Main do
  def main do
    IO.gets("")
    |> String.trim()
    |> String.split()
    |> Enum.map(&String.to_integer(&1))
    |> (fn d ->
          cond do
            List.last(d) == 1 ||
                d |> Enum.slice(0..-2) |> Enum.sum() < 2 ->
              "SURVIVED"

            true ->
              "DEAD"
          end
        end).()
    |> IO.puts()
  end
end
0