kyopro-lib

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

View on GitHub

:x: Enumerate supersets (Ascending order)
(Mylib/Bit/enumerate_supersets_asc.cpp)

Operations

Requirements

Notes

Problems

References

Verified with

Code

#pragma once

namespace haar_lib {
  template <typename Func>
  void enumerate_supersets_asc(int a, int n, const Func &f) {
    for (int t = a; t < (1 << n); t = (t + 1) | a) {
      if (not f(t)) break;
    }
  }
}  // namespace haar_lib
#line 2 "Mylib/Bit/enumerate_supersets_asc.cpp"

namespace haar_lib {
  template <typename Func>
  void enumerate_supersets_asc(int a, int n, const Func &f) {
    for (int t = a; t < (1 << n); t = (t + 1) | a) {
      if (not f(t)) break;
    }
  }
}  // namespace haar_lib
Back to top page