結果

問題 No.970 数列変換マシン
ユーザー 👑 CleyL
提出日時 2020-01-17 21:26:22
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 360 bytes
コンパイル時間 565 ms
コンパイル使用メモリ 69,048 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-06-25 18:34:47
合計ジャッジ時間 2,060 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 13 WA * 9
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <vector>
using namespace std;
int main(){
    int n;cin>>n;
    vector<int> a(n);
    int sm  =0;
    for(int i = 0; n > i; i++){
        cin>>a[i];
        a[i]*= (n-1);
        sm += a[i];
    }
    sm = sm/(n-1);
    for(int i = 0; n > i; i++){
        cout << sm-a[i];
        if(i+1 != n)cout << " ";
    }
    cout << endl;
}
0