結果
問題 | No.553 AlphaCoder Rating |
ユーザー |
![]() |
提出日時 | 2017-08-11 22:46:08 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 3 ms / 1,500 ms |
コード長 | 601 bytes |
コンパイル時間 | 671 ms |
コンパイル使用メモリ | 77,176 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-10-12 21:30:44 |
合計ジャッジ時間 | 1,410 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 12 |
ソースコード
#include <cmath> #include <iomanip> #include <iostream> using namespace std; int n, p[109]; double f(int x) { double pa = 0.0, qa = 0.0; for (int i = 1; i <= x; i++) { pa += pow(0.81, i); qa += pow(0.9, i); } return sqrt(pa) / qa; } double g(int x) { return pow(2, x / 800.0); } int main() { cin >> n; for (int i = 0; i < n; i++) cin >> p[i]; double F = (f(n) - f(10000)) / (f(1) - f(10000)) * 1200; double pa = 0.0, qa = 0.0; for (int i = 0; i < n; i++) { pa += g(p[i]) * pow(0.9, i + 1); qa += pow(0.9, i + 1); } cout << (int)(log2(pa / qa) * 800 - F + 0.5) << endl; return 0; }