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

建议使用的浏览器:

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

1133:Buy the Ticket

题目描述
The "Harry Potter and the Goblet of Fire" will be on show in the next few days. As a crazy fan of Harry Potter, you will go to the cinema and have the first sight, won’t you?

Suppose the cinema only has one ticket-office and the price for per-ticket is 50 dollars. The queue for buying the tickets is consisted of m + n persons (m persons each only has the 50-dollar bill and n persons each only has the 100-dollar bill).

Now the problem for you is to calculate the number of different ways of the queue that the buying process won't be stopped from the first person till the last person.
Note: initially the ticket-office has no money.

The buying process will be stopped on the occasion that the ticket-office has no 50-dollar bill but the first person of the queue only has the 100-dollar bill.
输入解释
The input file contains several test cases. Each test case is made up of two integer numbers: m and n. It is terminated by m = n = 0. Otherwise, m, n <=100.
输出解释
For each test case, first print the test number (counting from 1) in one line, then output the number of different ways in another line.
输入样例
3 0
3 1
3 3
0 0
输出样例
Test #1:
6
Test #2:
18
Test #3:
180
来自杭电HDUOJ的附加信息
Author HUANG, Ninghai
Recommend Eddy

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

源链接: HDU-1133

最后修改于 2020-10-25T22:42:25+00:00 由爬虫自动更新

共提交 3

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