結果
問題 | No.553 AlphaCoder Rating |
ユーザー | pekempey |
提出日時 | 2017-08-11 23:38:20 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 3 ms / 1,500 ms |
コード長 | 548 bytes |
コンパイル時間 | 775 ms |
コンパイル使用メモリ | 91,264 KB |
最終ジャッジ日時 | 2025-01-05 02:15:12 |
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 12 |
ソースコード
#include <iostream> #include <algorithm> #include <vector> #include <cmath> using namespace std; double P(double x, int n) { return (1 - pow(x, n)) / (1 - x) * 0.9; } double F(int n) { return sqrt(P(0.81, n)) / P(0.9, n); } double f(int n) { return (F(n) - F(1000)) / (F(1) - F(1000)) * 1200; } int main() { int n; cin >> n; double ans = 0; for (int i = 1; i <= n; i++) { double r; cin >> r; ans += pow(2, r / 800) * pow(0.9, i); } ans /= P(0.9, n); ans = 800 * log2(ans) - f(n); cout << int(ans) << endl; }