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

建议使用的浏览器:

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

3254:Extraordinary Tug of War

题目描述
Task

In the game of "tug of war", You're fighting against an extrordinary opponent -- you two teams have exactly the same strength! Yes, this is a so-called "Mirror Match".

Imagine an x-axis along the rope, with origin at the initial position of the center of rope (COR). Then, we can APPROXIMATE the movement of the rope as follows:

1. In the approximation, the rope does NOT move continuously. It moves in discrete steps, step length = dt.
2. Every dt unit time, the rope either moves left or right, exactly sqrt(dt) unit length.
3. The movement of the rope in different steps are independent.

When the step length, dt, goes towards zero, the approximation above goes towards the exact movement.

It's not hard to imagine that, it usually takes too long to move COR far enough from its original position. So the referee decided to adopt a special rule: observe COR in a period of time (t1, t2). If COR keeps in one side during the whole interval, the team on that side wins. If COR had ever returned to its original position during the interval, the game ends with a draw.

The referee wants the length of the observation interval (i.e. t2-t1) be exactly L, and the probability that one of the teams wins (i.e. the game is NOT a draw) be exactly P%, when should he start to observe?
输入解释
The first line contains a single integer T (T <= 20), the number of test cases. Each case contains two integers L, P (1 <= L <= 1000; 0 < P < 100), explained above.
输出解释
For each test case, print the case number and t1, rounded to 3 decimal points.
输入样例
2
1 50
1 10
输出样例
Case 1: 1.000
Case 2: 0.025
来自杭电HDUOJ的附加信息
Recommend zhonglihua

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

源链接: HDU-3254

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

共提交 0

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