Mr.L has a uniform random generator. In the beginning, Mr. L will input an integer NNN, and then pushes the generate button. The generator will output a random integer x∈[1,N]xin [1,N]x∈[1,N]. Then he will push the button again, and the generator will output a random integer y∈[1,x]yin [1,x]y∈[1,x] and so on and so forth. It is clear that the output is non-increasing, and after a number of pushes, the output will at last be 111. Now he wants to know the expected number of pushes to obtain 111 as output.
Mr.L has a uniform random generator. In the beginning, Mr. L will input an integer NNN, and then pushes the generate button. The generator will output a random integer x∈[1,N]xin [1,N]x∈[1,N]. Then he will push the button again, and the generator will output a random integer y∈[1,x]yin [1,x]y∈[1,x] and so on and so forth. It is clear that the output is non-increasing, and after a number of pushes, the output will at last be 111. Now he wants to know the expected number of pushes to obtain 111 as output.
![HBC237335[CQOI2017]老C的任务,树状数组,数据结构Generator题解
-第1张图片-东莞河马信息技术 HBC237335[CQOI2017]老C的任务,树状数组,数据结构Generator题解
-第1张图片-东莞河马信息技术](https://www.xxstcz.com/zb_users/plugin/ezarticleimgauto/imgs/hippopx/abstract-1231863_960_720.jpg)