传送门
区间DP水题
代码
#include <cstdio> #include <iostream> #define N 41 #define max(x, y) ((x) > (y) ? (x) : (y)) int n; int a[N], f[N][N], pre[N][N]; inline int read() inline void solve(int l, int r) int main() printf("%d\n", f[1][n]); solve(1, n); return 0; }
上一篇:[luoguP1010] 幂次方 ^(* ̄(oo) ̄)^
下一篇:[luoguP2672] 推销员(贪心 + 树状数组 + 优先队列)
DP









