結果

問題 No.553 AlphaCoder Rating
ユーザー kotatsugamekotatsugame
提出日時 2017-08-11 23:39:39
言語 C++14
(gcc 13.2.0 + boost 1.83.0)
結果
AC  
実行時間 649 ms / 1,500 ms
コード長 503 bytes
コンパイル時間 1,373 ms
コンパイル使用メモリ 164,944 KB
実行使用メモリ 4,380 KB
最終ジャッジ日時 2023-08-02 23:57:50
合計ジャッジ時間 12,727 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 643 ms
4,380 KB
testcase_01 AC 639 ms
4,376 KB
testcase_02 AC 644 ms
4,376 KB
testcase_03 AC 647 ms
4,376 KB
testcase_04 AC 640 ms
4,376 KB
testcase_05 AC 649 ms
4,380 KB
testcase_06 AC 649 ms
4,376 KB
testcase_07 AC 643 ms
4,376 KB
testcase_08 AC 645 ms
4,380 KB
testcase_09 AC 641 ms
4,376 KB
testcase_10 AC 643 ms
4,376 KB
testcase_11 AC 642 ms
4,376 KB
testcase_12 AC 643 ms
4,376 KB
testcase_13 AC 631 ms
4,376 KB
testcase_14 AC 638 ms
4,376 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp:20:1: 警告: ISO C++ では型の無い ‘main’ の宣言を禁止しています [-Wreturn-type]
   20 | main()
      | ^~~~

ソースコード

diff #

#include<bits/stdc++.h>
using namespace std;
double F(int n){
	double a=0,b=0;int i=0;
	for(;i++<n;)a+=powl(0.81,i),b+=pow(0.9,i);
	return sqrt(a)/b;
}
double Fi;
double f(int n)
{
	return (F(n)-Fi)/(F(1)-Fi)*12e2;
}
double g(double x){
	return pow(2,x/800);
}
double iG(double x)
{
	return 800*log2(x);
}
main()
{
	double x[150],r,G,H;
	int i=0,j,n;
	for(scanf("%d",&n);i<n;i++)cin>>x[i];
	j=G=H=0;
	Fi=F(1e6);
	for(;j++<n;)G+=g(x[j-1])*pow(0.9,j),H+=pow(0.9,j);
	r=iG(G/H)-f(n);
	printf("%.lf\n",r);
}
0