Пожалуйста, прочтите новое правило об ограничении использования AI-инструментов. ×

Блог пользователя script.kidd

Автор script.kidd, 3 месяца назад, По-английски

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.

  • Проголосовать: нравится
  • +7
  • Проголосовать: не нравится