結果

問題 No.21 平均の差
コンテスト
ユーザー Haniwa
提出日時 2025-12-30 13:22:51
言語 Rust
(1.92.0 + proconio + num)
結果
AC  
実行時間 2 ms / 5,000 ms
コード長 225 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 25,991 ms
コンパイル使用メモリ 396,784 KB
実行使用メモリ 7,848 KB
最終ジャッジ日時 2025-12-30 13:23:18
合計ジャッジ時間 13,880 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 10
権限があれば一括ダウンロードができます
コンパイルメッセージ
warning: unused variable: `k`
 --> src/main.rs:6:3
  |
6 |         k: usize,
  |         ^ help: if this is intentional, prefix it with an underscore: `_k`
  |
  = note: `#[warn(unused_variables)]` on by default

ソースコード

diff #
raw source code

use proconio::input;

fn main() {
	input! {
		n: usize,
		k: usize,
		a: [usize; n],
	}

    let min = *a.iter().min().unwrap();
    let max = *a.iter().max().unwrap();

    let ans = max - min;
    
    println!("{ans}");
}
0