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 sparkling at 2007-07-13 22:48:53 on Problem 3262
In Reply To:排序中应该注意什么呢?帮忙看下~~ Posted by:wolfchuyan at 2007-07-13 20:18:31
按照 d/t排序

 int cmp(const void *a ,const void *b)
> {
>     if ((*(node *)a).d > (*(node *)b).d)
>       return 1;
>     else if((*(node *)a).d ==(*(node *)b).d)
>     {
>         if ((*(node *)a).t <(*(node *)b).t) return 1;
>         else return -1;
>     }
>     return -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