結果

問題 No.553 AlphaCoder Rating
ユーザー t98slidert98slider
提出日時 2023-07-18 19:31:38
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 2 ms / 1,500 ms
コード長 885 bytes
コンパイル時間 1,604 ms
コンパイル使用メモリ 167,716 KB
実行使用メモリ 4,348 KB
最終ジャッジ日時 2023-10-18 22:50:20
合計ジャッジ時間 2,529 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

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

int main(){
    ios::sync_with_stdio(false);
    cin.tie(0);
    int N, v;
    cin >> N;
    auto F = [&](int n){
       double num = 0, div = 0, d = 1, d2 = 1;
        for(int i = 0; i < n; i++){
            d *= 0.81;
            d2 *= 0.9;
            num += d;
            div += d2;
        }
        return sqrt(num) / div;
    };
    auto f = [&](int n){
        double a = F(n), b = F(1 << 10);
        return (a - b) / (1 - b) * 1200;
    };
    auto g = [&](int X){
        return pow(2.0, X / 800.0);
    };
    auto inv_g = [&](double X){
        return log2(X) * 800;
    };
    double num = 0, div = 0, d = 1;
    for(int i = 0; i < N; i++){
        cin >> v;
        d *= 0.9;
        num += g(v) * d;
        div += d;
    }
    cout << fixed << setprecision(15) << inv_g(num / div) - f(N) << '\n';
}
0