結果

問題 No.1010 折って重ねて
ユーザー kokatsukokatsu
提出日時 2023-01-18 23:06:43
言語 D
(dmd 2.109.1)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 350 bytes
コンパイル時間 2,240 ms
コンパイル使用メモリ 205,740 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-06-22 17:20:18
合計ジャッジ時間 3,652 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 43
権限があれば一括ダウンロードができます

ソースコード

diff #

import std;

enum real M = 1e3;

void main() {
    real x, y, h;
    readf("%f %f %f\n", x, y, h);

    x *= M, y *= M;
    if (x > y) swap(x, y);

    int res;

    void f(ref real u, ref real v) {
        if (u > v) {
            ++res;
            u /= 2.0, h *= 2.0;
            f(u, v);
        }
    }

    f(x, h), f(y, h);

    res.writeln;
}
0