907. Stacking Cups

An infant's toy consists of n cups, labelled C1,,Cn in increasing order of size.

The cups may be stacked in various combinations and orientations to form towers. The cups are shaped such that the following means of stacking are possible:

Define S(n) to be the number of ways to build a single tower using all n cups according to the above rules. You are given S(4)=12, S(8)=58, and S(20)=5560.

Find S(107), giving your answer modulo 1000000007.

907. 堆叠杯子

某款婴儿叠叠杯玩具由 n 个杯子组成,将这些杯子从小到大分别记为 C1,,Cn

我们可以任意组合杯子,把它们按不同的朝向堆叠在一起,形成多种杯塔。得益于这些杯子的特殊形状,你可以按如下规则堆叠杯子:

S(n) 为:依照如上规则,用这 n 个杯子可以搭成的杯塔总数。已知:S(4)=12S(8)=58S(20)=5560

S(107)1000000007 的值。


这个链接 回到源站。

这个链接 回到详细版题目目录。