結果

問題 No.553 AlphaCoder Rating
ユーザー ats5515ats5515
提出日時 2017-08-11 22:31:46
言語 C++11
(gcc 11.4.0)
結果
AC  
実行時間 3 ms / 1,500 ms
コード長 729 bytes
コンパイル時間 544 ms
コンパイル使用メモリ 67,292 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-04-20 22:47:18
合計ジャッジ時間 1,275 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
5,248 KB
testcase_01 AC 2 ms
5,376 KB
testcase_02 AC 2 ms
5,376 KB
testcase_03 AC 2 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 3 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 3 ms
5,376 KB
testcase_13 AC 2 ms
5,376 KB
testcase_14 AC 2 ms
5,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <algorithm>
#include <cstdlib>
#include <iostream>
#include <vector>
#include <math.h>
using namespace std;
#define int long long
double f(int n) {
	double s1 = 0;
	double s2 = 0;
	for (int i = 1; i <= n; i++) {
		s1 += pow(0.81, i);
		s2 += pow(0.9, i);
	}
	return sqrt(s1) / s2;
}
signed main() {
	int N;
	cin >> N;
	vector<double> A(N);
	for (int i = 0; i < N; i++) {
		cin >> A[i];
	}
	double f1, fn, fi;

	f1 = f(1);
	fn = f(N);
	fi = f(10000);
	double ff = ((fn - fi) / (f1 - fi)) * 1200;
	double res;
	double s1 = 0;
	double s2 = 0;
	for (int i = 1; i <= N; i++) {
		s1 += pow(2, A[i - 1] / 800)*pow(0.9, i);
		s2 += pow(0.9, i);
	}
	res = 800 * log2(s1 / s2) - ff;
	cout << (int)(res + 0.5) << endl;
	return 0;
}
0