結果

問題 No.1108 移調
コンテスト
ユーザー elphe
提出日時 2026-01-17 16:06:31
言語 Rust
(1.92.0 + proconio + num)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 413 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 26,837 ms
コンパイル使用メモリ 415,084 KB
実行使用メモリ 7,852 KB
最終ジャッジ日時 2026-01-17 16:06:59
合計ジャッジ時間 26,885 ms
ジャッジサーバーID
(参考情報)
judge2 / judge6
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 20
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

use proconio::{fastout, input};

#[fastout]
fn main() {
    input! {
        n: usize,
        h: i8,
        t: [i8; n],
    }

    println!("{}", output(solve(h, t)))
}

fn solve(h: i8, t: Vec<i8>) -> Vec<i16> {
    t.into_iter().map(|t| t as i16 + h as i16).collect()
}

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