library

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

View the Project on GitHub maspypy/library

:warning: enumerate/permutation.hpp

Code

// Source: https://github.com/maspypy/library/blob/main/enumerate/permutation.hpp
// f(A, end)
template <typename F>
void enumerate_permutation(int N, F f) {
  bool end = false;
  vc<int> A(N);
  FOR(i, N) A[i] = i;
  do {
    f(A, end);
    if (end) break;
  } while (next_permutation(all(A)));
}
#line 1 "enumerate/permutation.hpp"
// Source: https://github.com/maspypy/library/blob/main/enumerate/permutation.hpp
// f(A, end)
template <typename F>
void enumerate_permutation(int N, F f) {
  bool end = false;
  vc<int> A(N);
  FOR(i, N) A[i] = i;
  do {
    f(A, end);
    if (end) break;
  } while (next_permutation(all(A)));
}
Back to top page