logo AlgoBeat OnlineJudge
登录 注册

#102013. [BZOJ 2013] [Ceoi2010]A huge tower

内存限制:259 MiB 时间限制:10000 ms 标准输入输出
题目类型:传统 评测方式:文本比较
上传者: 匿名

题目描述

块砖,要搭一个 层的塔,要求:如果砖 在砖 上面,那么 不能比 的长度 要长。问有几种方法,输出答案 的值。

输入格式

第一行:

第二行: 个数,表示每块砖的长度。

输出格式

方案数。输出要

样例

样例输入 #1

4 1
1 2 3 100

样例输出 #1

4

样例说明 1

We can arrange the first three blocks in any order, except for or . The last block has to be at the bottom.

样例输入 #2

6 9
10 20 20 10 10 20

样例输出 #2

36

样例说明 2

We are not allowed to put a cube of size onto a cube of size .

There are six ways to order the cubes of size , and six ways to order the cubes of size .

数据范围与提示

对于 的数据,

对于 的数据,方案数不超过

对于 的数据,

对于 的数据,

对于 的数据,,输入中所有数字为不超过 的正整数。