結果
| 問題 |
No.553 AlphaCoder Rating
|
| コンテスト | |
| ユーザー |
momoyuu
|
| 提出日時 | 2022-08-24 01:48:47 |
| 言語 | C++23 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 1,500 ms |
| コード長 | 1,400 bytes |
| コンパイル時間 | 3,127 ms |
| コンパイル使用メモリ | 246,888 KB |
| 実行使用メモリ | 5,248 KB |
| 最終ジャッジ日時 | 2024-10-11 07:43:32 |
| 合計ジャッジ時間 | 4,026 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 12 |
ソースコード
#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;
}
momoyuu