首页 > 试题广场 >

Removal

[编程题]Removal
Bobo has a sequence of integers s1, s2, ..., sn where 1 ≤ si ≤ k.
Find out the number of distinct sequences modulo (109+7) after removing exactly m elements.

输入描述:
The input consists of several test cases and is terminated by end-of-file.
The first line of each test case contains three integers n, m and k.
The second line contains n integers s1, s2, ..., sn.


输出描述:
For each test case, print an integer which denotes the result.
示例1

输入

3 2 2
1 2 1
4 2 2
1 2 1 2

输出

2
4

备注:
* 1 ≤ n ≤ 105
* 1 ≤ m ≤ min{n - 1, 10}
* 1 ≤ k ≤ 10
* 1 ≤ si ≤ k
* The sum of n does not exceed 106.

这道题你会答吗?花几分钟告诉大家答案吧!

问题信息

难度:
0条回答 2浏览

热门推荐

通过挑战的用户

查看代码
Removal