結果
| 問題 |
No.47 ポケットを叩くとビスケットが2倍
|
| ユーザー |
r6eve
|
| 提出日時 | 2017-08-09 19:20:46 |
| 言語 | OCaml (5.2.1) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 5,000 ms |
| コード長 | 284 bytes |
| コンパイル時間 | 379 ms |
| コンパイル使用メモリ | 20,852 KB |
| 実行使用メモリ | 5,248 KB |
| 最終ジャッジ日時 | 2024-10-09 00:06:32 |
| 合計ジャッジ時間 | 1,218 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 21 |
ソースコード
let pow x n =
let rec doit x n acc =
if n = 0 then acc
else doit (x * x) (n / 2) (if n mod 2 = 0 then acc else acc * x) in
doit x n 1
let () =
let n = read_int () in
let rec doit i =
if pow 2 i >= n then i
else doit (i + 1) in
doit 0 |> Printf.printf "%d\n"
r6eve