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:有没有新的测试数据?我的WA……

Posted by springuper at 2010-04-22 10:11:22 on Problem 2335
In Reply To:有没有新的测试数据?我的WA…… Posted by:flyfy1 at 2009-12-01 12:27:31
应该要控制精度的。
double fmode(double x, double y)
{
    return x-floor(x/y)*y;
}
int dblcmp(double d){
    if(fabs(d)<EPS)
        return 0;
    return d>0?1:-1;
}
double fgcd(double a, double b)
{
   double t;
   if(dblcmp(a-b) == 1) 
   {
       t=a;
       a=b;
       b=t;
   }
   if(dblcmp(a) == 0) return b;
   return fgcd(fmod(b,a),a);
}

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