結果

問題 No.3288 Sloppy Land Grading
コンテスト
ユーザー 13d0ccc0-b63b-11f0-9490-db448702d40f
提出日時 2025-10-31 22:08:52
言語 Rust
(1.83.0 + proconio)
結果
AC  
実行時間 45 ms / 2,000 ms
コード長 1,132 bytes
コンパイル時間 12,819 ms
コンパイル使用メモリ 398,328 KB
実行使用メモリ 13,952 KB
最終ジャッジ日時 2025-10-31 22:09:08
合計ジャッジ時間 14,769 ms
ジャッジサーバーID
(参考情報)
judge5 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
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}
    input! {mtr: [[i64; 6]; t]}
    for v in mtr.into_iter() {
        let inp = v;
        let posa = (inp[1] - inp[0]).abs() * inp[4] + (inp[2] - inp[0]).abs() * inp[5];
        let posb = (inp[1] - inp[0]).abs() * inp[3] + (inp[2] - inp[1]).abs() * inp[5];
        let posc = (inp[2] - inp[0]).abs() * inp[3] + (inp[2] - inp[1]).abs() * inp[4];

        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