結果

問題 No.1010 折って重ねて
ユーザー kit84
提出日時 2020-03-20 21:43:06
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
AC  
実行時間 28 ms / 2,000 ms
コード長 497 bytes
コンパイル時間 279 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 10,752 KB
最終ジャッジ日時 2024-12-15 05:05:13
合計ジャッジ時間 2,547 ms
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 43
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
input = sys.stdin.readline

def linput():
	return list(map(float,input().split()))

def gcd(a: int, b: int):
	while b: a, b = b, a%b
	return a

def lcm(a: int, b: int):
	return a * b // gcd(a, b)

def main():
	X,Y,H = linput()
	X,Y = X*1000, Y*1000
	
	res = 0
	cnt = 0
	while X>H or Y>H:
		X,Y = sorted([X,Y])
		if X>H:	X /= 2
		elif Y>H: Y /= 2
		else: break
		H *= 2
		res += 1
		cnt += 1
		#print(res,cnt,X,Y,H)
		if cnt>9999: break
	
	print(res)

if __name__ == "__main__":
	main()
0