Codeforces Round #804 (Div. 2)
4 өдрийн дараа |
C. Subsequences
хугацааны хязгаарлалт 1 секунд
санах ойн хязгаарлалт 256 мегабайт
оролт стандарт оролт
гаралт стандарт гаралт
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.
Орчуулсан: [орчуулагдаж байгаа]
Жишээ тэстүүд
Оролт
5 2 1 2 3 5 4
Гаралт
7
Сэтгэгдлүүдийг ачааллаж байна...