結果

問題 No.454 逆2乗和
ユーザー vwxyz
提出日時 2021-08-17 04:39:18
言語 C++23
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 6 ms / 2,000 ms
コード長 280 bytes
コンパイル時間 3,476 ms
コンパイル使用メモリ 265,924 KB
実行使用メモリ 5,248 KB
最終ジャッジ日時 2024-10-10 01:58:13
合計ジャッジ時間 4,743 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 31
権限があれば一括ダウンロードができます

ソースコード

diff #

#define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
using namespace std;

int main(){
    long double x;cin>>x;
    long double ans=1.6449340668482426;
    for(int i=pow(10,6);i>0;i--){
        ans+=1/pow(i+x,2);
        ans-=1/pow(i,2);
    }
    cout<<setprecision(15)<<ans<<endl;
}
0