結果

問題 No.553 AlphaCoder Rating
ユーザー mai
提出日時 2017-08-04 10:58:35
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 4 ms / 1,500 ms
コード長 1,107 bytes
コンパイル時間 2,183 ms
コンパイル使用メモリ 196,660 KB
最終ジャッジ日時 2025-01-05 02:03:58
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 12
権限があれば一括ダウンロードができます

ソースコード

diff #

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

typedef float numeric;

numeric large_f_inf;

numeric large_f(int n){
    numeric num = 0;
    numeric den = 0;
    
    for (int i = 1; i <= n; ++i){
        num += pow(0.81, (numeric)i);
        den += pow(0.9, (numeric)i);
    }
    return sqrt(num)/den;
}

numeric small_f(int n){
    return 1200*(large_f(n) - large_f_inf) / (large_f(1) - large_f_inf);
}

numeric g(numeric x){
    return pow(2.0, x/800.0);
}

numeric g_inv(numeric y){
    return 800.0*log2(y);
}

numeric rating(vector<numeric>& rperf){
    int n = rperf.size();
    numeric num = 0;
    numeric den = 0;
    for (int i = 1; i <= n; ++i){
        num += g(rperf[i-1])*pow(0.9, (numeric)i);
        den += pow(0.9, (numeric)i);
    }
    return g_inv(num/den) - small_f(n);
}


void initialize(){
    large_f_inf = large_f(10000);
}

int main(){
    initialize();
    
    int n;
    cin >> n;
    vector<numeric> pf;
    
    for (int i = 0; i < n; ++i){
        double p;
        cin >> p;
        pf.push_back(p);
    }
    
    cout << floor(rating(pf)) << endl;
    
    return 0;
}
0