結果

問題 No.1010 折って重ねて
ユーザー yuly3
提出日時 2020-04-24 10:50:21
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 45 ms / 2,000 ms
コード長 473 bytes
コンパイル時間 149 ms
コンパイル使用メモリ 82,048 KB
実行使用メモリ 52,352 KB
最終ジャッジ日時 2024-10-15 01:46:17
合計ジャッジ時間 3,191 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 43
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys

sys.setrecursionlimit(10 ** 7)
rl = sys.stdin.readline


def solve():
    x, y, h = map(float, rl().split())
    x *= 1000
    y *= 1000
    
    ans = 0
    while h < x or h < y:
        if h < x and h < y:
            if x <= y:
                x /= 2
            else:
                y /= 2
        elif h < x:
            x /= 2
        elif h < y:
            y /= 2
        h *= 2
        ans += 1
    print(ans)


if __name__ == '__main__':
    solve()
0