結果
| 問題 |
No.553 AlphaCoder Rating
|
| ユーザー |
|
| 提出日時 | 2017-08-11 23:23:34 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 1,500 ms |
| コード長 | 789 bytes |
| コンパイル時間 | 1,257 ms |
| コンパイル使用メモリ | 158,632 KB |
| 実行使用メモリ | 6,820 KB |
| 最終ジャッジ日時 | 2024-10-12 21:56:37 |
| 合計ジャッジ時間 | 1,980 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 12 |
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:11:14: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
11 | scanf("%d",&n);
| ~~~~~^~~~~~~~~
main.cpp:13:22: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
13 | scanf("%d",&rpref[i]);
| ~~~~~^~~~~~~~~~~~~~~~
ソースコード
#include <bits/stdc++.h>
#define MOD 1000000007LL
using namespace std;
typedef long long ll;
typedef pair<int,int> P;
int n;
int rpref[101];
int main(void){
scanf("%d",&n);
for(int i=0;i<n;i++){
scanf("%d",&rpref[i]);
}
double l=0;
double r=0;
for(int i=1;i<=n;i++){
l+=pow(2.0,(double)rpref[i-1]/800.0)*pow(0.9,(double)i);
r+=pow(0.9,double(i));
//printf("%.5f %.5f\n",l,r);
}
double gr=800.0*log2(l/r);
double l2=0.0;
for(int i=1;i<=n;i++){
l2+=pow(0.81,(double)i);
}
double Fn=sqrt(l2)/r;
l=0.0;
r=0.0;
for(int i=1;i<=1000;i++){
l+=pow(0.81,(double)i);
r+=pow(0.9,(double)i);
//if(i<=50)printf("%.5f %.5f\n",l,r);
}
double Fp=sqrt(l)/r;
double fn=(Fn-Fp)/(1.0-Fp)*1200.0;
//printf("%.5f %.5f\n",gr,Fp);
printf("%d\n",(int)(gr-fn+0.5));
return 0;
}