大数模乘

2019-04-13 21:42发布

当两个数相乘爆long long时,需要用到这个 long long mult(long long a,long long b,long long mod) { return (a*b-(long long)(a/(long double) mod * b + 1e-3)* mod + mod) % mod; }