結果

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

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
typedef vector<ll> vl;
typedef pair<ll, ll> PP;
#define rep(i, n) for(ll i = 0; i < ll(n); i++)
#define ITR(x, c) for(__typeof(c.begin()) x = c.begin(); x != c.end(); x++)
#define all(v) v.begin(), v.end()
#define inputv(v, n)                                                           \
    vl v;                                                                      \
    rep(i, n) {                                                                \
        ll x;                                                                  \
        cin >> x;                                                              \
        v.push_back(x);                                                        \
    }
const ll INF = 999999999999999;
const ll MOD = 1000000007;
ll a, b, c, d, e, f, p, t, x, y, z, q, m, n, r, h, k, w, l, ans = 0;
int main() {
    cin>>n;
    inputv(A,n);
    a=accumulate(all(A),0);
    rep(i,n){
        cout<<a-A[i]*(n-1);
        if(i!=n-1)cout<<" ";
        else cout<<endl;
    }

}
0