当前你的浏览器版本过低,网站已在兼容模式下运行,兼容模式仅提供最小功能支持,网站样式可能显示不正常。
请尽快升级浏览器以体验网站在线编辑、在线运行等功能。

建议使用的浏览器:

谷歌Chrome 火狐Firefox Opera浏览器 微软Edge浏览器 QQ浏览器 360浏览器 傲游浏览器

4624:Endless Spin

题目描述
I spin it again and again,and throw it away finally.
So now I have a row of n ball,named from 1 to n,each ball is white initially.
At each step I randomly chose a interval [l, r] and paint all ball in this interval to black.
It means every interval have a equal chance of being chosen.
And I'll stop if all ball are black.What is the expected steps before I stop?
输入解释
The first line contains integer T(1<=T<=50). Denoting the number of the test cases.
Then T lines follows, each line contains an integer n (1<=n<=50).
输出解释
For each test cases,print the answer in a line.
Print the answer rounded to 15 decimal places.
输入样例
3
1
2
3
输出样例
1.000000000000000
2.000000000000000
2.900000000000000

提示
不建议使用long double
来自杭电HDUOJ的附加信息
Author WJMZBMR
Recommend zhuyuanchen520

该题目是Virtual Judge题目,来自 杭电HDUOJ

源链接: HDU-4624

最后修改于 2020-10-25T23:15:13+00:00 由爬虫自动更新

共提交 0

通过率 --%
时间上限 内存上限
4000/2000MS(Java/Others) 32768/32768K(Java/Others)