結果

問題 No.383 レーティング
ユーザー gemmarogemmaro
提出日時 2020-04-17 17:09:11
言語 Elixir
(1.16.2)
結果
AC  
実行時間 627 ms / 2,000 ms
コード長 271 bytes
コンパイル時間 1,118 ms
コンパイル使用メモリ 55,420 KB
実行使用メモリ 50,224 KB
最終ジャッジ日時 2023-08-30 00:21:34
合計ジャッジ時間 11,067 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 614 ms
49,396 KB
testcase_01 AC 610 ms
49,320 KB
testcase_02 AC 617 ms
49,292 KB
testcase_03 AC 619 ms
49,912 KB
testcase_04 AC 616 ms
49,404 KB
testcase_05 AC 621 ms
49,452 KB
testcase_06 AC 620 ms
49,200 KB
testcase_07 AC 616 ms
49,912 KB
testcase_08 AC 617 ms
50,224 KB
testcase_09 AC 614 ms
49,604 KB
testcase_10 AC 614 ms
49,976 KB
testcase_11 AC 612 ms
49,804 KB
testcase_12 AC 623 ms
49,304 KB
testcase_13 AC 627 ms
50,060 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

defmodule Main do
  def main do
    IO.read(:line)
    |> String.split()
    |> Enum.map(&String.to_integer/1)
    |> solve
    |> IO.puts()
  end

  def solve([a, b]) do
    cond do
      a == b -> 0
      a < b -> "+#{b - a}"
      true -> "-#{a - b}"
    end
  end
end
0