結果

問題 No.1271 初めての級数
ユーザー face4
提出日時 2020-10-31 16:07:44
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 33 ms / 2,000 ms
コード長 240 bytes
コンパイル時間 538 ms
コンパイル使用メモリ 69,308 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-07-22 05:04:06
合計ジャッジ時間 1,508 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 13
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<iostream>
#include<iomanip>
using namespace std;

int main(){
    int k;
    cin >> k;
    double d = 0;
    for(int i = 1; i <= 10000000; i++)   d += 1.0/i/(i+k);
    cout << fixed << setprecision(12) << d << endl;
    return 0;
}
0