結果

問題 No.2259 Gas Station
ユーザー estece1estece1
提出日時 2023-06-10 21:41:36
言語 Rust
(1.77.0)
結果
WA  
実行時間 -
コード長 801 bytes
コンパイル時間 976 ms
コンパイル使用メモリ 151,944 KB
実行使用メモリ 4,380 KB
最終ジャッジ日時 2023-08-31 01:13:43
合計ジャッジ時間 8,096 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,380 KB
testcase_01 AC 1 ms
4,380 KB
testcase_02 AC 1 ms
4,380 KB
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 AC 1 ms
4,376 KB
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 AC 1 ms
4,380 KB
testcase_11 WA -
testcase_12 AC 1 ms
4,376 KB
testcase_13 AC 1,127 ms
4,380 KB
testcase_14 AC 1,120 ms
4,380 KB
testcase_15 AC 1,141 ms
4,380 KB
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 AC 1,036 ms
4,380 KB
testcase_20 AC 773 ms
4,380 KB
testcase_21 AC 99 ms
4,380 KB
testcase_22 AC 72 ms
4,376 KB
testcase_23 AC 285 ms
4,380 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

macro_rules! scan_iter {
    ($buf:expr) => {{
        use std::io::{stdin, BufRead};
        use std::str::FromStr;

        $buf.clear();
        stdin().lock().read_line(&mut $buf).unwrap();
        $buf.trim()
            .split(" ")
            .map(|x| FromStr::from_str(x).unwrap())
    }};
}

macro_rules! scan_vec {
    ($buf:expr) => {
        scan_iter!($buf).collect::<Vec<_>>()
    };
}

macro_rules! scan_into {
    ($buf:expr) => {
        scan_vec!($buf).try_into().unwrap()
    };
}

fn main() {
    let mut b = String::new();
    let [l, r, c]: [i32; 3] = scan_into!(b);

    println!(
        "{}",
        (l..=r)
            .map(|x| match 1000 - (c * x) % 1000 {
                1000 => 0,
                y => y,
            })
            .min()
            .unwrap()
    );
}
0