Testing Round 12
C
Subsequences
Codeforces
1900
原题
← B→
翻译中…

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}$.

翻译中…

Input

翻译中…

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.

翻译中…

Output

翻译中…

Print one integer — the answer to the problem.

翻译中…

样例

Input #1
5 2
1
2
3
5
4
Output #1
7
InputCopy OutputCopy
题目信息
题号
597C
所属比赛
时间限制
1 s
内存限制
256 MB
标签
数据结构
动态规划

题面与样例版权归 Codeforces 及出题人所有;中文翻译由 AI 生成(CI 管线),如有出入请以原文为准。