結果

問題 No.553 AlphaCoder Rating
ユーザー square1001square1001
提出日時 2017-08-11 22:46:08
言語 C++14
(gcc 13.2.0 + boost 1.83.0)
結果
AC  
実行時間 3 ms / 1,500 ms
コード長 601 bytes
コンパイル時間 801 ms
コンパイル使用メモリ 77,264 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-04-20 23:06:48
合計ジャッジ時間 1,725 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#include <cmath>
#include <iomanip>
#include <iostream>
using namespace std;
int n, p[109];
double f(int x) {
	double pa = 0.0, qa = 0.0;
	for (int i = 1; i <= x; i++) {
		pa += pow(0.81, i);
		qa += pow(0.9, i);
	}
	return sqrt(pa) / qa;
}
double g(int x) {
	return pow(2, x / 800.0);
}
int main() {
	cin >> n;
	for (int i = 0; i < n; i++) cin >> p[i];
	double F = (f(n) - f(10000)) / (f(1) - f(10000)) * 1200;
	double pa = 0.0, qa = 0.0;
	for (int i = 0; i < n; i++) {
		pa += g(p[i]) * pow(0.9, i + 1);
		qa += pow(0.9, i + 1);
	}
	cout << (int)(log2(pa / qa) * 800 - F + 0.5) << endl;
	return 0;
}
0