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