結果

問題 No.553 AlphaCoder Rating
ユーザー 0x19f
提出日時 2017-08-14 21:06:20
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
AC  
実行時間 2 ms / 1,500 ms
コード長 794 bytes
コンパイル時間 559 ms
コンパイル使用メモリ 60,108 KB
実行使用メモリ 5,248 KB
最終ジャッジ日時 2024-10-13 10:01:25
合計ジャッジ時間 1,335 ms
ジャッジサーバーID
(参考情報)
judge5 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 12
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <cmath>
#define REP(i, a, n) for(ll i = ((ll) a); i < ((ll) n); i++)
using namespace std;
typedef long long ll;

ll N;
double RPerf[100];

double F(ll n) {
  double p = 0, q = 0;
  REP(i, 0, n) {
    p += pow(0.81, i + 1);
    q += pow(0.9, i + 1);
  }
  return sqrt(p) / q;
}

double f(ll n) {
  double Finf = sqrt(1 / (1 - 0.81)) / (1 / (1 - 0.9));
  return (F(n) - Finf) / (F(1) - Finf) * 1200;
}

double g(double X) {
  return pow(2.0, X / 800.0);
}

double ginv(double X) {
  return 800.0 * log2(X);
}

int main(void) {
  cin >> N;
  REP(i, 0, N) cin >> RPerf[i];

  double s = 0;
  REP(i, 0, N) s += g(RPerf[i]) * pow(0.9, i + 1);

  double t = 0;
  REP(i, 0, N) t += pow(0.9, i + 1);

  double Rating = ginv(s / t) - f(N);
  cout << ((ll) Rating) << endl;
}
0