状压 DP 是动态规划的一种,通过将状态压缩为整数来达到优化转移的目的
利用x = (x - 1) & s 来不重不漏的找子集
x = (x - 1) & s
void find_subset(int s){ int x = s; while(x){ x = (x - 1) & s; cout << x << '\n'; } return ; }
oi wiki 状压DP
2023百度之星初赛三 - 1 石碑文
ABC318 - D - General Weighted Max Matching
cf 901 div.2 E. Jellyfish and Math