update
This commit is contained in:
parent
4195226207
commit
eb95caa631
@ -14,7 +14,7 @@ static ull fact(const ull n)noexcept{
|
|||||||
if(it != fact_map.end())return (*it).second;
|
if(it != fact_map.end())return (*it).second;
|
||||||
ull ret {1};
|
ull ret {1};
|
||||||
for(ull i{2};i<=n;i++){
|
for(ull i{2};i<=n;i++){
|
||||||
ret=(ret*i)%k;
|
ret=(ret%k*i%k);
|
||||||
}
|
}
|
||||||
fact_map.insert({n,ret});
|
fact_map.insert({n,ret});
|
||||||
return ret;
|
return ret;
|
||||||
|
Loading…
Reference in New Issue
Block a user