結果

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

ソースコード

diff #

#include<bits/stdc++.h>

using namespace std;
typedef long long ll;

int main(){ 
  
  int n; cin >> n;
  
  vector<ll> b(n);
  
  ll sum = 0;
  
  for(int i = 0; i < n; i++){ cin >> b[i]; sum += b[i];}
  
  for(int i = 0; i < n; i++){
    cout << sum - (n-1)*b[i] << " ";
  }
  
  cout << endl;
  
  return 0;
}
0