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

建议使用的浏览器:

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

3206:Ikki's Story III - Rescue frkstyc!

题目描述

After defeating the evil nation of TN and road reconstruction, the nation of Phoenix is now in perfect harmony. But as every old story goes, evil things will keep happening now and then. This day, a letter arrived at Ikki’s, saying that his friend, frkstyc, was kidnapped in the Wonderland of TopCoders.

It is not known who kidnapped frkstyc but it is known that he is a favorite of algorithmic contests and the reason for his kidnapping frkstyc was that he can’t solve a enumeration problem =.=, so he kidnapped frkstyc to help him. (What? Why not kidnap ACRush? Well… Still remember the story told by Guo Wei in Xi’an? — “Then why me but not somebody else!!”, yells frkstyc.)

Well, now frkstyc’s life is at stake! He is encountered with such a problem:

You know what a tree in graph theory is, right? Well, I’m interested in numbering the trees in such a way that the number of a vertex is always smaller than those of its descendants. And I’m interested in making the trees into forests such that there are n nodes and k leaves, satisfying the above property in each tree. Now tell me how many ways can I number such forests!

Being a contestant at POJ, you’re sure that if there’s no frkstyc, there will be no POJ Monthly for a time… So try your best to save his life!

输入解释

The input contains one or more lines ended with an integer pair “0 0”. Each of the above lines contains two integers n, k (n, k ≤ 500), respectively.

输出解释
Output the numbers of different forests in separate lines.
输入样例
1 1
3 2
0 0
输出样例
1
4

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

源链接: POJ-3206

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

共提交 0

通过率 --%
时间上限 内存上限
3000 262144