結果
| 問題 |
No.553 AlphaCoder Rating
|
| コンテスト | |
| ユーザー |
Konton7
|
| 提出日時 | 2020-02-02 00:55:12 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 1,500 ms |
| コード長 | 1,287 bytes |
| コンパイル時間 | 1,867 ms |
| コンパイル使用メモリ | 195,624 KB |
| 最終ジャッジ日時 | 2025-01-08 21:46:29 |
|
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 12 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using PII = std::pair<int, int>;
using PLL = std::pair<ll, ll>;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rep2(i, s, n) for (int i = (s); i < (int)(n); i++)
// #define DEBUG
double const f1inf = sqrt(1 / 0.19) / 10;
double f1(int n)
{
double s1, s2, s;
s1 = s2 = 0;
s = 1;
rep(i, n)
{
s *= 0.9;
s1 += s;
s2 += s * s;
}
return sqrt(s2) / s1;
}
double f(int n)
{
return 1200.0 * (f1(n) - f1inf) / (f1(1) - f1inf);
}
double g(int x)
{
return pow(2.0, ((1.0 * x) / 800.0));
}
double g_inv(double x)
{
return 800.0 * log2(x);
}
double h(int n, vector<int> perf)
{
double s, t;
s = 0;
t = 1;
rep(i, n)
{
t *= 0.9;
s += t * g(perf[i]);
}
return s;
}
double rating(int n, vector<int> perf)
{
return g_inv(h(n, perf) / (9.0 * (1 - pow(0.9, n)))) - f(n);
}
int main()
{
#ifdef DEBUG
cout << "DEBUG MODE" << endl;
ifstream in("input.txt"); //for debug
cin.rdbuf(in.rdbuf()); //for debug
#endif
int n, p;
vector<int> perf;
cin >> n;
rep(i, n)
{
cin >> p;
perf.push_back(p);
}
printf("%.0f\n", rating(n, perf));
return 0;
}
Konton7