State pressure dp sometimes needs to enumerate subsets, but the complexity will be high, so a fast method is needed to enumerate.
for(int i=s;i;i=(i-1)&s)
{
j=i^s;
}
You can read this blog for details: https://blog.csdn.net/yanzhenhuai/article/details/81572028