結果

問題 No.289 数字を全て足そう
ユーザー yukiccoyukicco
提出日時 2018-11-17 22:11:24
言語 Elixir
(1.16.2)
結果
AC  
実行時間 690 ms / 1,000 ms
コード長 281 bytes
コンパイル時間 1,239 ms
コンパイル使用メモリ 54,648 KB
実行使用メモリ 51,364 KB
最終ジャッジ日時 2023-08-29 23:06:43
合計ジャッジ時間 19,227 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 653 ms
49,576 KB
testcase_01 AC 651 ms
49,704 KB
testcase_02 AC 651 ms
50,332 KB
testcase_03 AC 645 ms
50,676 KB
testcase_04 AC 657 ms
49,564 KB
testcase_05 AC 679 ms
50,656 KB
testcase_06 AC 664 ms
49,492 KB
testcase_07 AC 675 ms
50,364 KB
testcase_08 AC 664 ms
51,000 KB
testcase_09 AC 636 ms
49,652 KB
testcase_10 AC 647 ms
50,404 KB
testcase_11 AC 654 ms
49,888 KB
testcase_12 AC 682 ms
50,724 KB
testcase_13 AC 683 ms
49,736 KB
testcase_14 AC 690 ms
50,652 KB
testcase_15 AC 663 ms
49,924 KB
testcase_16 AC 676 ms
49,724 KB
testcase_17 AC 673 ms
50,060 KB
testcase_18 AC 675 ms
51,364 KB
testcase_19 AC 649 ms
50,288 KB
testcase_20 AC 648 ms
50,924 KB
testcase_21 AC 656 ms
50,188 KB
testcase_22 AC 657 ms
50,656 KB
testcase_23 AC 686 ms
50,412 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

defmodule Main do
    def main do

        input = IO.binread(:all)

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

        IO.puts sum

    end
end
0