题库练习 Subsequences
← 上一题 下一题 →

A10140 | Subsequences

时间限制1s
内存限制256MB
通过 / 提交0/0

题目描述

For the given sequence with $n$ different elements find the number of increasing subsequences with $k+1$ elements. It is guaranteed that the answer is not greater than $8·10^{18}$ .

输入格式

First line contain two integer values $n$ and $k$ $(1<=n<=10^{5},0<=k<=10)$ — the length of sequence and the number of elements in increasing subsequences.

Next $n$ lines contains one integer $a_{i}$ ( $1<=a_{i}<=n$ ) each — elements of sequence. All values $a_{i}$ are different.

输出格式

Print one integer — the answer to the problem.

输入输出样例

输入 #1
5 2
1
2
3
5
4
输出 #1
7
C++ 编辑器
输入
输出