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 c0500301036 at 2005-05-03 12:19:03 on Problem 2426
In Reply To:这个肯定影响啊,我觉得您应该这么写试试 Posted by:TN at 2005-05-03 12:13:21
> __int64 gcd(__int64 aa,__int64 bb) {
> 	//if (aa<0) aa=-aa;
> 	//if (bb<0) bb=-bb;
> 	if (aa==0) return bb;
> 	return gcd((bb%aa+aa)%aa,aa);
> }
> 
> -bb%aa和bb%aa不一样啊

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