結果

問題 No.553 AlphaCoder Rating
ユーザー kotatsugame
提出日時 2017-08-11 23:39:39
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 565 ms / 1,500 ms
コード長 503 bytes
コンパイル時間 1,714 ms
コンパイル使用メモリ 167,196 KB
実行使用メモリ 6,820 KB
最終ジャッジ日時 2024-10-12 22:06:35
合計ジャッジ時間 11,353 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 12
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp:20:1: warning: ISO C++ forbids declaration of 'main' with no type [-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