結果
| 問題 | No.3679 なんかでっかい虫リターンズ |
| コンテスト | |
| ユーザー |
urectanc
|
| 提出日時 | 2026-09-05 13:42:41 |
| 言語 | Rust (1.97.1 + proconio + num + itertools) |
| 結果 |
AC
|
| 実行時間 | 0 ms / 2,000 ms |
| + 866µs | |
| コード長 | 557 bytes |
| 記録 | |
| コンパイル時間 | 2,449 ms |
| コンパイル使用メモリ | 186,392 KB |
| 実行使用メモリ | 9,768 KB |
| 最終ジャッジ日時 | 2026-09-05 13:46:45 |
| 合計ジャッジ時間 | 4,340 ms |
|
ジャッジサーバーID (参考情報) |
judge1_0 / judge5_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 17 |
コンパイルメッセージ
warning: unused variable: `h` --> src/main.rs:5:9 | 5 | h: usize, w: usize, | ^ help: if this is intentional, prefix it with an underscore: `_h` | = note: `#[warn(unused_variables)]` (part of `#[warn(unused)]`) on by default warning: unused variable: `w` --> src/main.rs:5:19 | 5 | h: usize, w: usize, | ^ help: if this is intentional, prefix it with an underscore: `_w`
ソースコード
use proconio::{input, marker::Usize1};
fn main() {
input! {
h: usize, w: usize,
a: Usize1, b: Usize1,
r1: Usize1, c1: Usize1,
r2: usize, c2: usize,
p: Usize1, q: Usize1,
}
let mut ans = usize::MAX;
for i in r1..r2 {
for j in c1..c2 {
let cand = dist(a, b, i, j) + dist(i, j, p, q) + dist(p, q, a, b);
ans = ans.min(cand);
}
}
println!("{ans}");
}
fn dist(i0: usize, j0: usize, i1: usize, j1: usize) -> usize {
i0.abs_diff(i1) + j0.abs_diff(j1)
}
urectanc