結果

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

ソースコード

diff #

#include <iostream>
#include <vector>
using namespace std;
int main(){
    int n;cin>>n;
    vector<long long> a(n);
    long long 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