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

建议使用的浏览器:

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

1354:Placement of Keys

题目描述
Assume that there are n (3<=n<=200) boxes identified by A1, A2,..., An , and each box Ai is configured a lock which is different from the others. Now put n keys to the n locks into the n boxes, each box can only hold a key. After locking all the boxes, unclench the boxes named A1, A2 and fetch out the keys in them to unlock the locked boxes. If the two keys can open some box, fetch out the key in the box to unlock other locked boxes again. If we can open all the boxes finally, we call the placement of the n keys good placement. How many are there different good placements of the n keys?
输入解释
The input file, ending with -1, contains several data, each of which holds a line.
输出解释
According to every input datum, compute the number of different good placements. Each output data hold two lines, the first line is held by the input datum, followed by a colon, which follows an equal mark before which is an N; the second is held by the number of different good placement of the n keys.
输入样例
6
8
-1
输出样例
N=6:
240
N=8:
10080

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

题目来源 Xi'an 2002

源链接: POJ-1354

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

共提交 0

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