結果

問題 No.47 ポケットを叩くとビスケットが2倍
ユーザー 3qvwn
提出日時 2019-07-02 10:56:18
言語 Elixir
(1.18.1)
結果
AC  
実行時間 541 ms / 5,000 ms
コード長 321 bytes
コンパイル時間 1,075 ms
コンパイル使用メモリ 63,688 KB
実行使用メモリ 55,172 KB
最終ジャッジ日時 2024-12-31 03:10:44
合計ジャッジ時間 14,993 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 21
権限があれば一括ダウンロードができます

ソースコード

diff #

defmodule Main do
  def main do
    n = IO.gets("") |> String.trim |> String.to_integer
    strike(1, n, 0)
  end
  
  def strike(biscuit, n, count) when biscuit < n do
    strike(pocket(biscuit), n, count + 1)
  end
  
  def strike(_biscuit, _n, count) do
   IO.puts count
  end
  
  def pocket(n) do
    n * 2
  end
end
0