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

建议使用的浏览器:

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

5133:Squared Frequency

题目描述
You are now working in a physical laboratory. One day, when you were skimming through your records of experiments, you find that the squared frequency, defined as (P/Q)2, in which Q indicates times of experiments and P means number of experiments in which the expected phenomenon appears, is somehow unreasonable. The squared frequency F (0 < F < 1) is written in decimal form, and rounded to K (K ≤ 9) numbers after the decimal point. You think that Q, i.e. times of experiments, is too small to obtain such a number. Now you need to work out a fraction P/Q, so that rounding (P/Q)2 to K numbers after the decimal point gets exactly F, and minimizes Q.
输入解释
Input contains no more than 2000 test cases.

Each test case has a single line, which contains a decimal fraction indicating F, the squared frequency.
输出解释
For each test case, output your answer in a line with the case number, follow the format in sample. You should print a blank after ':'.

If the answer is not unique, output the one with the minimum P.
输入样例
0.3
0.5
0.50
输出样例
Case #1: 1/2
Case #2: 5/7
Case #3: 12/17
来自杭电HDUOJ的附加信息
Recommend liuyiding

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

源链接: HDU-5133

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

共提交 1

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