結果

問題 No.1235 ζ関数
ユーザー kotatsugame
提出日時 2020-09-21 17:50:29
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 240 bytes
コンパイル時間 454 ms
コンパイル使用メモリ 68,244 KB
実行使用メモリ 7,844 KB
最終ジャッジ日時 2025-06-20 10:40:46
合計ジャッジ時間 1,189 ms
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 25
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp:5:1: warning: ISO C++ forbids declaration of ‘main’ with no type [-Wreturn-type]
    5 | main()
      | ^~~~

ソースコード

diff #

#include<iostream>
#include<iomanip>
using namespace std;
int N;
main()
{
	double ans=0;
	cin>>N;
	for(int i=1;;i++)
	{
		double t=1;
		for(int j=0;j<N;j++)t/=i;
		if(t<1e-15)break;
		ans+=t;
	}
	cout<<fixed<<setprecision(16)<<ans<<endl;
}
0