結果

問題 No.965 門松列が嫌い
ユーザー penqenpenqen
提出日時 2020-12-25 00:26:55
言語 Elixir
(1.16.2)
結果
AC  
実行時間 578 ms / 1,000 ms
コード長 262 bytes
コンパイル時間 1,016 ms
コンパイル使用メモリ 55,032 KB
実行使用メモリ 50,156 KB
最終ジャッジ日時 2023-08-30 01:14:49
合計ジャッジ時間 8,029 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 561 ms
50,156 KB
testcase_01 AC 564 ms
49,352 KB
testcase_02 AC 578 ms
49,968 KB
testcase_03 AC 570 ms
49,628 KB
testcase_04 AC 567 ms
49,236 KB
testcase_05 AC 562 ms
49,980 KB
testcase_06 AC 558 ms
49,200 KB
testcase_07 AC 556 ms
49,856 KB
testcase_08 AC 553 ms
49,744 KB
testcase_09 AC 567 ms
49,264 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

defmodule Main do
  def main do
    [a, b, c] = IO.read(:line) |> String.trim() |> String.split(" ") |> Enum.map(&String.to_integer/1)
    solve(a, b, c) |> IO.puts()
  end

  def solve(a, b, c) do
    [abs(b - a), abs(b - c), abs(a - c)] |> Enum.min()
  end
end
0