| ||||||||||
| Online Judge | Problem Set | Authors | Online Contests | User | ||||||
|---|---|---|---|---|---|---|---|---|---|---|
| Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest | |||||||||
Re:有没有新的测试数据?我的WA……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: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator