結果

問題 No.1131 Deviation Score
ユーザー 👑 ikd
提出日時 2020-07-31 20:19:13
言語 Rust
(1.97.1 + proconio + num + itertools + ACL)
コンパイル:
/usr/bin/rustc_custom
実行:
./target/release/main
結果
AC  
実行時間 72 ms / 2,000 ms
+ 738µs
コード長 576 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 2,398 ms
コンパイル使用メモリ 184,564 KB
実行使用メモリ 5,888 KB
最終ジャッジ日時 2026-07-31 15:36:08
合計ジャッジ時間 3,851 ms
ジャッジサーバーID
(参考情報)
judge2_0 / judge1_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 21
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

use std::io::Read;

fn read<T: std::str::FromStr>() -> T {
    let token: String = std::io::stdin()
        .bytes()
        .map(|c| c.ok().unwrap() as char)
        .skip_while(|c| c.is_whitespace())
        .take_while(|c| !c.is_whitespace())
        .collect();
    token.parse().ok().unwrap()
}

fn main() {
    let n: usize = read();
    let mut x: Vec<f64> = vec![0.0; n];
    for i in 0..n {
        x[i] = read();
    }
    let ave = x.iter().sum::<f64>() / n as f64;
    for x in x {
        let d = 50.0 - (ave - x) / 2.0;
        println!("{}", d.floor());
    }
}
0