結果

問題 No.1271 初めての級数
ユーザー 👑 CleyL
提出日時 2022-08-09 18:35:53
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 258 bytes
コンパイル時間 532 ms
コンパイル使用メモリ 72,224 KB
最終ジャッジ日時 2025-01-30 19:44:24
ジャッジサーバーID
(参考情報)
judge4 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 12 WA * 1
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <iomanip>
using namespace std;
int main(){
    int n;cin>>n;
    double ans = 0;
    for(int i = 1; n >= i; i++){
        ans += (double)1/(double)i;
    }
    cout << fixed << setprecision(10) << (double)ans/(double)n << endl;
}
0