Method of enumerating subset of state pressure dp

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

Guess you like

Origin blog.csdn.net/weixin_45755679/article/details/110451822