結果
問題 | No.970 数列変換マシン |
ユーザー |
👑 ![]() |
提出日時 | 2020-01-17 21:40:13 |
言語 | C++17(1z) (gcc 10.2.0 + boost 1.73.0) |
結果 |
AC
|
実行時間 | 19 ms / 2,000 ms |
コード長 | 1,664 Byte |
コンパイル時間 | 2,341 ms |
使用メモリ | 7,028 KB |
最終ジャッジ日時 | 2021-04-10 05:53:06 |
合計ジャッジ時間 | 5,082 ms |
テストケース
テストケース表示入力 | 結果 | 実行時間 使用メモリ |
---|---|---|
testcase_00 | AC | 19 ms
3,820 KB |
testcase_01 | AC | 19 ms
3,864 KB |
testcase_02 | AC | 18 ms
3,828 KB |
testcase_03 | AC | 16 ms
3,940 KB |
testcase_04 | AC | 16 ms
3,960 KB |
testcase_05 | AC | 18 ms
3,828 KB |
testcase_06 | AC | 14 ms
3,896 KB |
testcase_07 | AC | 17 ms
3,908 KB |
testcase_08 | AC | 17 ms
3,876 KB |
testcase_09 | AC | 2 ms
3,524 KB |
testcase_10 | AC | 1 ms
3,552 KB |
testcase_11 | AC | 1 ms
3,472 KB |
testcase_12 | AC | 2 ms
3,504 KB |
testcase_13 | AC | 2 ms
3,480 KB |
testcase_14 | AC | 2 ms
3,584 KB |
testcase_15 | AC | 2 ms
3,428 KB |
testcase_16 | AC | 1 ms
3,440 KB |
testcase_17 | AC | 2 ms
3,560 KB |
testcase_18 | AC | 2 ms
3,556 KB |
testcase_19 | AC | 2 ms
3,612 KB |
testcase_20 | AC | 1 ms
3,460 KB |
testcase_21 | AC | 1 ms
3,468 KB |
testcase_22 | AC | 1 ms
3,512 KB |
testcase_23 | AC | 2 ms
3,580 KB |
testcase_24 | AC | 1 ms
3,460 KB |
ソースコード
#include<bits/stdc++.h> #define rep(i,a,b) for(int i=a;i<b;i++) #define rrep(i,a,b) for(int i=a;i>=b;i--) #define fore(i,a) for(auto &i:a) #define all(x) (x).begin(),(x).end() //#pragma GCC optimize ("-O3") using namespace std; void _main(); int main() { cin.tie(0); ios::sync_with_stdio(false); _main(); } typedef long long ll; const int inf = INT_MAX / 2; const ll infl = 1LL << 60; template<class T>bool chmax(T& a, const T& b) { if (a < b) { a = b; return 1; } return 0; } template<class T>bool chmin(T& a, const T& b) { if (b < a) { a = b; return 1; } return 0; } //--------------------------------------------------------------------------------------------------- /*--------------------------------------------------------------------------------------------------- ∧_∧ ∧_∧ (´<_` ) Welcome to My Coding Space! ( ´_ゝ`) / ⌒i @hamayanhamayan0 / \ | | / / ̄ ̄ ̄ ̄/ | __(__ニつ/ _/ .| .|____ \/____/ (u ⊃ ---------------------------------------------------------------------------------------------------*/ int N, Y[101010]; //--------------------------------------------------------------------------------------------------- void _main() { cin >> N; rep(i, 0, N) cin >> Y[i]; rep(i, 0, N) Y[i] *= N - 1; ll tot = 0; rep(i, 0, N) tot += Y[i]; tot /= N - 1; rep(i, 0, N) { if(i) printf(" "); int x = tot - Y[i]; printf("%d", x); } printf("\n"); }