CP-templates

This documentation is automatically generated by online-judge-tools/verification-helper

View the Project on GitHub Misuki743/CP-templates

:question: enumerate/enumerate_bit.cpp

Verified with

Code

template<typename F, typename INT>
requires invocable<F, INT>
void enumerate_subset(INT msk, F f) {
  for(INT x = msk; x > 0; x = (x - 1) & msk)
    f(x);
  f(0);
}
#line 1 "enumerate/enumerate_bit.cpp"

template<typename F, typename INT>
requires invocable<F, INT>
void enumerate_subset(INT msk, F f) {
  for(INT x = msk; x > 0; x = (x - 1) & msk)
    f(x);
  f(0);
}
Back to top page