Preparando MOJI

Subsequences

1000ms 262144K

Description:

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·1018.

Input:

First line contain two integer values n and k (1 ≤ n ≤ 105, 0 ≤ k ≤ 10) — the length of sequence and the number of elements in increasing subsequences.

Next n lines contains one integer ai (1 ≤ ai ≤ n) each — elements of sequence. All values ai are different.

Output:

Print one integer — the answer to the problem.

Sample Input:

5 2
1
2
3
5
4

Sample Output:

7

Informação

Codeforces

Provedor Codeforces

Código CF597C

Tags

data structuresdp

Submetido 0

BOUA! 0

Taxa de BOUA's 0%

Datas 09/05/2023 09:01:48

Relacionados

Nada ainda