結果

問題 No.47 ポケットを叩くとビスケットが2倍
ユーザー chike_pluschike_plus
提出日時 2019-03-19 09:51:08
言語 F#
(F# 4.0)
結果
AC  
実行時間 58 ms / 5,000 ms
コード長 186 bytes
コンパイル時間 3,129 ms
コンパイル使用メモリ 162,864 KB
実行使用メモリ 26,144 KB
最終ジャッジ日時 2023-10-11 14:04:38
合計ジャッジ時間 5,703 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 57 ms
24,136 KB
testcase_01 AC 57 ms
24,084 KB
testcase_02 AC 56 ms
22,148 KB
testcase_03 AC 56 ms
20,156 KB
testcase_04 AC 57 ms
26,144 KB
testcase_05 AC 56 ms
24,072 KB
testcase_06 AC 58 ms
22,040 KB
testcase_07 AC 58 ms
24,144 KB
testcase_08 AC 57 ms
24,056 KB
testcase_09 AC 57 ms
22,044 KB
testcase_10 AC 57 ms
21,984 KB
testcase_11 AC 58 ms
22,024 KB
testcase_12 AC 57 ms
22,044 KB
testcase_13 AC 56 ms
22,152 KB
testcase_14 AC 57 ms
22,104 KB
testcase_15 AC 57 ms
22,148 KB
testcase_16 AC 55 ms
20,068 KB
testcase_17 AC 58 ms
24,004 KB
testcase_18 AC 57 ms
21,972 KB
testcase_19 AC 58 ms
22,120 KB
testcase_20 AC 58 ms
22,068 KB
testcase_21 AC 57 ms
22,100 KB
testcase_22 AC 57 ms
22,096 KB
testcase_23 AC 56 ms
22,144 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Microsoft (R) F# Compiler version 11.0.0.0 for F# 5.0
Copyright (c) Microsoft Corporation. All Rights Reserved.

ソースコード

diff #

open System

let max = Console.ReadLine() |> int

let rec twice n c =
  if (n*2) >= max 
    then c
    else twice (n*2) c + 1

if max = 1
  then 0
  else twice 1 1 
|> Console.WriteLine
0