結果

問題 No.553 AlphaCoder Rating
ユーザー tkmst201tkmst201
提出日時 2017-08-11 22:57:48
言語 C++11
(gcc 11.4.0)
結果
AC  
実行時間 39 ms / 1,500 ms
コード長 1,520 bytes
コンパイル時間 1,446 ms
コンパイル使用メモリ 145,432 KB
実行使用メモリ 4,380 KB
最終ジャッジ日時 2023-08-02 23:20:14
合計ジャッジ時間 2,988 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ(β)

テストケース

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

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define REP(i,n) FOR(i,0,n)
#define ALL(v) (v).begin(),(v).end()
#define fi first
#define se second
template<typename A, typename B> inline bool chmax(A &a, B b) { if (a<b) { a=b; return 1; } return 0; }
template<typename A, typename B> inline bool chmin(A &a, B b) { if (a>b) { a=b; return 1; } return 0; }
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef pair<int, pii> pip;
const ll INF = 1ll<<29;
const ll MOD = 1000000007;
const double EPS  = 1e-10;
const bool debug = 0;
//---------------------------------//

int inf;
int N;
int rperf[100];

long double F(int n) {
	long double res = 0;
	
	long double p = 1;
	FOR(i, 1, n + 1) {
		p *= 0.81;
		res += p;
	}
	
	res = sqrt(res);
	
	long double d = 0.0;
	
	p = 1.0;
	FOR(i, 1, n + 1) {
		p *= 0.9;
		d += p;
	}
	
	return res / d;
}

long double f(int n) {
	return (F(n) - F(inf)) / (F(1) - F(inf)) * 1200;
}

long double g(long double x) {
	return pow(2.0, x / 800.0);
}

int main() {
	inf = 100000;
	
	cin >> N;
	REP(i, N) scanf("%d", rperf + i);
	
	long double num = 0.0, p = 1.0;
	FOR(i, 1, N + 1) {
		p *= 0.9;
		num += g(rperf[i - 1]) * p;
	}
	
	long double d = 0.0;
	
	p = 1.0;
	FOR(i, 1, N + 1) {
		p *= 0.9;
		d += p;
	}
	
	num /= d;
	
	long double l = 0.0, r = 10000;
	REP(i, 300) {
		long double m = (l + r) / 2;
		if (g(m) > num) r = m;
		else l = m;
	}
	
	double ans = r - f(N);
	
	printf("%d\n", (int)round(ans));
	
	return 0;
}
0