結果

問題 No.970 数列変換マシン
ユーザー i_mrhj
提出日時 2020-01-19 19:31:02
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 37 ms / 2,000 ms
コード長 844 bytes
コンパイル時間 761 ms
コンパイル使用メモリ 90,844 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-07-02 22:01:37
合計ジャッジ時間 2,175 ms
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 22
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <cstdio>
#include <climits>
#include <cmath>
#include <iostream>
#include <iomanip>
#include <string>
#include <cstdio>
#include <climits>
#include <iostream>
#include <algorithm>
#include <string>
#include <vector>
#include <utility>
#include <queue>
#include <cstring>
#include <set>
#define rep(i, n) for (int i = 0; i < int(n); i++)
using namespace std;
long long MOD = 1000000007;
long long INF = 1000000000000000; //10^15
typedef long long ll;
typedef unsigned long long ull;

ll powMod(ll x, ll n) {
  if (n == 0) return 1;
  ll r = powMod(x, n / 2);
  if (n % 2 == 0) return (r * r) % MOD;
  return (r * r % MOD) * x % MOD;
}

int main(void) {

  ll n, y[100010];
  cin >> n;
  rep(i, n) cin >> y[i];

  ll sum = 0;
  rep(i, n) sum += y[i];

  rep(i, n) cout << sum - (n - 1) * y[i] << " ";
  cout << endl;

  return 0;

}

  
0