結果

問題 No.970 数列変換マシン
ユーザー hipopo
提出日時 2020-01-18 13:47:46
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 42 ms / 2,000 ms
コード長 697 bytes
コンパイル時間 1,045 ms
コンパイル使用メモリ 101,988 KB
最終ジャッジ日時 2025-01-08 20:01:43
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 22
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <algorithm>
#include <cmath>
#include <complex>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <vector>

using namespace std;

template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }

using ll = long long;
const long long MOD = 1e9+7;

int main() { 
    int n;
    cin >> n;
    vector<ll> y(n);
    ll sum = 0;
    for (int i = 0; i < n; i++) {
        cin >> y.at(i);
        sum += y.at(i);
    }

    for (int i = 0; i < n; i++) {
        ll x = sum - y.at(i) * (n - 1);
        cout << x << " ";
    }
    cout << endl;
}   
0