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

。。。。。。。居然要自己写乘法。。。。。。

Posted by lsdnlgd at 2010-03-06 11:35:12 on Problem 1811
Rt。。。郁闷。。。。。

inline unsigned long long mul(unsigned long long a,unsigned long long b,unsigned long long p)
{
	unsigned long long ans=0;
	for(register int i=0;i<64;i++)
	{
		if(b&1) ans+=a;
		ans%=p;
		b>>=1;
		a<<=1;
		a%=p;
	}
	return ans;
}
奇慢无比。。。。。

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