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:用sort排序的问题。。

Posted by frkstyc at 2007-02-04 00:25:27 on Problem 1036
In Reply To:用sort排序的问题。。 Posted by:Acsaga at 2007-02-04 00:02:30
从形式上说你这个cmp必须等价于一个小于号而不是一个小于等于号或者别的什么东西

> 排序时写成
> bool cmp(G a, G b) {
>     if(a.time != b.time)
>         return a.time<b.time;
>     else
>         return a.stout<=b.stout;  //注意这里
> }
> 就RE
> 写成
> bool cmp(G a, G b) {
>     if(a.time != b.time)
>         return a.time<b.time;
>     else
>         return a.stout<b.stout; //没有等号
> }
> 就ac了,这是怎么回事?

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