結果

問題 No.553 AlphaCoder Rating
ユーザー yukudoyukudo
提出日時 2017-08-11 23:13:16
言語 C++11
(gcc 11.4.0)
結果
AC  
実行時間 2 ms / 1,500 ms
コード長 1,379 bytes
コンパイル時間 1,280 ms
コンパイル使用メモリ 159,344 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-04-20 23:28:44
合計ジャッジ時間 1,962 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;

typedef long long ll;
#define REP(i,n) for(int i=0,_n=(int)(n);i<_n;++i)
#define ALL(v) (v).begin(),(v).end()
template<class T1,class T2>ostream& operator<<(ostream& os,const pair<T1,T2>&a){return os<<"("<<a.first<<","<<a.second<< ")";}
template<class T>void pv(T a,T b){for(T i=a;i!=b;++i)cout<<(*i)<<" ";cout<<endl;}
template<class T>bool chmin(T&a,const T&b){return a>b?(a=b,1):0;}
template<class T>bool chmax(T&a,const T&b){return a<b?(a=b,1):0;}

double RPerf[111];

double F[1000];
double f[1000];

double g(double X) {
  return pow(2.0, X / 800);
}
double g_inv(double y) {
  return 800 * log(y) / log(2);
}

int main2() {
  int N; cin >> N;
  REP(i, N) cin >> RPerf[i];

  {
    double p81 = 1;
    double p9 = 1;
    double a = 0;
    double b = 0;
    for (int i = 1; i < 1000; i++) {
      p81 *= 0.81;
      a += p81;
      p9 *= 0.9;
      b += p9;
      F[i] = sqrt(a) / b;
    }
  }
  {
    for (int i = 1; i < 1000; i++) {
      f[i] = 1200 * (F[i] - F[999]) / (F[1] - F[999]);
    }
  }
  {
    double sg = 0;
    double b = 0;
    double p9 = 1;
    for (int i = 1; i <= N; i++) {
      p9 *= 0.9;
      sg += (g(RPerf[i-1]) * p9);
      b += p9;
    }
    double ans = g_inv(sg / b) - f[N];
    cout << (int)(ans + 0.5) << endl;
  }
  return 0;
}

int main() {
  for (;!cin.eof();cin>>ws) main2();
  return 0;
}

0