結果

問題 No.2123 Chalk Breaker
ユーザー keisuke6keisuke6
提出日時 2022-10-24 21:55:53
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
TLE  
実行時間 -
コード長 332 bytes
コンパイル時間 1,945 ms
コンパイル使用メモリ 205,328 KB
実行使用メモリ 12,500 KB
最終ジャッジ日時 2023-09-15 23:32:46
合計ジャッジ時間 8,319 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 TLE -
testcase_01 -- -
testcase_02 -- -
testcase_03 -- -
testcase_04 -- -
testcase_05 -- -
testcase_06 -- -
testcase_07 -- -
testcase_08 -- -
testcase_09 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

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

map<int, double> m;

double f(int n) {
    if(m.count(n)) return m[n];
    if(n == 0) return 0;
    double sum = 0;
    for(int i=0;i<n;i++) sum += f(i)+f(n-i-1);
    return m[n] = sum/n+1;
}

int main() {
    int N;
    cin>>N;
    cout << fixed << setprecision(15) << f(N) << endl;
}
0