結果
問題 | No.970 数列変換マシン |
ユーザー | mhrb_minase |
提出日時 | 2020-01-17 21:47:00 |
言語 | C++14 (gcc 12.3.0 + boost 1.83.0) |
結果 |
AC
|
実行時間 | 17 ms / 2,000 ms |
コード長 | 1,945 bytes |
コンパイル時間 | 917 ms |
コンパイル使用メモリ | 100,132 KB |
実行使用メモリ | 4,380 KB |
最終ジャッジ日時 | 2023-09-08 02:17:02 |
合計ジャッジ時間 | 2,760 ms |
ジャッジサーバーID (参考情報) |
judge13 / judge11 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 17 ms
4,376 KB |
testcase_01 | AC | 17 ms
4,380 KB |
testcase_02 | AC | 17 ms
4,376 KB |
testcase_03 | AC | 15 ms
4,376 KB |
testcase_04 | AC | 16 ms
4,376 KB |
testcase_05 | AC | 16 ms
4,380 KB |
testcase_06 | AC | 13 ms
4,376 KB |
testcase_07 | AC | 15 ms
4,376 KB |
testcase_08 | AC | 15 ms
4,376 KB |
testcase_09 | AC | 1 ms
4,376 KB |
testcase_10 | AC | 1 ms
4,376 KB |
testcase_11 | AC | 2 ms
4,376 KB |
testcase_12 | AC | 1 ms
4,376 KB |
testcase_13 | AC | 2 ms
4,380 KB |
testcase_14 | AC | 2 ms
4,376 KB |
testcase_15 | AC | 1 ms
4,380 KB |
testcase_16 | AC | 2 ms
4,376 KB |
testcase_17 | AC | 1 ms
4,376 KB |
testcase_18 | AC | 1 ms
4,380 KB |
testcase_19 | AC | 2 ms
4,376 KB |
testcase_20 | AC | 2 ms
4,376 KB |
testcase_21 | AC | 2 ms
4,380 KB |
testcase_22 | AC | 2 ms
4,376 KB |
testcase_23 | AC | 2 ms
4,380 KB |
testcase_24 | AC | 1 ms
4,376 KB |
ソースコード
#include<algorithm> #include<bitset> #include<cassert> #include<cfloat> #include<climits> #include<cmath> #include<deque> #include<functional> #include<iomanip> #include<iostream> #include<map> #include<queue> #include<set> #include<stack> #include<string> #include<unordered_map> #include<unordered_set> #include<utility> #include<vector> using namespace std; using lint = long long; using P = pair<int, int>; using LLP = pair<long long, long long>; #define REP(i, x, n) for(int i = (x), i##_len = (int)(n) ; i < i##_len ; ++i) #define rep(i, n) for(int i = 0, i##_len = (int)(n) ; i < i##_len ; ++i) #define reps(i, n) for(int i = 1, i##_len = (int)(n) ; i <= i##_len ; ++i) #define rrep(i, n) for(int i = (int)(n) - 1 ; i >= 0 ; --i) #define rreps(i, n) for(int i = (int)(n) ; i > 0 ; --i) #define SORT(x) sort((x).begin(), (x).end()) #define SORT_INV(x) sort((x).rbegin(), (x).rend()) #define REVERSE(x) reverse((x).begin(), (x).end()) #define TWINS(x) cout << ((x) ? "Yay!" : ":(") << '\n' #define endl '\n' constexpr int IINF = (1 << 30) - 1; constexpr long long LLINF = 1LL << 61; constexpr double EPS = 1e-10; constexpr int dx4[] = {1, 0, -1, 0}, dy4[] = {0, 1, 0, -1}; constexpr int dx8[] = {1, 1, 0, -1, -1, -1, 0, 1}, dy8[] = {0, -1, -1, -1, 0, 1, 1, 1}; template<typename T> bool chmax(T& a, T b){ if(a < b){ a = b; return true; } return false; } template<typename T> bool chmin(T& a, T b){ if(b < a){ a = b; return true; } return false; } int main(){ cin.tie(0); ios::sync_with_stdio(false); cout << fixed << setprecision(10); int n; cin >> n; vector<int> y(n); int sum = 0; rep(i, n){ cin >> y[i]; sum += y[i]; } vector<int> x(n); rep(i, n){ x[i] = sum-(n-1)*y[i]; } rep(i, n){ if(i) cout << ' '; cout << x[i]; } cout << endl; cout << flush; return 0; }