結果

問題 No.21 平均の差
ユーザー 3qvwn3qvwn
提出日時 2019-07-05 23:30:24
言語 Elixir
(1.16.2)
結果
AC  
実行時間 640 ms / 5,000 ms
コード長 309 bytes
コンパイル時間 1,208 ms
コンパイル使用メモリ 55,388 KB
実行使用メモリ 50,376 KB
最終ジャッジ日時 2023-08-29 23:41:11
合計ジャッジ時間 8,893 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 629 ms
50,256 KB
testcase_01 AC 639 ms
50,108 KB
testcase_02 AC 633 ms
49,496 KB
testcase_03 AC 636 ms
50,192 KB
testcase_04 AC 634 ms
49,556 KB
testcase_05 AC 627 ms
49,628 KB
testcase_06 AC 638 ms
49,624 KB
testcase_07 AC 640 ms
50,272 KB
testcase_08 AC 629 ms
49,488 KB
testcase_09 AC 632 ms
50,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

defmodule Main do 
  def main do
    n = IO.gets("") |> String.trim |> String.to_integer
    _ = IO.gets("")
    IO.stream(:stdio, :line) |> Enum.take(n) |> Enum.map(&String.trim/1) |> Enum.map(&String.to_integer/1) |> Enum.sort |> (fn list -> Enum.at(list, -1) - Enum.at(list, 0) end).() |> IO.puts
  end
end
0