index
:
tcr
master
Team Contest Reference
summary
refs
log
tree
commit
diff
log msg
author
committer
range
path:
root
/
math
/
shortModInv.cpp
blob: 244bacf44f02dd399a66e7894525abb3d47703e4 (
plain
)
1
2
3
ll
multInv
(
ll x
,
ll m
) {
// x^{-1} mod m
return
1
<
x
?
m
-
inv
(
m
%
x
,
x
) *
m
/
x
:
1
;
}