【TRICK】[0,n)中所有大小为k的子集的方法
1 int comb = (1 << k) - 1; 2 while (comb < (1<<n)) { 3 int x = comb & -comb, y = comb + x; 4 comb = (((comb & ~y)/x)>>1) | y; 5 }
1 int comb = (1 << k) - 1; 2 while (comb < (1<<n)) { 3 int x = comb & -comb, y = comb + x; 4 comb = (((comb & ~y)/x)>>1) | y; 5 }