結果
問題 | No.454 逆2乗和 |
ユーザー |
![]() |
提出日時 | 2016-12-05 00:44:17 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 390 bytes |
コンパイル時間 | 1,116 ms |
コンパイル使用メモリ | 159,708 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-11-30 02:26:54 |
合計ジャッジ時間 | 1,967 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 31 |
ソースコード
#include <bits/stdc++.h>using namespace std;double trigamma(double x){x += 7;double p = 1 / x / x;p = (((((p * 5 / 66 - 1.0 / 30) * p + 1.0 / 42) * p - 1.0 / 30) * p + 1.0 / 6) * p + 1) / x + p / 2.0;for(int i = 0; i < 6; i++) {p = 1 / --x / x + p;}return (p);}int main(){double x;cin >> x;cout << fixed << setprecision(15) << trigamma(x) << endl;}