Skip to content

Commit 7019bef

Browse files
authored
Merge pull request #378 from hitonanode/acl-modint-inv
add inv() to acl_fac
2 parents 090b6f4 + 639b71d commit 7019bef

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

number/acl_modint.hpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,5 +28,6 @@ template <typename modint> struct acl_fac {
2828
}
2929
modint operator[](int i) const { return facs[i]; }
3030
modint finv(int i) const { return facinvs[i]; }
31+
modint inv(int i) const { return i > 0 ? facinvs[i] * facs[i - 1] : 1; }
3132
};
3233
// acl_fac<mint> fac(1000000);

0 commit comments

Comments
 (0)