結果
問題 |
No.1271 初めての級数
|
ユーザー |
|
提出日時 | 2020-10-31 08:13:45 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 292 bytes |
コンパイル時間 | 1,883 ms |
コンパイル使用メモリ | 165,888 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-07-22 04:41:43 |
合計ジャッジ時間 | 2,623 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 12 WA * 1 |
ソースコード
#include <bits/stdc++.h> using namespace std; #define ll long long #define rep(i, n) for (ll i = 0; i < (ll)(n); i++) int main(){ double k; cin>>k; double sum=0; for (int i=1;i<=k;i++)sum+=(double)1/i; double ans=(1/k)*sum; cout<<fixed<<setprecision(12)<<ans<<endl; return 0; }