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

Re:一开始用先求gcd再求lcm的方法一直WA,后来改用另外一种方法求lcm竟然过了,不明白.............

Posted by HeadHunter at 2013-04-15 14:34:01 on Problem 2369
In Reply To:一开始用先求gcd再求lcm的方法一直WA,后来改用另外一种方法求lcm竟然过了,不明白............. Posted by:KosonLau at 2007-04-19 02:31:11
我用下面的语句过的……只用了int

return a*b/gcd(a,b);
改成
return a/gcd(a,b)*b;


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