結果

問題 No.454 逆2乗和
ユーザー ei1333333ei1333333
提出日時 2016-12-05 00:29:08
言語 C++11
(gcc 13.3.0)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 480 bytes
コンパイル時間 1,137 ms
コンパイル使用メモリ 159,708 KB
実行使用メモリ 6,824 KB
最終ジャッジ日時 2024-11-30 02:26:51
合計ジャッジ時間 2,000 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 31
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>

using namespace std;


double trigamma(double x)
{
  double p;
  int i;
  x += 7;
  p = 1 / (x * x);
  p = (((((0.075757575757576 * p - 0.033333333333333) * p + 0.0238095238095238)
         * p - 0.033333333333333) * p + 0.166666666666667) * p + 1) / x + 0.5 * p;
  for(int i = 0; i < 6; i++) {
    x = x - 1;
    p = 1 / (x * x) + p;
  }
  return (p);
}

int main()
{
  double x;
  cin >> x;
  cout << fixed << setprecision(15) << trigamma(x) << endl;
}
0