提出 #32866738


ソースコード 拡げる

use proconio::input;

fn main() {
    input! {
        a: usize,
        b: usize,
        n: usize,
    };
    let f = |x: usize| -> usize { (a * x) / b - a * (x / b) };
    let c = n / b;
    let r = (c * b).saturating_sub(1);
    let ans = f(r).max(f(n));
    println!("{}", ans);
}

提出情報

提出日時
問題 D - Floor Function
ユーザ bouzuya
言語 Rust (1.42.0)
得点 400
コード長 286 Byte
結果 AC
実行時間 6 ms
メモリ 2148 KiB

ジャッジ結果

セット名 Sample All
得点 / 配点 0 / 0 400 / 400
結果
AC × 2
AC × 10
セット名 テストケース
Sample 01.txt, 02.txt
All 01.txt, 02.txt, 11.txt, 12.txt, 13.txt, 14.txt, 15.txt, 16.txt, 17.txt, 18.txt
ケース名 結果 実行時間 メモリ
01.txt AC 6 ms 2000 KiB
02.txt AC 1 ms 2100 KiB
11.txt AC 1 ms 1984 KiB
12.txt AC 2 ms 2148 KiB
13.txt AC 1 ms 2012 KiB
14.txt AC 1 ms 2112 KiB
15.txt AC 1 ms 2096 KiB
16.txt AC 1 ms 1992 KiB
17.txt AC 1 ms 2088 KiB
18.txt AC 2 ms 2084 KiB