結果

問題 No.46 はじめのn歩
ユーザー yukicco
提出日時 2018-11-17 01:17:04
言語 Elixir
(1.18.1)
結果
AC  
実行時間 4,257 ms / 5,000 ms
コード長 408 bytes
コンパイル時間 843 ms
コンパイル使用メモリ 64,052 KB
実行使用メモリ 54,720 KB
最終ジャッジ日時 2024-12-31 02:29:38
合計ジャッジ時間 10,800 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 10
権限があれば一括ダウンロードができます

ソースコード

diff #

defmodule Main do
    def nStep(step, goal), do: nStep(step, goal, step)
    defp nStep(step, goal, acc) do
        cond do
            acc >= goal -> div(acc, step)
            true -> nStep(step, goal, acc + step)
        end
    end
    def main do

        inputs = IO.binread(:all) |> String.split

        [a, b] = inputs |> Enum.map(&(String.to_integer(&1)))

        IO.puts nStep(a, b)

    end
end
0