結果
問題 | No.970 数列変換マシン |
ユーザー | face4 |
提出日時 | 2020-01-17 21:28:28 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 35 ms / 2,000 ms |
コード長 | 294 bytes |
コンパイル時間 | 768 ms |
コンパイル使用メモリ | 64,428 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-06-25 18:38:55 |
合計ジャッジ時間 | 1,989 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 22 |
ソースコード
#include<iostream> #include<numeric> using namespace std; int main(){ int n; cin >> n; int a[n]; for(int i = 0; i < n; i++) cin >> a[i]; int sum = accumulate(a, a+n, 0); for(int i = 0; i < n; i++){ cout << sum-a[i]*(n-1) << " \n"[i==n-1]; } return 0; }