[数学、递推]Everything Is Generated In Equal Probability

http://acm.hdu.edu.cn/contests/contest_showproblem.php?pid=1005&cid=849

思路:

f(i)表示长度为i的随机排列作为参数的返回值期望

整理得, 

 

则递推可求得f(i),最后答案为:

 

posted @ 2019-07-30 10:28  l..q  阅读(258)  评论(0编辑  收藏  举报