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

建议使用的浏览器:

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

2238:Computer Basketball Game

题目描述
In a computer basketball game, people can play "one vs. one", which has the following rules: when a player attacks, he may throw 2-point-goal or 3-point-goal. If he makes the goal, he can continue to attack in the next turn. Otherwise, i.e. he misses the goal, the two players grab the rebound, and who gets the rebound attack in the next turn. The player who first gets N (1 <= N <= 30) points will win the game.

In this game, each player has four kinds of properties: the skill of 2-point-goal, the skill of 3-point-goal, the skill of rebound and the skill of defense. (Each skill is described in integers between 1 and 10). Through the statistic data, we can know the functions of skill. We use pt2(i), pt3(i), reb(i) and def(i) to represent the skill of 2-point-goal, the skill of 3-point-goal, the skill of rebound and the skill of defense of player i respectively. Take the case that player 1 attacks while player 2 defends for example, we will have the following conclusion:
1. The probability that player 1 chooses to throw 3-point-goal is pt3(1)/[pt3(1)+pt2(1)], otherwise he throws 2-point-goal.
2. If player 1 throws 3-point-goal, the probability that he makes the goal is 0.8*pt3(1)/[pt3(1)+def(2)], otherwise he misses the goal.
3. If player 1 throws 2-point-goal, the probability that he makes the goal is pt2(1)/[pt2(1)+def(2)], otherwise he misses the goal.
4. If player 1 misses a goal, the probability that he can get the rebound is 0.8*reb(1)/[reb(1)+reb(2)], otherwise player 2 get the rebound.

The case that player 2 attacks while player 1 defends is similar to the description above.

Well, now you are given the skill of your opponent, and you can assign your four kinds of skill in any way, but the sum of these four numbers must be a certain number M (4 <= M <= 40). Assume that you attack first, the problem is what is the maximum probability you win the game by assigning the skill optimally. You should know that once you choose your skills, the skills are fixed in every turn.
输入解释
The input consists of several test cases. In each test case, there are six integers N, M, pt2(2), pt3(2), reb(2), def(2) in a single line. (Assume you are player 1, and your opponent is player2.)
输出解释
For each test case, please output the result in a separate line. The result should be rounded to three digits after the decimal point.
输入样例
19 21 3 5 6 6
输出样例
0.754
提示
NOTICE:the winner can get N or more than N points,not just N points.

该题目是Virtual Judge题目,来自 北京大学POJ

题目来源 POJ Monthly,鲁小石

源链接: POJ-2238

最后修改于 2020-10-29T06:27:20+00:00 由爬虫自动更新

共提交 0

通过率 --%
时间上限 内存上限
2000 65536