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

建议使用的浏览器:

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

6568:Math

Special Judge 特殊评判
题目描述
Avin sells robots to clients. At second 0, Avin is at the location (0,0) on a number axis with a robot.
He wants to go to (L, 0) with the robot. He walks a unit distance per second, and he can only stop at integer coordinates. Now, he decides to follow these walking rules repeatedly until he arrives (L, 0) with the robot:
1) If Avin has the robot with himself, the robot may be dropped down with probability p.
2) If Avin had dropped the robot, he will figure it out with probability q. Specially, if Avin arrives at (L, 0) without robot, he will turn around immediately.
3) If Avin does not see that the robot had been dropped, he walks one step right; otherwise, he walks left until he is at the same location as the robot.
What is the expectation of walking time he needs to arrive (L, 0) with the robot?
输入解释
One line with three numbers L, p and q, where L (1 ≤ L ≤ 100, 000) is an integer, p and q are real numbers with three digits and within (0, 1).
输出解释
Print the expected walking time. Your answer is considered correct if the absolute or relative error doesn’t exceed 1e6 . Formally, let your answer be a, and the jury’s answer be b. Your answer is considered correct if $\frac{|a-b|}{max(1,|b|)} $ ≤ 1e-6.
输入样例
1 0.500 0.500
输出样例
2.0000000000
来自杭电HDUOJ的附加信息
Recommend liuyiding

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

源链接: HDU-6568

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

共提交 0

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