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:贪心为什么会错???下是错误的代码,指点一下吧。。。

Posted by 71107216 at 2008-07-17 14:23:13 on Problem 1083
In Reply To:贪心为什么会错???下是错误的代码,指点一下吧。。。 Posted by:fengzunbao2006 at 2008-07-13 17:51:09
int cmp(const void* a,const void* b)
{
	if ((*(node *)a).x == (*(node *)b).x)
        return (*(node *)a).y > (*(node *)b).y ? 1 : -1;
    return (*(node *)a).x > (*(node *)b).x ? 1 : -1;

}

这样就对了

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