| ||||||||||
| Online Judge | Problem Set | Authors | Online Contests | User | ||||||
|---|---|---|---|---|---|---|---|---|---|---|
| Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest | |||||||||
one possible solutionIn Reply To:Re:(a*b)%c=((a%c)*(b%c))%c; Posted by:MasterLuo at 2008-10-06 21:53:50 long long ModularMulti(long long a, long long b, long long n) {
if (b) {
return (a * (b & 1) % n + (ModularMulti(a, b >> 1, n) << 1)) % n;
}
return 0;
}
Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator