結果

問題 No.47 ポケットを叩くとビスケットが2倍
ユーザー 3qvwn3qvwn
提出日時 2019-07-02 10:55:26
言語 Elixir
(1.16.2)
結果
WA  
実行時間 -
コード長 322 bytes
コンパイル時間 1,147 ms
コンパイル使用メモリ 55,156 KB
実行使用メモリ 50,372 KB
最終ジャッジ日時 2023-08-29 23:32:20
合計ジャッジ時間 18,156 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 619 ms
49,268 KB
testcase_01 WA -
testcase_02 WA -
testcase_03 AC 630 ms
49,832 KB
testcase_04 AC 627 ms
49,796 KB
testcase_05 WA -
testcase_06 WA -
testcase_07 AC 624 ms
49,056 KB
testcase_08 AC 629 ms
49,828 KB
testcase_09 AC 628 ms
49,180 KB
testcase_10 AC 629 ms
49,052 KB
testcase_11 AC 631 ms
49,836 KB
testcase_12 AC 636 ms
49,280 KB
testcase_13 AC 637 ms
49,156 KB
testcase_14 AC 614 ms
49,268 KB
testcase_15 AC 618 ms
49,708 KB
testcase_16 AC 624 ms
49,792 KB
testcase_17 AC 632 ms
49,148 KB
testcase_18 AC 630 ms
49,044 KB
testcase_19 AC 632 ms
49,160 KB
testcase_20 AC 633 ms
49,240 KB
testcase_21 AC 630 ms
49,144 KB
testcase_22 AC 637 ms
50,372 KB
testcase_23 AC 633 ms
49,432 KB
権限があれば一括ダウンロードができます

ソースコード

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