【防炸long long】快速乘总结

#define ull unsigned long long
#define ll long long
#define ld long double
inline ll ksc(ll x,ll y,ll p)
{
    ll z=(ld)x/p*y;
    ll res=(ull)x*y-(ull)z*p;
    return (res+p)%p;
}

转自:https://www.cnblogs.com/812-xiao-wen/p/10543023.html

posted @ 2020-05-04 09:44  Nanjo  阅读(242)  评论(0编辑  收藏  举报