結果

問題 No.1131 Deviation Score
ユーザー testtest
提出日時 2020-09-12 23:42:06
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 176 ms / 2,000 ms
コード長 574 bytes
コンパイル時間 1,988 ms
コンパイル使用メモリ 200,792 KB
実行使用メモリ 4,564 KB
最終ジャッジ日時 2023-09-10 12:31:11
合計ジャッジ時間 5,263 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 39 ms
4,384 KB
testcase_01 AC 4 ms
4,376 KB
testcase_02 AC 156 ms
4,380 KB
testcase_03 AC 72 ms
4,376 KB
testcase_04 AC 145 ms
4,380 KB
testcase_05 AC 53 ms
4,380 KB
testcase_06 AC 156 ms
4,380 KB
testcase_07 AC 74 ms
4,380 KB
testcase_08 AC 135 ms
4,384 KB
testcase_09 AC 51 ms
4,376 KB
testcase_10 AC 128 ms
4,376 KB
testcase_11 AC 132 ms
4,380 KB
testcase_12 AC 117 ms
4,380 KB
testcase_13 AC 152 ms
4,376 KB
testcase_14 AC 32 ms
4,376 KB
testcase_15 AC 33 ms
4,376 KB
testcase_16 AC 140 ms
4,400 KB
testcase_17 AC 57 ms
4,380 KB
testcase_18 AC 176 ms
4,564 KB
testcase_19 AC 2 ms
4,380 KB
testcase_20 AC 2 ms
4,376 KB
testcase_21 AC 2 ms
4,380 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
#define rep(i, ss, ee) for (int i = ss; i < ee; ++i)
using namespace std;
using Vd = vector<double>;

void calcDeviationScore(const Vd &v, Vd &r, const int &sum) {
  double ave = (double)sum / (double)v.size();
  rep(i, 0, size(v)) r[i] = (int)(50.0 - (ave - v[i]) / 2.0);
}

void solve() {
  int N, sum = 0;
  cin >> N;
  Vd v(N), r(N);
  for (auto &e : v) {
    cin >> e;
    sum += e;
  }
  calcDeviationScore(v, r, sum);
  for (auto e : r) cout << e << endl;
}

int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  solve();
  getchar();
}
0