結果

問題 No.2123 Chalk Breaker
ユーザー kotatsugamekotatsugame
提出日時 2022-11-07 22:32:26
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 44 ms / 2,000 ms
コード長 266 bytes
コンパイル時間 563 ms
コンパイル使用メモリ 70,292 KB
実行使用メモリ 4,380 KB
最終ジャッジ日時 2023-09-28 11:05:41
合計ジャッジ時間 1,475 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 44 ms
4,380 KB
testcase_01 AC 44 ms
4,376 KB
testcase_02 AC 14 ms
4,380 KB
testcase_03 AC 6 ms
4,376 KB
testcase_04 AC 2 ms
4,376 KB
testcase_05 AC 35 ms
4,380 KB
testcase_06 AC 6 ms
4,380 KB
testcase_07 AC 9 ms
4,376 KB
testcase_08 AC 5 ms
4,376 KB
testcase_09 AC 2 ms
4,380 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp:6:1: 警告: ISO C++ では型の無い ‘main’ の宣言を禁止しています [-Wreturn-type]
    6 | main()
      | ^~~~

ソースコード

diff #

#include<iostream>
#include<iomanip>
using namespace std;
int N;
long double dp[5050];
main()
{
	cin>>N;
	dp[0]=0;
	for(int i=1;i<=N;i++)
	{
		for(int x=0;x<=i-1;x++)
		{
			dp[i]+=dp[x]+dp[i-x-1]+1;
		}
		dp[i]/=i;
	}
	cout<<fixed<<setprecision(16)<<dp[N]<<endl;
}
0