結果

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

ソースコード

diff #

import sys

x,y,h = map(int, sys.stdin.readline().strip().split())

count = 0

x = x * 100 * 10
y = y * 100 * 10

def do(n, h, count):
    n = n / 2
    h = h * 2
    count += 1
    return (n, h, count)


while True:
    if y >= x:
        if x > 1 and x > h:
            x, h, count = do(x, h, count)
        elif y > 1 and y > h:
            y, h, count = do(y, h, count)
        else:
            break
    elif x >= y:
        if y > 1 and y > h:
            y, h, count = do(y, h, count)
        elif x > 1 and x > h:
            x, h, count = do(x, h, count)
        else:
            break

print(count)
0