結果
| 問題 |
No.553 AlphaCoder Rating
|
| ユーザー |
TangentDay
|
| 提出日時 | 2017-08-12 00:03:05 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
AC
|
| 実行時間 | 9 ms / 1,500 ms |
| コード長 | 1,314 bytes |
| コンパイル時間 | 714 ms |
| コンパイル使用メモリ | 82,768 KB |
| 実行使用メモリ | 6,820 KB |
| 最終ジャッジ日時 | 2024-10-12 22:21:25 |
| 合計ジャッジ時間 | 1,424 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 12 |
ソースコード
#include <iostream>
#include <fstream>
#include <cstdio>
#include <cmath>
#include <vector>
#include <cstring>
#include <string>
#include <set>
#include <map>
#include <stack>
#include <queue>
#include <algorithm>
using namespace std;
#define REP(i,n) for(int i=0; i<n; ++i)
#define FOR(i,a,b) for(int i=a; i<=b; ++i)
#define FORR(i,a,b) for (int i=a; i>=b; --i)
#define ALL(c) (c).begin(), (c).end()
typedef long long ll;
typedef vector<int> VI;
typedef vector<ll> VL;
typedef vector<VI> VVI;
typedef vector<VL> VVL;
typedef pair<int,int> P;
typedef pair<ll,ll> PL;
double F(int n){
double a = 0, b = 0;
FOR(i,1,n){
a += pow(0.81, i);
b += pow(0.9, i);
}
return sqrt(a) / b;
}
double f(int n){
return 1200.0 * (F(n) - F(1e5)) / (F(1) - F(1e5));
}
double g(double x){
return pow(2.0, x/800.0);
}
double ginv(double x){
double l = -100, r = 1e9;
REP(i,100){
double mi = (l + r) / 2;
if (g(mi) > x) r = mi;
else l = mi;
}
return l;
}
int main(){
int n;
cin >> n;
double a = 0, b = 0;
REP(i,n){
double p;
cin >> p;
a += g(p) * pow(0.9, (i+1));
b += pow(0.9, (i+1));
}
// cout << ginv(a/b) << " " << f(n) << endl;
printf("%d\n", (int)(ginv(a/b) - f(n)));
return 0;
}
TangentDay