给出\(N,M\),求\(\lfloor\frac{10^N}{M}\rfloor\)除以\(M\)的余数
\(\lfloor\frac{10^N}{M}\rfloor \equiv \lfloor\frac{10^N}{M}\rfloor - kM \equiv \lfloor\frac{10^N - kM^2}{M}\rfloor (mod M)\)
于是先求分子即可
int main(){
ll n = rd();
ll m = rd();
cout << ksm(10,n,m * m) / m;
}
原文:https://www.cnblogs.com/hznumqf/p/14376188.html