結果
問題 | No.553 AlphaCoder Rating |
ユーザー | TangentDay |
提出日時 | 2017-08-12 00:03:05 |
言語 | C++11 (gcc 11.4.0) |
結果 |
AC
|
実行時間 | 25 ms / 1,500 ms |
コード長 | 1,314 bytes |
コンパイル時間 | 828 ms |
コンパイル使用メモリ | 75,812 KB |
実行使用メモリ | 4,384 KB |
最終ジャッジ日時 | 2023-08-03 00:13:14 |
合計ジャッジ時間 | 1,950 ms |
ジャッジサーバーID (参考情報) |
judge12 / judge11 |
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 24 ms
4,376 KB |
testcase_01 | AC | 25 ms
4,380 KB |
testcase_02 | AC | 23 ms
4,380 KB |
testcase_03 | AC | 24 ms
4,380 KB |
testcase_04 | AC | 24 ms
4,380 KB |
testcase_05 | AC | 24 ms
4,380 KB |
testcase_06 | AC | 24 ms
4,380 KB |
testcase_07 | AC | 25 ms
4,380 KB |
testcase_08 | AC | 25 ms
4,380 KB |
testcase_09 | AC | 24 ms
4,380 KB |
testcase_10 | AC | 25 ms
4,380 KB |
testcase_11 | AC | 24 ms
4,380 KB |
testcase_12 | AC | 25 ms
4,380 KB |
testcase_13 | AC | 23 ms
4,384 KB |
testcase_14 | AC | 24 ms
4,380 KB |
ソースコード
#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; }