結果

問題 No.553 AlphaCoder Rating
ユーザー momoyuumomoyuu
提出日時 2022-08-24 01:48:47
言語 C++23
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 2 ms / 1,500 ms
コード長 1,400 bytes
コンパイル時間 3,281 ms
コンパイル使用メモリ 276,328 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-04-19 15:35:58
合計ジャッジ時間 4,154 ms
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

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

using ll = long long;
using ull = unsigned long long;
using ld = long double;
template<class t> using vc = vector<t>;
template<class t> using vvc = vc<vc<t>>;
using pi = pair<int,int>;
using vi = vc<int>;
using vvi = vvc<int>;

#define rep(i,a,b) for (int i = a; i < b; i++)
#define irep(i,a,b) for (int i = a; i > b; i--)
#define print(n) cout << n << '\n'
#define pritn(n) print(n)
#define rup(a,b) (a+b-1)/b
#define input(A,N) rep(i,0,N) cin>>A[i];

ld F(ld n){
    if (n == -1){
        ld ans = sqrt(0.81/(1-0.81));
        ans /= (0.9/(1-0.9));
        return ans;
    }
    ld ans = 0;
    ld now = 1;
    rep(i,0,n){
        now *= 0.81;
        ans += now;
    }
    ans = sqrt(ans);
    ld nn = 0;
    now = 1;
    rep(i,0,n){
        now *= 0.9;
        nn += now;
    }
    ans/= nn;
    return ans;
}

ld f(ld n){
    ld ans = 1200;
    ans *= (F(n)-F(-1));
    ans /= (F(1)-F(-1));
    return ans;
}

ld g(ld n){
    return pow(2,n/800);
}
ld gi(ld x){
    return 800*log2l(x);
}


int main(){
    cout << fixed << setprecision(15);
    
    int N;
    cin >> N;
    vc<ld> p(N);
    input(p,N);
    ld ans = 0;
    ld now = 1;
    ld n = 0;
    rep(i,0,N){
        now *= 0.9;
        ans += g(p[i])*now;
        n += now;
    }
    ans /= n;
    ans = gi(ans);
    ans -= f(N);
    print(ll(ans));

    //system("pause");
    return 0;
}
0