結果

問題 No.553 AlphaCoder Rating
ユーザー beetbeet
提出日時 2017-08-11 22:52:16
言語 C++11
(gcc 11.4.0)
結果
AC  
実行時間 2 ms / 1,500 ms
コード長 847 bytes
コンパイル時間 1,088 ms
コンパイル使用メモリ 146,108 KB
実行使用メモリ 4,380 KB
最終ジャッジ日時 2023-08-02 23:16:25
合計ジャッジ時間 2,064 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ(β)

テストケース

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

ソースコード

diff #

#include<bits/stdc++.h>
using namespace std;
#define int long long
double mpow(double x,int n){
  double res=1;
  while(n){
    if(n&1) res*=x;
    x*=x;
    n>>=1;
  }
  return res;
}
double sig(double x,int n){
  return x*(1.0-mpow(x,n))/(1.0-x);
}
double F(int n){
  return sqrt(sig(0.81,n))/sig(0.9,n);
}
double f(int n){
  return (F(n)-F((int)1e18))/(F(1)-F((int)1e18))*1200;
}
double g(double x){
  return pow(2.0,x/800);
}
double gi(double x){
  double l=0,r=1e9;
  for(int i=0;i<200;i++){
    double m=(l+r)/2;
    if(g(m)<=x) l=m;
    else r=m;
  }
  return l;
}
double calc(int n,double* p){
  double res=0,q=1;
  for(int i=0;i<n;i++){
    q*=0.9;
    res+=g(p[i])*q;
  }
  return res/sig(0.9,n);
}
signed main(){
  int n;
  cin>>n;
  double p[n];
  for(int i=0;i<n;i++) cin>>p[i];
  cout<<(int)(gi(calc(n,p))-f(n))<<endl;
  return 0;
}
0