結果

問題 No.1408 Nice Dice Game
ユーザー publflpublfl
提出日時 2021-02-26 21:55:28
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 3 ms / 2,000 ms
コード長 282 bytes
コンパイル時間 175 ms
コンパイル使用メモリ 31,360 KB
実行使用メモリ 6,824 KB
最終ジャッジ日時 2024-10-02 14:35:28
合計ジャッジ時間 1,272 ms
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 36
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <stdio.h>
#define MAX (long long int)1e12

int main()
{
	int a;
	scanf("%d",&a);
	
	double ans = 0;
	for(int i=1;i<=100000;i++)
	{
		long long int s = 1;
		for(int j=1;j<=a+2;j++)
		{
			s*=i;
			if(s>MAX) goto u;
		}
		ans += (double)1/s;
		u:;
	}
	printf("%.12lf",ans);
}
0