結果
| 問題 |
No.553 AlphaCoder Rating
|
| ユーザー |
takiteke
|
| 提出日時 | 2017-08-12 01:58:17 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 1,500 ms |
| コード長 | 1,218 bytes |
| コンパイル時間 | 542 ms |
| コンパイル使用メモリ | 71,320 KB |
| 実行使用メモリ | 6,820 KB |
| 最終ジャッジ日時 | 2024-10-12 22:54:33 |
| 合計ジャッジ時間 | 1,265 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 12 |
ソースコード
#define _CRT_SECURE_NO_WARNINGS
#include<iostream>
#include<cstdio>
#include<string>
#include<algorithm>
#include<cmath>
using namespace std;
#define REP(i,n) for(int i=0;(i)<(n);(i)++)
double F(int n) {
double ans = 0, sum = 0;
for (int i = 1;i <= n;i++) {
ans += pow(0.81, i);
sum += pow(0.9, i);
}
ans = sqrt(ans) / sum;
//cout << "sqrt " << ans << endl;
return ans;
}
double f(int n) {
double ans = 0;
ans = (F(n) - 0.229416) / (1 - 0.229416) * 1200;//F(1e8)=0.229416
return ans;
}
double g(double X) {
double ans;
ans = pow(2, X / 800);
return ans;
}
double g_inv(double R) {
double ans;
ans = 800 * log2(R);
return ans;
}
double Rating(int n, int RPerf[]) {
double ans = 0, sum = 0;
for (int i = 1;i <= n;i++) {
ans += g(RPerf[i-1]) * pow(0.9, i);
sum += pow(0.9, i);
}
//cout << ans << " " << sum << endl;
ans = ans / sum;
//cout << ans << endl;
ans = g_inv(ans) - f(n);
//cout << ans << endl;
return ans;
}
int main() {
int N;
int RPerf[102];
cin >> N;
REP(i, N) {
cin >> RPerf[i];
}
int ans = Rating(N, RPerf);
//cout << F(N) << endl << f(N) << endl << g(2000) << endl << g_inv(5.66) << endl;
cout << ans << endl;
//cout << F(1000000) << endl;
return 0;
}
takiteke