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

建议使用的浏览器:

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

1285:Combinations, Once Again

题目描述
Given n objects you'd have to tell how many different groups can be chosen if r objects are taken at a time.
输入解释
Input consists of less than 100 test cases. Each test case begins with two integers n (0 < n <= 50), m (0 <= m <= n). The next line will contain the labels (numbers in the range 1 to n) of the n objects you are to choose from. Two objects with the same label are considered equivalent. Then in the last line for that test case, you'd have m values for r. There will be a single space separating two consecutive numbers in a line. Input is terminated by a test case where n=0, you must not process this test case.
输出解释
For each test case, print the test case number. And for each query number r, print the number of different groups that can be formed if r objects are taken from the given n objects. You can assume that for all input cases, the output will always fit in a 64-bit unsigned integer and (0<=r<=n).
输入样例
5 2
1 2 3 4 5
2 1

4 1
1 2 3 4 
2

0 0
输出样例
Case 1:
10
5
Case 2:
6

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

题目来源 UVA Volume CV 10532

源链接: POJ-1285

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

共提交 0

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