A10140. Subsequences
编程题
普及/提高-
知识点
题目描述
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.
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