Skip to content

Commit 5116390

Browse files
committed
comb.perm.
1 parent 21cb8f8 commit 5116390

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

src/alfred/math/comb.hpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,10 @@ class Comb {
4040
if (n < m || m < 0) return 0;
4141
return fac(n) * invfac(m) * invfac(n - m);
4242
}
43+
inline mint perm(int n, int m) {
44+
if (n < m || m < 0) return 0;
45+
return fac(n) * invfac(n - m);
46+
}
4347
};
4448

4549
#endif // AFMT_COMB

0 commit comments

Comments
 (0)