結果

問題 No.965 門松列が嫌い
コンテスト
ユーザー surumeika1987
提出日時 2026-12-04 11:09:18
言語 Rust
(1.99.1 + proconio + num + itertools + ACL)
コンパイル:
/usr/bin/rustc_custom
実行:
./target/release/main
結果
WA  
実行時間 -
コード長 522 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 4,031 ms
コンパイル使用メモリ 173,796 KB
実行使用メモリ 9,812 KB
最終ジャッジ日時 2026-12-04 11:09:24
合計ジャッジ時間 2,593 ms
ジャッジサーバーID
(参考情報)
judge4_0 / judge3_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 8 WA * 1
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

use std::io::stdin;

fn main() {
    let (a, b, c) = read_three_u32();
    let second = a.max(c);
    let third = a.min(c);
    let ans = (b - second).min(second - third);

    println!("{}", ans);
}

fn read_vec_u32() -> Vec<u32> {
    let mut buffer = String::new();
    stdin().read_line(&mut buffer).unwrap();
    buffer
        .trim()
        .split_whitespace()
        .map(|s| s.parse().unwrap())
        .collect()
}

fn read_three_u32() -> (u32, u32, u32) {
    let v = read_vec_u32();
    (v[0], v[1], v[2])
}
0