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

建议使用的浏览器:

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

4978:A simple probability problem.

题目描述
Equally-spaced parallel lines lie on an infinite plane. The separation between adjacent lines is D (D>0). Now considering a circle of diameter D. N points lie on or in the circle. It is guaranteed that any three points are not collinear. Between any two points there's a needle. Find the possibility that, if the circle is randomly (with equal probability on any position and direction) thrown onto the same plane described above (with the equally-spaced parallel lines of separation d), at least one needle crosses a line.
输入解释
The first line contains a single integer T (1 <= T <= 100), the number of test cases.

For each set of input data, the first line gives two integers, N and D (N<=100), as described above. You can consider the center of the circle is default as the origin. Lastly N lines is followed, each containing two real numbers that representing the coordinate of a point lying within the circle.
输出解释
Each output should occupy one line. Each line should start with "Case #i: ", followed by a real number round to four decimal places, the probability that at least one needle crosses one line.
输入样例
2
2 2
-0.5 0
0.5 0
3 3
0 1
1 0
-1 0
输出样例
Case #1: 0.3183
Case #2: 0.5123
来自杭电HDUOJ的附加信息
Author BJTU
Recommend

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

源链接: HDU-4978

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

共提交 0

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