結果

問題 No.47 ポケットを叩くとビスケットが2倍
コンテスト
ユーザー 3qvwn
提出日時 2019-07-02 10:55:26
言語 Elixir
(1.19.5)
コンパイル:
elixirc _filename_
実行:
elixir -e Main.main
結果
WA  
実行時間 -
コード長 322 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 575 ms
コンパイル使用メモリ 71,940 KB
実行使用メモリ 63,548 KB
最終ジャッジ日時 2026-06-04 14:27:58
合計ジャッジ時間 9,766 ms
ジャッジサーバーID
(参考情報)
judge2_0 / judge3_1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1 WA * 2
other AC * 19 WA * 2
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

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