結果

問題 No.9008 空白区切りで与えられる数値データの合計値を求める(テスト用)
ユーザー shiro
提出日時 2019-06-03 19:34:36
言語 Elixir
(1.19.5)
コンパイル:
elixirc _filename_
実行:
elixir -e Main.main
結果
WA  
実行時間 -
コード長 261 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 563 ms
コンパイル使用メモリ 72,088 KB
実行使用メモリ 252,628 KB
最終ジャッジ日時 2026-06-04 14:17:10
合計ジャッジ時間 10,876 ms
ジャッジサーバーID
(参考情報)
judge1_0 / judge2_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample WA * 4
other WA * 15
権限があれば一括ダウンロードができます
コンパイルメッセージ
    warning: variable "n1" is unused (if the variable is not meant to be used, prefix it with an underscore)
    │
  3 │     {n1, n2} = input()
    │      ~~
    │
    └─ Main.exs:3:6: Main.main/0

ソースコード

diff #
raw source code

defmodule Main do
  def main do
    {n1, n2} = input()
    Enum.sum(n2)
  end
  def input() do
    n1 = IO.gets("") |> String.trim |> String.to_integer
    n2 = IO.gets("") |> String.trim |> String.split |> Enum.map(&String.to_integer/1)
    {n1, n2}
  end
end
0