結果

問題 No.2850 Make Slimes
ユーザー noriocnorioc
提出日時 2024-08-25 23:32:35
言語 Elixir
(1.16.2)
結果
AC  
実行時間 628 ms / 2,000 ms
コード長 420 bytes
コンパイル時間 3,755 ms
コンパイル使用メモリ 61,136 KB
実行使用メモリ 54,912 KB
最終ジャッジ日時 2024-08-25 23:32:47
合計ジャッジ時間 9,712 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 623 ms
54,496 KB
testcase_01 AC 628 ms
54,344 KB
testcase_02 AC 623 ms
54,912 KB
testcase_03 AC 621 ms
54,128 KB
testcase_04 AC 624 ms
54,012 KB
testcase_05 AC 623 ms
54,200 KB
testcase_06 AC 617 ms
53,996 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

defmodule Main do
  def input, do: IO.read(:line) |> String.trim
  def ii, do: input() |> String.to_integer
  def li, do: input() |> String.split |> Enum.map(&String.to_integer/1)
  def yn(b), do: IO.puts(if b, do: "Yes", else: "No")

  def main do
    [a, b, c, d] = li()

    case {a, b} do
      {0, b} -> div(d, b)
      {a, 0} -> div(c, a)
      {a, b} -> min(div(c, a), div(d, b))
    end
    |> IO.puts
  end
end
0