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

几点提示

Posted by orangelegend at 2007-02-04 00:35:49 on Problem 1002
In Reply To:为了做这道题,我提交了上百次,靠 提交率掉了多少... Posted by:orangelegend at 2007-02-04 00:33:14
1.选择排序--->
2.快速排序--->
3.发现stdlib里居然有个qsort----->
4.将case改为数组定位---->
5.对快速排序进行优化,

if(a[1]>a[mid]&&a[mid]>a[n]||a[1]<a[mid]&&a[mid]<a[n]){
		temp=a[1];
		a[1]=a[mid];
		a[mid]=temp;
	}
	else if(a[1]>a[n]&&a[n]>a[mid]||a[1]<a[n]&&a[n]<a[mid]){
		temp=a[1];
		a[1]=a[n];
		a[n]=temp;
	}

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