結果

問題 No.553 AlphaCoder Rating
ユーザー どららどらら
提出日時 2017-08-12 00:17:25
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 2 ms / 1,500 ms
コード長 918 bytes
コンパイル時間 1,572 ms
コンパイル使用メモリ 166,588 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-04-21 00:12:32
合計ジャッジ時間 2,320 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
#define REP(i,a,n) for(int i=(a); i<(int)(n); i++)
#define rep(i,n) REP(i,0,n)
#define FOR(it,c) for(__typeof((c).begin()) it=(c).begin(); it!=(c).end(); ++it)
#define ALLOF(c) (c).begin(), (c).end()
typedef long long ll;
typedef unsigned long long ull;

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

double invg(double g){
  return 800.0 * (log(g)/log(2.0));
}

int main(){
  int N;
  cin >> N;
  vector<double> v;
  rep(i,N){
    double a;
    cin >> a;
    v.push_back(a);
  }

  double finf = 0.229415733870562;
  double f1 = 1.0;
  
  double a = 0;
  double b = 0;
  double c = 0;
  REP(i,1,N+1){
    double tmp = pow(0.9, i);
    a += g(v[i-1]) * tmp;
    b += tmp;
    c += pow(0.81, i);
  }

  double fn = (sqrt(c) / b) - finf;
  fn /= (f1 - finf);
  fn *= 1200.0;
  
  double rating = invg(a/b);
  rating -= fn;

  cout << (int)rating << endl;
  
  return 0;
}
0