$\max$卷积优化

现在有

\[h_i = \sum _ {\max(j,k) = i} f_j\times g_k \]

\(h\)

\[F_i = \sum_{j = 1} ^ i f_j\\ G_i = \sum_{j = 1} ^ i g_j \]

\[\sum_{i = 1} ^ n h_i = F_n \times G_n\\ h_n = F_n \times G_n - F_{n - 1} \times G_{n - 1} \]

posted @ 2023-02-02 14:03  luyiming123  阅读(29)  评论(1编辑  收藏  举报