結果
問題 |
No.454 逆2乗和
|
ユーザー |
![]() |
提出日時 | 2018-11-06 15:58:55 |
言語 | C++17(gcc12) (gcc 12.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 1,708 ms / 2,000 ms |
コード長 | 610 bytes |
コンパイル時間 | 5,562 ms |
コンパイル使用メモリ | 254,268 KB |
最終ジャッジ日時 | 2025-01-06 15:40:10 |
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 31 |
ソースコード
#include <bits/stdc++.h> using namespace std; using i64 = int64_t; using vi = vector<i64>; using vvi = vector<vi>; #pragma GCC optimize("O3") #pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native") int main() { ios::sync_with_stdio(false); cin.tie(nullptr); cout.tie(nullptr); cout.setf(ios::fixed); cout.precision(20); double x; cin >> x; long double y = x; long double sum = 0; for (int i = 1; i <= 1100000000; i++) { long double t = y + i; t = t * t; sum += 1.0 / t; } double k = sum; cout << k << endl; }