結果

問題 No.1010 折って重ねて
ユーザー cra77756176
提出日時 2022-12-25 19:13:52
言語 Rust
(1.83.0 + proconio)
結果
AC  
実行時間 1 ms / 2,000 ms
コード長 573 bytes
コンパイル時間 11,587 ms
コンパイル使用メモリ 383,148 KB
実行使用メモリ 6,824 KB
最終ジャッジ日時 2024-11-19 09:14:37
合計ジャッジ時間 13,049 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 43
権限があれば一括ダウンロードができます

ソースコード

diff #

fn main() {
    let mut xx = String::new();
    std::io::stdin().read_line(&mut xx).ok();
    let xx: Vec<u64> = xx.split_whitespace().flat_map(str::parse).collect();

    let (mut x, mut y, mut h) = (1000 * xx[0], 1000 * xx[1], xx[2]);

    let mut n = 0;
    while x > h || y > h {
        if x > h && y > h {
            if x < y {
                y *= 2;
            } else {
                x *= 2;
            }
        } else if x > h {
            y *= 2;
        } else {
            x *= 2;
        }
        h *= 4;
        n += 1;
    }

    println!("{n}");
}
0