Check-in [8f8efc5938]
Not logged in
Overview
SHA1 Hash:8f8efc5938d228a8edd14e1e98b55f9202e60afa
Date: 2013-06-27 00:12:26
User: kinaba
Comment:subset iteration.
Timelines: family | ancestors | descendants | both | trunk
Downloads: Tarball | ZIP archive
Other Links: files | file ages | manifest
Tags And Properties
Changes

Modified lib/typical/bitop.cpp from [80d6730d2c161aa4] to [f82714ac139d7457].

1 1 int bitcnt(LL x) 2 2 { 3 3 int c = 0; 4 4 for(; x; x>>=1) 5 5 c += x&1; 6 6 return c; 7 7 } 8 + 9 + 10 +/* for every nonempty subset of S : O(2^|S|) 11 + for(int sub=S; sub; sub=(sub-1)&S) { ... } 12 + 13 +*/