script.kidd's blog

By script.kidd, 3 days ago, In English

Problem: Given an array of length $$$n$$$, find the number of increasing subsequences of length $$$k$$$, modulo $$$10^{9} + 7$$$.

I know that it can be done via the following DP, which can be optimized to $$$\mathcal O(nklogn)$$$ using a BIT or segment tree:

$$$\displaystyle dp(i, k, x) = dp(i-1, k, x) + \sum_{y < x} {dp(i-1, k-1, y)} $$$

But could it be further optimized? I can't seem to find any mentions of a faster algorithm online.

  • Vote: I like it
  • +4
  • Vote: I do not like it