結果

問題 No.46 はじめのn歩
ユーザー yukiccoyukicco
提出日時 2018-11-17 01:17:04
言語 Elixir
(1.16.2)
結果
AC  
実行時間 4,621 ms / 5,000 ms
コード長 408 bytes
コンパイル時間 1,194 ms
コンパイル使用メモリ 55,004 KB
実行使用メモリ 50,208 KB
最終ジャッジ日時 2023-08-29 23:04:46
合計ジャッジ時間 12,739 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 627 ms
49,164 KB
testcase_01 AC 619 ms
50,160 KB
testcase_02 AC 611 ms
49,352 KB
testcase_03 AC 608 ms
49,108 KB
testcase_04 AC 613 ms
49,760 KB
testcase_05 AC 609 ms
49,044 KB
testcase_06 AC 612 ms
50,032 KB
testcase_07 AC 615 ms
49,852 KB
testcase_08 AC 4,621 ms
48,436 KB
testcase_09 AC 620 ms
50,208 KB
権限があれば一括ダウンロードができます

ソースコード

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