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

建议使用的浏览器:

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

2721:Suit Distribution

题目描述
Bridge is a 4-player (two teams of two) card game with many complicated conventions that even experienced players have difficulty keeping track of. Fortunately, we are not interested in these conventions for this problem. In fact, it is not even important if you understand how to play the game.

What is important to know is that the way the cards are distributed among your two opponents often determine whether you will be successful in your game. For example, suppose you and your partner hold 8 spades. The remaining 5 spades are held by your opponents (since there are 13 cards in each suit) and can be distributed in the following ways: 0-5, 1-4, 2-3. Notice that a 0-5 "split" can be realized in two ways---opponent 1 has no spade and opponent 2 has 5 spades, or vice versa.

Good bridge players know that the best line of play often depends on the distribution. Sometimes good players can "read their opponents' cards" and determine the distribution, but sometimes even good players have to guess. In those cases, knowing the probability of the different distributions would be useful in making an educated guess.

You can assume that the 52 cards in a deck are dealt out randomly to 4 players, so that every player has 13 cards, and that you know which 26 cards your team holds.
输入解释
The input consists of a number of cases. Each case consists of two integers a, b (0 <= a, b <= 13, a + b <= 13). The input is terminated by a = b = -1.
输出解释
For each case, print the probability of a split of a+b cards so that one opponent has a cards and the other has b cards in the format as shown in the sample output. You may assume that the remaining cards in the suit are held by you and your partner. Output the probabilities to 8 decimal places.
输入样例
2 2
3 3
4 2
-1 -1
输出样例
2-2 split: 0.40695652
3-3 split: 0.35527950
4-2 split: 0.48447205

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

题目来源 Rocky Mountain 2005

源链接: POJ-2721

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

共提交 0

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