提出 #41288861


ソースコード 拡げる

use proconio::input;

fn main() {
    input! {
        a: usize,
        b: usize,
        x: usize,
    }

    let mut ok = 0_usize;
    let mut ng = x;
    while ng - ok > 1 {
        let n = ok + (ng - ok) / 2;
        let d_n = n.to_string().len();
        if a * n + b * d_n <= x && n <= 1_000_000_000 {
            ok = n;
        } else {
            ng = n;
        }
    }
    println!("{}", ok);
}

提出情報

提出日時
問題 C - Buy an Integer
ユーザ bouzuya
言語 Rust (1.42.0)
得点 300
コード長 408 Byte
結果 AC
実行時間 4 ms
メモリ 2156 KiB

ジャッジ結果

セット名 sample All
得点 / 配点 0 / 0 300 / 300
結果
AC × 4
AC × 16
セット名 テストケース
sample sample01, sample02, sample03, sample04
All border01, border02, border03, corner01, max01, max02, max03, min01, min02, rnd01, rnd02, rnd03, sample01, sample02, sample03, sample04
ケース名 結果 実行時間 メモリ
border01 AC 4 ms 2032 KiB
border02 AC 1 ms 1940 KiB
border03 AC 1 ms 2076 KiB
corner01 AC 4 ms 2132 KiB
max01 AC 2 ms 2156 KiB
max02 AC 1 ms 2092 KiB
max03 AC 1 ms 1960 KiB
min01 AC 2 ms 2040 KiB
min02 AC 2 ms 2024 KiB
rnd01 AC 3 ms 2088 KiB
rnd02 AC 3 ms 2016 KiB
rnd03 AC 2 ms 2024 KiB
sample01 AC 1 ms 2020 KiB
sample02 AC 1 ms 2016 KiB
sample03 AC 1 ms 2016 KiB
sample04 AC 2 ms 2020 KiB