結果

問題 No.289 数字を全て足そう
ユーザー yukiccoyukicco
提出日時 2018-11-18 03:04:54
言語 Elixir
(1.16.2)
結果
AC  
実行時間 675 ms / 1,000 ms
コード長 271 bytes
コンパイル時間 1,242 ms
コンパイル使用メモリ 55,188 KB
実行使用メモリ 50,360 KB
最終ジャッジ日時 2023-08-29 23:07:58
合計ジャッジ時間 18,977 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 656 ms
49,352 KB
testcase_01 AC 638 ms
49,420 KB
testcase_02 AC 641 ms
50,296 KB
testcase_03 AC 643 ms
49,940 KB
testcase_04 AC 652 ms
49,592 KB
testcase_05 AC 644 ms
50,344 KB
testcase_06 AC 649 ms
50,152 KB
testcase_07 AC 653 ms
49,632 KB
testcase_08 AC 641 ms
50,312 KB
testcase_09 AC 648 ms
49,684 KB
testcase_10 AC 654 ms
49,516 KB
testcase_11 AC 632 ms
50,360 KB
testcase_12 AC 642 ms
49,852 KB
testcase_13 AC 650 ms
49,552 KB
testcase_14 AC 675 ms
49,904 KB
testcase_15 AC 649 ms
49,328 KB
testcase_16 AC 647 ms
50,084 KB
testcase_17 AC 656 ms
49,728 KB
testcase_18 AC 666 ms
50,040 KB
testcase_19 AC 653 ms
50,352 KB
testcase_20 AC 647 ms
49,808 KB
testcase_21 AC 638 ms
49,452 KB
testcase_22 AC 641 ms
49,944 KB
testcase_23 AC 640 ms
50,228 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

defmodule Main do
    def main do

        input = IO.binread(:all)

        sum = to_charlist(input)
            |> Stream.filter(&(48 <= &1 and &1 <= 57))
            |> Stream.map(&(String.to_integer(<<&1>>)))
            |> Enum.sum

        IO.puts sum

    end
end
0