結果

問題 No.553 AlphaCoder Rating
ユーザー sugim48sugim48
提出日時 2017-08-11 22:45:49
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 25 ms / 1,500 ms
コード長 738 bytes
コンパイル時間 1,667 ms
コンパイル使用メモリ 166,020 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-04-20 23:06:32
合計ジャッジ時間 2,685 ms
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

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

#define rep(i, N) for (int i = 0; i < N; i++)
typedef long long ll;
const int MOD = 1e9 + 7;
const ll INF = LLONG_MAX / 2;

int main() {
	int N; cin >> N;
	vector<int> a(N);
	rep(i, N) cin >> a[i];
	vector<double> F(1000 + 1);
	for (int n = 1; n <= 1000; n++) {
		double x = 0, y = 0;
		for (int i = 1; i <= n; i++)
			x += pow(0.81, i), y += pow(0.9, i);
		F[n] = sqrt(x) / y;
	}
	vector<double> f(N + 1);
	for (int n = 1; n <= N; n++)
		f[n] = (F[n] - F[1000]) / (F[1] - F[1000]) * 1200;
	double x = 0, y = 0;
	for (int i = 1; i <= N; i++) {
		x += pow(2, a[i - 1] / 800.0) * pow(0.9, i);
		y += pow(0.9, i);
	}
	double ans = log(x / y) / log(2) * 800 - f[N];
	cout << (int)ans << endl;
}
0