結果

問題 No.716 距離
コンテスト
ユーザー 特命ログイン
提出日時 2018-08-24 05:01:20
言語 Rust
(1.94.0 + proconio + num + itertools)
コンパイル:
/usr/bin/rustc_custom
実行:
./target/release/main
結果
WA  
実行時間 -
コード長 573 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 6,415 ms
コンパイル使用メモリ 187,720 KB
実行使用メモリ 6,400 KB
最終ジャッジ日時 2026-06-04 17:35:02
合計ジャッジ時間 7,809 ms
ジャッジサーバーID
(参考情報)
judge1_0 / judge2_1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 39 WA * 1
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

use std::io::{Read, stdin};

fn main() {
    let mut buf = String::new();
    stdin().read_to_string(&mut buf).unwrap();
    let mut tok = buf.split_whitespace();
    let mut get = || tok.next().unwrap();
    macro_rules! get {
        ($t:ty) => (get().parse::<$t>().unwrap());
        () => (get!(i64));
    }
    
    let n = get!(usize);
    let mut a = vec![];
    for _ in 0..n {
        a.push(get!());
    }
    let max = a[n-1] - a[0];
    for i in 1..n {
        a[i-1] = a[i]-a[i-1];
    }
    println!("{}", a.iter().min().unwrap());
    println!("{}", max);
}
0