問題一覧 > 通常問題

No.2123 Chalk Breaker

レベル : / 実行時間制限 : 1ケース 2.000秒 / メモリ制限 : 512 MB / 小数誤差許容問題 絶対誤差または相対誤差が $10^{-9}$ 以下。ただし、ジャッジ側の都合で500桁未満にしてください
タグ : (AC するまで非表示) / 解いたユーザー数 98
作問者 : keisuke6 / テスター : silv723
お気に入りにしたユーザー ProblemId : 8730 / 自分の提出
問題文最終更新日: 2022-11-08 09:24:39
This statement was translated by AI (claude-opus-5-5, effort medium) and may contain errors or differ in nuance from the original. The original statement takes precedence. Back to the original

Problem Statement

There is a stickpiece of chalk (corrected 11/8 7:20) of length $N$. Keisuke6 has decided to smash this chalk completely to pieces. To do so, he repeats the following operation until no chalk of positive length remains.

    Randomly choose $1$ piece from among the chalks of length at least $1$ and drop it. Letting $n$ be the length of that chalk, it turns into 2 chalks of lengths $x$ , $n-x-1$. Here, $x$ is chosen with equal probability from among the integers between $0$ and $n-1$.
Find the expected number of operations Keisuke6 performs.

Input

$N$ 

$1 \leq N \leq 5000$
$N$ is an integer

Output

Print a newline at the end.

Sample

Sample 1
Input
1
Output
1.000000000

After being dropped $1$ time, it is smashed to pieces.

提出するには、Twitter 、GitHub、 Googleもしくは右上の雲マークをクリックしてアカウントを作成してください。