結果

問題 No.1235 ζ関数
ユーザー forest3
提出日時 2025-03-20 21:45:03
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 29 ms / 2,000 ms
コード長 344 bytes
コンパイル時間 1,333 ms
コンパイル使用メモリ 163,488 KB
実行使用メモリ 7,844 KB
最終ジャッジ日時 2025-06-20 11:31:03
合計ジャッジ時間 3,208 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 25
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
#include <atcoder/fenwicktree>
using namespace atcoder;

using ll = long long;
#define rep(i, n) for(int i = 0; i < n; i++)

int main() {
	int n;
	cin >> n;
	long double ans = 0;
	ll m = 1;
	rep(i, 1000000) {
		ans += 1.0 / pow(m, n);
		m++;
	}
	cout << fixed << setprecision(12) << ans << endl;
} 
0