結果
問題 |
No.970 数列変換マシン
|
ユーザー |
![]() |
提出日時 | 2020-07-18 02:59:53 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 109 ms / 2,000 ms |
コード長 | 316 bytes |
コンパイル時間 | 2,067 ms |
コンパイル使用メモリ | 194,944 KB |
最終ジャッジ日時 | 2025-01-11 23:53:57 |
ジャッジサーバーID (参考情報) |
judge3 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 22 |
ソースコード
#include <bits/stdc++.h> using namespace std; int main() { int N; cin >> N; vector<long> Y(N); for (int i = 0; i < N; i++) cin >> Y.at(i); long sum = 0; for (auto y : Y) sum += y * (N - 1); sum /= (N - 1); for (int i = 0; i < N; i++) cout << sum - Y.at(i) * (N - 1) << ((i == N - 1) ? "\n" : " "); }