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

建议使用的浏览器:

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

7155:Bowcraft

题目描述
Kayzin has created a game called $Bowcraft$. In the game you will play as an archer and at the beginning of the game you will get a bow with a level of $0$. To get a more friendly game experience, you can buy enhancement books to upgrade your bow.

Each enhancement book has two attribute. $\frac{a}{A}$ is the probability of successfully upgrading your bow by $1$ level when you use the book; if the upgrade fails, the bow will have a $\frac{b}{B}$ probability of breaking(reduced to level 0). When you buy an enhancement book, the store system will generate a random integer in $[0, A-1]$ with equal probability as attribute $a$ and a random integer in $[0, B-1]$ with equal probability as attribute $b$.

After you buy an enhancement book, you need to choose to use this enhancement book or discard it.

Kayzin would like to quiz the clever you on the best strategy to expectation of enhancement books you need to buy to upgrade your bow from level $0$ to level $K$.
输入解释
The first line contains an integer $T(T≤10)$ ,denoting the number of groups of data. Next follows $T$ lines, for each line, there has three integers $K$ $(1≤K≤1000)$ , $A$ , $B$ $(2≤A,B≤100)$, indicating that you need to raise the bow to level $K$, as well as the range of upgrade success rate $A$ and the range of breakage rate $B$ using each enhancement book.
输出解释
Output the expectation of enhancement books to be purchased to raise a bow from $0$ to $K$ level, and the result are reserved with $3$ digits after the decimal point.
输入样例
3
1 3 3
2 3 3
319 100 100
输出样例
3.000
7.000
13436.938

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

源链接: HDU-7155

最后修改于 2022-09-15T06:17:04+00:00 由爬虫自动更新

共提交 0

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