結果

問題 No.553 AlphaCoder Rating
ユーザー ei1333333ei1333333
提出日時 2017-08-11 23:35:40
言語 C++11
(gcc 11.4.0)
結果
AC  
実行時間 2 ms / 1,500 ms
コード長 815 bytes
コンパイル時間 1,151 ms
コンパイル使用メモリ 159,200 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-04-20 23:46:21
合計ジャッジ時間 1,806 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
5,248 KB
testcase_01 AC 2 ms
5,376 KB
testcase_02 AC 2 ms
5,376 KB
testcase_03 AC 1 ms
5,376 KB
testcase_04 AC 2 ms
5,376 KB
testcase_05 AC 1 ms
5,376 KB
testcase_06 AC 2 ms
5,376 KB
testcase_07 AC 2 ms
5,376 KB
testcase_08 AC 1 ms
5,376 KB
testcase_09 AC 1 ms
5,376 KB
testcase_10 AC 1 ms
5,376 KB
testcase_11 AC 2 ms
5,376 KB
testcase_12 AC 2 ms
5,376 KB
testcase_13 AC 1 ms
5,376 KB
testcase_14 AC 1 ms
5,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<bits/stdc++.h>

using namespace std;

typedef long long int64;

int N, RPerf[100];

double F(int n)
{
  double latte = 0.0, malta = 0.0;
  for(int i = 1; i <= n; i++) latte += pow(0.81, i);
  for(int i = 1; i <= n; i++) malta += pow(0.9, i);
  return (sqrt(latte) / malta);
}

double f(int n)
{
  return ((F(n) - 0.229416) / (F(1) - 0.229416) * 1200.0);
}

double g(double x)
{
  return (pow(2.0, x / 800.0));
}

double g_inv(double x)
{
  return (800.0 * log(x) / log(2));
}

double rating(int n)
{
  double latte = 0.0, malta = 0.0;
  for(int i = 1; i <= N; i++) latte += g(RPerf[i - 1]) * pow(0.9, i);
  for(int i = 1; i <= N; i++) malta += pow(0.9, i);
  return (g_inv(latte / malta) - f(n));
}

int main()
{
  cin >> N;
  for(int i = 0; i < N; i++) cin >> RPerf[i];
  cout << (int)rating(N) << endl;
}
0