結果
| 問題 |
No.1271 初めての級数
|
| コンテスト | |
| ユーザー |
👑 |
| 提出日時 | 2022-08-09 19:40:10 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 405 bytes |
| コンパイル時間 | 785 ms |
| コンパイル使用メモリ | 89,792 KB |
| 最終ジャッジ日時 | 2025-01-30 19:46:56 |
|
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 12 WA * 1 |
ソースコード
#include <iostream>
#include <iomanip>
#include <cmath>
using namespace std;
int main(){
int n;cin>>n;
if(n==0){
cout << fixed << setprecision(10) << (double)6/((double)acos(-1)*acos(-1)) << endl;
return 0;
}
double ans = 0;
for(int i = 1; n >= i; i++){
ans += (double)1/(double)i;
}
cout << fixed << setprecision(10) << (double)ans/(double)n << endl;
}