結果
| 問題 |
No.454 逆2乗和
|
| コンテスト | |
| ユーザー |
risujiroh
|
| 提出日時 | 2019-09-07 17:05:17 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 257 ms / 2,000 ms |
| コード長 | 453 bytes |
| コンパイル時間 | 1,513 ms |
| コンパイル使用メモリ | 167,504 KB |
| 実行使用メモリ | 5,376 KB |
| 最終ジャッジ日時 | 2024-06-26 22:16:28 |
| 合計ジャッジ時間 | 11,789 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 31 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
using lint = long long;
template<class T = int> using V = vector<T>;
template<class T = int> using VV = V< V<T> >;
int main() {
cin.tie(nullptr); ios::sync_with_stdio(false);
constexpr double pi = acos(-1);
double x; cin >> x;
double res = pi * pi / 6;
for (double n = 1; n <= 1e8; ++n) {
res -= x * (x + 2 * n) / pow(n * (x + n), 2);
}
cout << fixed << setprecision(15) << res << '\n';
}
risujiroh