結果

問題 No.1131 Deviation Score
ユーザー elphe
提出日時 2026-01-16 14:43:31
言語 Rust
(1.92.0 + proconio + num + itertools)
結果
AC  
実行時間 13 ms / 2,000 ms
コード長 506 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 26,771 ms
コンパイル使用メモリ 414,384 KB
実行使用メモリ 7,848 KB
最終ジャッジ日時 2026-01-16 14:44:32
合計ジャッジ時間 28,659 ms
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 21
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

use proconio::{fastout, input};

#[fastout]
fn main() {
    input! {
        a: [u8],
    }

    println!("{}", output(solve(a)))
}

fn solve(a: Vec<u8>) -> Vec<u8> {
    let n = a.len();
    let sum_a = a.iter().map(|&a| a as u32).sum::<u32>();
    a.into_iter()
        .map(|a| (((100 + a) as u32 * n as u32 - sum_a) / (n as u32 * 2)) as u8)
        .collect()
}

fn output(ans: Vec<u8>) -> String {
    ans.into_iter()
        .map(|x| x.to_string())
        .collect::<Vec<_>>()
        .join("\n")
}
0