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

建议使用的浏览器:

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

4599:Dice

题目描述
Given a normal dice (with 1, 2, 3, 4, 5, 6 on each face), we define:
F(N) to be the expected number of tosses until we have a number facing up for N consecutive times.
H(N) to be the expected number of tosses until we have the number '1' facing up for N consecutive times.
G(M) to be the expected number of tosses until we have the number '1' facing up for M times.
Given N, you are supposed to calculate the minimal M1 that G (M1) >= F (N) and the minimal M2 that G(M2)>=H(N)
输入解释
The input contains multiple cases.
Each case has a positive integer N in a separated line. (1<=N<=1000000000)
The input is terminated by a line containing a single 0.
输出解释
For each case, output the minimal M1 and M2 as required in a single line, separated by a single space.
Since the answer could be very large, you should output the answer mod 2011 instead.
输入样例
1
2
0
输出样例
1 1 
2 7
来自杭电HDUOJ的附加信息
Recommend liuyiding

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

源链接: HDU-4599

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

共提交 0

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