結果

問題 No.3288 Sloppy Land Grading
コンテスト
ユーザー 13d0ccc0-b63b-11f0-9490-db448702d40f
提出日時 2025-10-31 21:49:58
言語 Rust
(1.83.0 + proconio)
結果
AC  
実行時間 32 ms / 2,000 ms
コード長 1,044 bytes
コンパイル時間 11,984 ms
コンパイル使用メモリ 400,368 KB
実行使用メモリ 7,716 KB
最終ジャッジ日時 2025-10-31 21:50:13
合計ジャッジ時間 14,297 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 16
権限があれば一括ダウンロードができます

ソースコード

diff #

#[allow(unused_macros)]
// https://earthly.dev/blog/rust-macros/
macro_rules! exit_with_print {
    ($x: expr) => {
        println!("{}", $x);
        exit(0);
    };
}

fn main() {
    let mut out = BufWriter::new(stdout().lock());
    input! {t: usize}
    for _ in 0 .. t {
        input! {a: i64, b: i64, c: i64, x: i64, y: i64, z: i64}
        let posa = (b - a).abs() * y + (c - a).abs() * z;
        let posb = (b - a).abs() * x + (c - b).abs() * z;
        let posc = (c - a).abs() * x + (c - b).abs() * y;

        writeln!(out, "{} ", min(posa, min(posb, posc))).unwrap();
    }
}

#[allow(unused_imports)]
use {
    //ac_library::*,
    //itertools::Itertools,
    proconio::{fastout, input, marker::Bytes, marker::Chars, marker::Usize1},
    //rustc_hash::{FxHashMap, FxHashSet},
    std::{
        cmp::{max, min, Reverse},
        collections::{BTreeMap, BinaryHeap, VecDeque},
        convert::TryInto,
        io::{self, stdout, BufRead, BufWriter, Write},
        num::*,
        ops::BitXor,
        process::exit,
    },
};
0