No.2123 Chalk Breaker
問題文最終更新日: 2022-11-08 09:24:39
English (AI translation)
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$.
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もしくは右上の雲マークをクリックしてアカウントを作成してください。
keisuke6