結果

問題 No.553 AlphaCoder Rating
ユーザー femtofemto
提出日時 2017-08-11 23:18:21
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 209 ms / 1,500 ms
コード長 712 bytes
コンパイル時間 1,746 ms
コンパイル使用メモリ 162,944 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-04-20 23:34:07
合計ジャッジ時間 5,462 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;

double F(int n){
	double a = 0, b = 0;
	double c = 0.81, d = 0.9;
	for(int i = 0; i < n; i++) {
		a += c;
		b += d;
		c *= 0.81;
		d *= 0.9;
	}
	return sqrt(a) / b;
}

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

double g(double X){
	return pow(2, X / 800.0);
}

double R[100];

int main() {
	cin.tie(0);
	ios::sync_with_stdio(false);

	int N;
	cin >> N;
	for(int i = 0; i < N; i++) {
		cin >> R[i];
	}

	double a = 0, b = 0;
	double c = 0.9;
	for(int i = 0; i < N; i++) {
		a += g(R[i]) * c;
		b += c;
		c *= 0.9;
	}

	double t1 = 800 * (log2(a) - log2(b)), t2 = f(N);
	cout << (int)round(t1 - t2) << endl;
}
0