Artifact f82714ac139d74573a135dbccf1b0d3e2d96e45c
- File
lib/typical/bitop.cpp
- 2013-06-27 00:12:26 - part of checkin [8f8efc5938] on branch trunk - subset iteration. (user: kinaba) [annotate]
int bitcnt(LL x) { int c = 0; for(; x; x>>=1) c += x&1; return c; } /* for every nonempty subset of S : O(2^|S|) for(int sub=S; sub; sub=(sub-1)&S) { ... } */