結果

問題 No.47 ポケットを叩くとビスケットが2倍
ユーザー ktshunktshun
提出日時 2015-05-31 16:56:42
言語 Python2
(2.7.18)
結果
WA  
実行時間 -
コード長 203 bytes
コンパイル時間 144 ms
コンパイル使用メモリ 6,652 KB
実行使用メモリ 6,588 KB
最終ジャッジ日時 2023-09-20 18:04:36
合計ジャッジ時間 1,270 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 13 ms
6,360 KB
testcase_02 AC 13 ms
6,460 KB
testcase_03 AC 12 ms
6,368 KB
testcase_04 AC 12 ms
6,520 KB
testcase_05 AC 12 ms
6,336 KB
testcase_06 AC 11 ms
6,556 KB
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 AC 12 ms
6,432 KB
testcase_11 AC 12 ms
6,404 KB
testcase_12 AC 12 ms
6,576 KB
testcase_13 AC 12 ms
6,364 KB
testcase_14 AC 11 ms
6,580 KB
testcase_15 WA -
testcase_16 WA -
testcase_17 AC 11 ms
6,588 KB
testcase_18 AC 11 ms
6,580 KB
testcase_19 AC 11 ms
6,404 KB
testcase_20 AC 12 ms
6,520 KB
testcase_21 WA -
testcase_22 WA -
testcase_23 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

# -*- coding:utf-8 -*-
import math

if __name__ == "__main__":
	n = input()
	ans = math.floor(math.log(n,2))
	if n != 2 ** ans:
		ans += 1
		if n - 2 ** ans != 1 and n %2 ==1:
			ans += 1
	print int(ans)
0