結果
問題 | No.553 AlphaCoder Rating |
ユーザー |
|
提出日時 | 2021-02-17 18:42:11 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 6 ms / 1,500 ms |
コード長 | 894 bytes |
コンパイル時間 | 2,319 ms |
コンパイル使用メモリ | 197,716 KB |
最終ジャッジ日時 | 2025-01-18 21:51:11 |
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 12 |
ソースコード
#include <bits/stdc++.h>using namespace std;const int INF = 1<<30;double gsum(double a, int n) {return n == INF ? a / (1-a) : (a - pow(a, n+1)) / (1 - a);}double F(int n) {double num = sqrt(gsum(0.81, n));double den = gsum(0.9, n);return num / den;}double f(int n) {return (F(n) - F(INF)) / (F(1) - F(INF)) * 1200;}double g(double x) {return pow(2.0, x/800);}double invg(double x) {return 800 * log(x) / log(2.0);}double rating(const vector<double> perf) {int n = perf.size();double sum = 0;for (int i = 0; i < n; i++)sum += g(perf[i]) * pow(0.9, i + 1);sum /= gsum(0.9, n);return invg(sum) - f(n);}int main() {ios_base::sync_with_stdio(0);cin.tie(0);int n;cin >> n;vector<double> perf(n);for (int i = 0; i < n; i++)cin >> perf[i];int ret = rating(perf) + 0.5;cout << ret << endl;return 0;}