結果

問題 No.21 平均の差
ユーザー gemmarogemmaro
提出日時 2020-04-10 09:15:27
言語 Elixir
(1.16.2)
結果
AC  
実行時間 632 ms / 5,000 ms
コード長 306 bytes
コンパイル時間 1,139 ms
コンパイル使用メモリ 54,628 KB
実行使用メモリ 49,956 KB
最終ジャッジ日時 2023-08-30 00:05:03
合計ジャッジ時間 8,708 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 616 ms
49,372 KB
testcase_01 AC 619 ms
49,752 KB
testcase_02 AC 628 ms
49,104 KB
testcase_03 AC 624 ms
49,108 KB
testcase_04 AC 619 ms
49,956 KB
testcase_05 AC 623 ms
49,296 KB
testcase_06 AC 628 ms
49,292 KB
testcase_07 AC 628 ms
49,196 KB
testcase_08 AC 632 ms
49,944 KB
testcase_09 AC 626 ms
49,560 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

defmodule Main do
  def main do
    n =
      IO.gets("")
      |> String.trim()
      |> String.to_integer()

    IO.gets("")

    ns =
      1..n
      |> Enum.map(fn _ ->
        IO.gets("") |> String.trim() |> String.to_integer()
      end)

    (Enum.max(ns) - Enum.min(ns))
    |> IO.puts()
  end
end
0