結果
| 問題 | No.135 とりあえず1次元の問題 |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2026-01-08 21:18:19 |
| 言語 | Rust (1.92.0 + proconio + num) |
| 結果 |
AC
|
| 実行時間 | 10 ms / 5,000 ms |
| コード長 | 264 bytes |
| 記録 | |
| コンパイル時間 | 28,080 ms |
| コンパイル使用メモリ | 411,968 KB |
| 実行使用メモリ | 7,848 KB |
| 最終ジャッジ日時 | 2026-01-08 21:18:49 |
| 合計ジャッジ時間 | 25,141 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 22 |
ソースコード
use proconio::input;
fn main() {
input! {
n: usize,
x: [isize; n],
}
let mut arr = x.clone();
arr.sort();
arr.dedup();
let ans: isize = arr.windows(2)
.map(|arr| arr[1] - arr[0])
.min()
.unwrap_or(0);
println!("{ans}");
}