結果

問題 No.47 ポケットを叩くとビスケットが2倍
ユーザー dashi_dragonsdashi_dragons
提出日時 2017-02-10 18:03:13
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 319 bytes
コンパイル時間 89 ms
コンパイル使用メモリ 10,500 KB
実行使用メモリ 7,952 KB
最終ジャッジ日時 2023-08-27 06:55:26
合計ジャッジ時間 1,639 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 16 ms
7,756 KB
testcase_02 AC 16 ms
7,764 KB
testcase_03 AC 16 ms
7,820 KB
testcase_04 WA -
testcase_05 AC 14 ms
7,760 KB
testcase_06 AC 15 ms
7,840 KB
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 AC 15 ms
7,808 KB
testcase_16 AC 16 ms
7,836 KB
testcase_17 WA -
testcase_18 WA -
testcase_19 AC 16 ms
7,824 KB
testcase_20 AC 15 ms
7,848 KB
testcase_21 AC 15 ms
7,764 KB
testcase_22 WA -
testcase_23 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys

def check_range(a,b,x):
	if a > x or b < x:
		sys.exit()

def check_eq(a,b):
	if a != b:
		sys.exit()

def cal(x):
	if x == 1:
		return 0

	elif x == 2:
		return 1

	elif x // 2 == 1:
		return cal(x // 2) + 2
	
	else:
		return cal(x // 2) + 1 		

N = int(input())
check_range(1,100000000,N)

print(cal(N))
0