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

这里是应该选择什么排序法才能不TLE?

Posted by Windwing at 2007-02-14 13:57:22 on Problem 1002
我选用的是插入排序,总是过不了,难道要用快速排序?但是用快速排序还是要确定是否重复出现……
大一新手,望各位帮帮忙啊……看在TLE多次的份上……

for(j=1;j<=pos;j++)
{
	if(temp.tel==info[j].tel)
	{
		info[j].num++;
		break;
	}
	else if(temp.tel<info[j].tel)
	{
		for(k=++pos;k>j;k--)
			info[k]=info[k-1];
		info[j]=temp;
		break;
	}
}

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