結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 12 ms
6,452 KB
testcase_02 AC 12 ms
6,340 KB
testcase_03 AC 12 ms
6,432 KB
testcase_04 WA -
testcase_05 AC 12 ms
6,216 KB
testcase_06 AC 12 ms
6,580 KB
testcase_07 WA -
testcase_08 WA -
testcase_09 AC 12 ms
6,428 KB
testcase_10 WA -
testcase_11 AC 13 ms
6,564 KB
testcase_12 AC 12 ms
6,536 KB
testcase_13 AC 12 ms
6,516 KB
testcase_14 WA -
testcase_15 AC 12 ms
6,368 KB
testcase_16 AC 12 ms
6,576 KB
testcase_17 AC 12 ms
6,516 KB
testcase_18 AC 12 ms
6,560 KB
testcase_19 AC 12 ms
6,580 KB
testcase_20 AC 12 ms
6,512 KB
testcase_21 WA -
testcase_22 AC 12 ms
6,560 KB
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 ans %2 ==1:
			ans += 1
	print int(ans)
0