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 4321go at 2007-08-17 15:53:16 on Problem 3349
In Reply To:我都排不了 快排里面的函数怎么写? Posted by:ecjtunh at 2007-08-17 14:15:40
可以这样:
struct SNOW
{
	int a[6];
	bool operator < (const SNOW &m)const
	{
		for(int i=0;i<5;i++)
		{
			if(a[i]!=m.a[i])
				return a[i]<m.a[i];
		}
		return a[5]<m.a[5];
	}
}

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