传送门
奇奇怪怪的分组背包。
#include <cstdio> #include <cstring> #include <iostream> #define N 151 #define min(x, y) ((x) < (y) ? (x) : (y)) int n, p, cnt, ans = ~(1 << 31); int head[N], to[N], next[N], f[N][N]; inline int read() inline void dfs(int u) } inline void add(int x, int y) int main() dfs(1); for(i = 1; i <= n; i++) ans = min(ans, f[i][p]); printf("%d\n", ans); return 0; }
上一篇:[luoguP1877] [HAOI2012]音量调节(DP)
下一篇:[luoguP2679] 子串(DP)
DP









