結果
| 問題 |
No.2123 Chalk Breaker
|
| ユーザー |
|
| 提出日時 | 2022-11-07 22:32:26 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 44 ms / 2,000 ms |
| コード長 | 266 bytes |
| コンパイル時間 | 560 ms |
| コンパイル使用メモリ | 68,992 KB |
| 実行使用メモリ | 5,376 KB |
| 最終ジャッジ日時 | 2024-07-21 05:48:00 |
| 合計ジャッジ時間 | 1,331 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | AC * 9 |
コンパイルメッセージ
main.cpp:6:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
6 | main()
| ^~~~
ソースコード
#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;
}