O(1)快速乘

// by zzq
inline LL Mul(LL a,LL b,LL mod){
	LL tmp=a*b-(LL)((long double)a/mod*b+0.5)*mod; tmp%=mod;
	return tmp<0?tmp+mod:tmp;
}
posted @ 2019-10-01 16:16  AC-Evil  阅读(235)  评论(1编辑  收藏  举报