結果

問題 No.553 AlphaCoder Rating
ユーザー face4face4
提出日時 2019-02-19 17:45:12
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 2 ms / 1,500 ms
コード長 829 bytes
コンパイル時間 612 ms
コンパイル使用メモリ 70,532 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-04-20 16:18:45
合計ジャッジ時間 1,638 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
5,248 KB
testcase_01 AC 2 ms
5,376 KB
testcase_02 AC 2 ms
5,376 KB
testcase_03 AC 2 ms
5,376 KB
testcase_04 AC 2 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 2 ms
5,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<iostream>
#include<cmath>
using namespace std;

double ginv(double x){
    return 800 * log2(x);
}

double g(double x){
    return pow(2.0, x/800);
}

int main(){
    int n;
    cin >> n;

    double a[101] = {}, b[101] = {};
    a[0] = b[0] = 1;
    for(int i = 1; i < 101; i++)    a[i] = a[i-1]*0.9, b[i] = b[i-1]*0.81;
    double finf = 1.0 / sqrt(19);

    auto f = [&](int k) -> double{
        double s = 0, t = 0;
        for(int i = 1; i <= k; i++) s += b[i], t += a[i];
        s = sqrt(s);
        double u = s/t-finf;
        double v = sqrt(b[1])/a[1]-finf;
        return u * 1200 / v;
    };

    double s = 0, t = 0, r;
    for(int i = 1; i <= n; i++){
        cin >> r;
        s += g(r) * a[i];
        t += a[i];
    }

    double ans = ginv(s/t)-f(n);

    cout << round(ans) << endl;

    return 0;
}
0