結果

問題 No.656 ゴルフ
ユーザー gemmarogemmaro
提出日時 2020-04-08 11:57:24
言語 Elixir
(1.16.2)
結果
AC  
実行時間 636 ms / 2,000 ms
コード長 347 bytes
コンパイル時間 1,163 ms
コンパイル使用メモリ 54,600 KB
実行使用メモリ 50,012 KB
最終ジャッジ日時 2023-08-30 00:02:04
合計ジャッジ時間 8,716 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 618 ms
49,200 KB
testcase_01 AC 614 ms
49,552 KB
testcase_02 AC 618 ms
49,296 KB
testcase_03 AC 618 ms
49,016 KB
testcase_04 AC 613 ms
50,012 KB
testcase_05 AC 630 ms
49,972 KB
testcase_06 AC 613 ms
49,764 KB
testcase_07 AC 636 ms
49,280 KB
testcase_08 AC 617 ms
49,240 KB
testcase_09 AC 615 ms
49,336 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

defmodule Main do
  def main do
    IO.gets("")
    |> String.trim()
    |> String.to_charlist()
    |> Enum.map(fn c ->
      to_string([c])
      |> String.to_integer()
      |> (fn n ->
            cond do
              n == 0 -> 10
              true -> n
            end
          end).()
    end)
    |> Enum.sum()
    |> IO.puts()
  end
end
0