結果

問題 No.47 ポケットを叩くとビスケットが2倍
ユーザー mkanenobu
提出日時 2018-03-30 12:41:10
言語 Nim
(2.2.0)
結果
AC  
実行時間 2 ms / 5,000 ms
コード長 165 bytes
コンパイル時間 2,717 ms
コンパイル使用メモリ 66,608 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-06-30 05:41:40
合計ジャッジ時間 3,508 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 21
権限があれば一括ダウンロードができます
コンパイルメッセージ
/home/judge/data/code/Main.nim(1, 8) Warning: imported and not used: 'sequtils' [UnusedImport]
/home/judge/data/code/Main.nim(1, 34) Warning: imported and not used: 'algorithm' [UnusedImport]

ソースコード

diff #

import sequtils, strutils, math, algorithm

var n = readLine(stdin).parseInt

if n.isPowerOfTwo:
    echo int(log2(float(n)))
else:
    echo int(log2(float(n))) + 1
0