#Lutece1353. 柱爷与子序列
柱爷与子序列
Migrated from Lutece 1353 柱爷与子序列
All parts of this problem, including description, images, samples, data and checker, might be broken. If you find bugs in this problem, please contact the admins.
Description
柱爷是个爱思考的人。这天,柱爷在思考子序列的问题。
所谓数列的子序列,是指,满足。
当然,这样的子序列有很多。但柱爷要找的是完美子序列!
所谓完美子序列,还需满足以下条件:
现在问你,数列中一共有多少完美子序列。
答案可能很大,输出对1000000009取模。
Input
第一行输入两个数。
第二行输入个数,表示的值。
数据保证:
Output
输出仅一个数,完美子序列的数量。答案可能很大,输出对1000000009取模。
Samples
4 2
1 3 7 5
4
Note
对于样例,存在以下4个完美子序列:
Resources
2016 UESTC Training for Dynamic Programming