結果
問題 |
No.970 数列変換マシン
|
ユーザー |
![]() |
提出日時 | 2020-01-18 02:25:52 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 35 ms / 2,000 ms |
コード長 | 368 bytes |
コンパイル時間 | 1,826 ms |
コンパイル使用メモリ | 193,224 KB |
最終ジャッジ日時 | 2025-01-08 19:49:26 |
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 22 |
ソースコード
#include <bits/stdc++.h> using namespace std; typedef long long ll; #define FOR(I,A,B) for(ll I = ll(A); I < ll(B); ++I) #define FORR(I,A,B) for(ll I = ll((B)-1); I >= ll(A); --I) int main(){ int N,sum=0; cin >> N; vector<int> y(N); FOR(i,0,N)cin>>y[i],sum+=y[i]; FOR(i,0,N){ ll ans = (sum-y[i]) - (N-2)*y[i]; cout << ans << ( i!=N-1 ? ' ' : '\n' ); } }