結果

問題 No.553 AlphaCoder Rating
ユーザー autumn-eel
提出日時 2017-08-11 23:07:45
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 35 ms / 1,500 ms
コード長 592 bytes
コンパイル時間 1,591 ms
コンパイル使用メモリ 167,312 KB
実行使用メモリ 5,248 KB
最終ジャッジ日時 2024-10-12 21:44:47
合計ジャッジ時間 2,768 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 12
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<bits/stdc++.h>
#define rep(i,n)for(int i=0;i<(n);i++)
using namespace std;

double F(int n){
	double a=0,b=0;
	for(int i=1;i<=n;i++){
		a+=pow(0.81,i);
		b+=pow(0.9,i);
	}
	a=sqrt(a);
	return a/b;
}
double t;
double f(int n){
	double a=F(n)-t;
	double b=F(1)-t;
	return (a/b)*1200;
}
double g(double x){
	return pow(2.,x/800);
}
double ag(double x){
	return log2(x)*800;
}
int main() {
	t=F(1000000);
	int n;scanf("%d",&n);
	double a=0,b=0;
	for(int i=1;i<=n;i++){
		double p;scanf("%lf",&p);
		a+=g(p)*pow(0.9,i);
		b+=pow(0.9,i);
	}
	double G=ag(a/b);
	printf("%.0lf\n",G-f(n));
}
0