随笔分类 - 动态规划——状压DP
摘要:"ref" 前置技能是bzoj的串珠子。这种子集dp好神啊qwq。 还有这种钦定点转移子集的方法建议按这题的方法写,不要看串珠子qwq cpp include include using namespace std; typedef long long ll; int n, m, w[15], uu
阅读全文
摘要:这是一道神子集dp…… "ref1" , "ref2" , "ref3" cpp include include using namespace std; int n, c[19][19], g[66005], f[66005]; typedef long long ll; const int mo
阅读全文
摘要:pkusc 快到了……做点题涨涨 rp。 记 $f(S,i)$ 表示 $S$ 这个集合是决计不能选的(要么属于独立集,要么和独立集相连),或称已经考虑了的,$i$ 表示此集合对应的最大独立集大小。那么枚举一下哪些点 $j$ 不在 $S$ 里,记 $w_i$ 表示 $i$ 和与之相邻的点集,则 $f(
阅读全文
摘要:"ref" cpp include include include using namespace std; typedef long long ll; int n, k, a[305], c[305]; ll w[305], dp[305][305][265], g[2]; int main(){
阅读全文
摘要:状压 dp。参考 "there" cpp include include include include using namespace std; typedef long long ll; int T, h, w, m, n, dp[1055][1055], qx[55], qy[55], dx,
阅读全文
摘要:学习位运算 cpp include include using namespace std; int n, m, dp[15][4105], a[15], uu, ans; const int mod=100000000; int main(){ cin m n; for(int i=1; i
阅读全文

浙公网安备 33010602011771号