結果
| 問題 | No.1271 初めての級数 |
| コンテスト | |
| ユーザー |
Example0911
|
| 提出日時 | 2020-10-30 21:24:21 |
| 言語 | C++17 (gcc 15.2.0 + boost 1.89.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 344 bytes |
| 記録 | |
| コンパイル時間 | 1,859 ms |
| コンパイル使用メモリ | 194,108 KB |
| 最終ジャッジ日時 | 2025-01-15 16:36:37 |
|
ジャッジサーバーID (参考情報) |
judge3 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 12 WA * 1 |
ソースコード
#include "bits/stdc++.h"
using namespace std;
int main() {
int k; cin >> k;
cout << fixed << setprecision(15);
if (k == 0) {
long double PI = 3.1415926535;
cout << PI * PI / 6.0 << endl;
}
long double now = 0;
for (int i = 1; i <= k; i++) {
now += 1.0 / (long double)i;
}
now /= (long double)k;
cout << now << endl;
return 0;
}
Example0911