Online JudgeProblem SetAuthorsOnline ContestsUser
Web Board
Home Page
F.A.Qs
Statistical Charts
Problems
Submit Problem
Online Status
Prob.ID:
Register
Update your info
Authors ranklist
Current Contest
Past Contests
Scheduled Contests
Award Contest
User ID:
Password:
  Register

one possible solution

Posted by zfy0701 at 2008-10-06 21:58:44 on Problem 3696 and last updated at 2008-10-06 21:59:54
In 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:
User ID:
Password:
Title:

Content:

Home Page   Go Back  To top


All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator