URAL1696 Salary for Robots
题目戳这里。最长下降子序列单调队列求法。\(f_{i,j,k}\)表示考虑前\(i\)个数,\(g_1 = j,g_2 = k\)的方案数。转移:\[f_{i,j,k} = \sum_{p = k+1}^{j}f_{i-1,p,k}+\sum_{p=0}^kf_{i-1,j,p}\]二维前缀和优化。复杂度\(O(NK^2)\)。#include<iostream>...