摘要:
f[i] 对于某个区间起点,状态转移到终点,要反过来枚举 i 方程不难想,两种情况 f[i] =max{ f[i+len[j] ] } f[i]= f[i+1]+1 #include <iostream> #include <algorithm> #include <cmath> using nam 阅读全文
posted @ 2022-10-22 13:57
towboat
阅读(19)
评论(0)
推荐(0)
摘要:
很水的区间dp #include <iostream> #include <cstring> #include <cmath> using namespace std ; const int N=502; int n,a[N],f[N][N]; int func(int l,int r){ if(l 阅读全文
posted @ 2022-10-22 12:12
towboat
阅读(11)
评论(0)
推荐(0)