結果

問題 No.553 AlphaCoder Rating
ユーザー takiteketakiteke
提出日時 2017-08-12 01:58:17
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 2 ms / 1,500 ms
コード長 1,218 bytes
コンパイル時間 597 ms
コンパイル使用メモリ 72,052 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-04-21 00:34:30
合計ジャッジ時間 1,225 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
5,248 KB
testcase_01 AC 1 ms
5,376 KB
testcase_02 AC 2 ms
5,376 KB
testcase_03 AC 1 ms
5,376 KB
testcase_04 AC 2 ms
5,376 KB
testcase_05 AC 2 ms
5,376 KB
testcase_06 AC 2 ms
5,376 KB
testcase_07 AC 2 ms
5,376 KB
testcase_08 AC 2 ms
5,376 KB
testcase_09 AC 2 ms
5,376 KB
testcase_10 AC 2 ms
5,376 KB
testcase_11 AC 2 ms
5,376 KB
testcase_12 AC 2 ms
5,376 KB
testcase_13 AC 2 ms
5,376 KB
testcase_14 AC 2 ms
5,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#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;
}
0