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 19881005 at 2009-08-12 11:51:35 on Problem 1328
In Reply To:WA的可以进来看看~~ Posted by:lsw20083820 at 2009-08-12 10:32:34
int cmp(const void *a,const  void *b)
{
 struct IN*c=(IN*)a;
 struct IN*d=(IN*)b;
 return c->left - d->left > 0 ? 1 : -1	;//AC
 return c->left - d->left;//WA
}
当数据类型是duoble的时候qsort在排序两个非常接近的值时,上面两个return返回值可能不同,导致排序结果不一定正确。

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