*iroi*

mechairoi の Blog

0...n-1からなるk桁の順列

0...n-1からなるk桁の順列

do {
  reverse(perm+k, perm+n);
} while(next_permutation(perm, perm+n);