結果

問題 No.553 AlphaCoder Rating
ユーザー myantamyanta
提出日時 2017-08-12 00:01:48
言語 C++11
(gcc 11.4.0)
結果
AC  
実行時間 2 ms / 1,500 ms
コード長 730 bytes
コンパイル時間 869 ms
コンパイル使用メモリ 44,292 KB
実行使用メモリ 4,384 KB
最終ジャッジ日時 2023-08-03 00:12:39
合計ジャッジ時間 1,658 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ(β)

テストケース

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

ソースコード

diff #

#include<cstdio>
#include<vector>
#include<cmath>


using namespace std;
using vi=vector<int>;


double F_inf;


double F(int n)
{
	double u=0.0, l=0.0;
	double tu=1.0, tl=1.0;

	for(int i=0;i<n;i++)
	{
		tu*=0.81;
		tl*=0.9;
		u+=tu;
		l+=tl;
	}
	return sqrt(u)/l;
}


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


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


double g_inv(double x)
{
	return log(x)/log(2)*800;
}


int main(void)
{
	int n;

	F_inf=F(10000);
	while(scanf("%d", &n)==1)
	{
		vi a(n);

		for(int i=0;i<n;i++)
		{
			scanf("%d", &a[i]);
		}

		double u=0.0, l=0.0, t=1.0;
		for(int i=0;i<n;i++)
		{
			t*=0.9;
			u+=g(a[i])*t;
			l+=t;
		}
		printf("%.0f\n", g_inv(u/l)-f(n));
	}

	return 0;
}
0