結果
問題 |
No.970 数列変換マシン
|
ユーザー |
|
提出日時 | 2020-09-01 22:27:56 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 502 bytes |
コンパイル時間 | 1,561 ms |
コンパイル使用メモリ | 169,392 KB |
実行使用メモリ | 6,824 KB |
最終ジャッジ日時 | 2024-11-20 19:27:14 |
合計ジャッジ時間 | 2,594 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 3 WA * 19 |
ソースコード
#include <algorithm> #include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define all(x) (x).begin(), (x).end() #define ll long long #define INF 1000000000000000000 int main() { cin.tie(0); ios::sync_with_stdio(false); int N; cin >> N; vector<int> y(N); ll sum = 0; rep(i, N) { cin >> y[i]; sum += y[i] * (N - 1); } sum /= 2; rep(i, N) { cout << sum - y[i] * (N - 1) << " "; } cout << endl; }