結果
| 問題 | No.454 逆2乗和 |
| コンテスト | |
| ユーザー |
hotpepsi
|
| 提出日時 | 2016-12-05 01:22:01 |
| 言語 | C++11 (gcc 15.2.0 + boost 1.89.0) |
| 結果 |
AC
|
| 実行時間 | 29 ms / 2,000 ms |
| コード長 | 365 bytes |
| 記録 | |
| コンパイル時間 | 431 ms |
| コンパイル使用メモリ | 76,212 KB |
| 実行使用メモリ | 6,400 KB |
| 最終ジャッジ日時 | 2026-05-23 19:37:34 |
| 合計ジャッジ時間 | 2,572 ms |
|
ジャッジサーバーID (参考情報) |
judge1_0 / judge3_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 31 |
ソースコード
#include <iostream>
#include <sstream>
#include <algorithm>
#include <cstdio>
using namespace std;
typedef long double LD;
int main(int argc, char *argv[]) {
cout.precision(16);
LD x;
cin >> x;
LD ans = 1.6449340668482264;
for (int n = 10000000; n > 0; --n) {
ans += 1 / ((x + n) * (x + n));
ans -= 1 / ((LD)n * n);
}
cout << ans << endl;
return 0;
}
hotpepsi