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 Eli_love at 2009-07-05 00:25:35 on Problem 1002
最终输出的位数只能是8位
例如给该测试数据:
2
2345678912
2345678912
不能输出 234-5678912 2
而应该输出234-5678 2
注意:No duplicates.最后的那个点,所以有输出题目中给定的字符串最好是直接复制粘贴
最后贴一个自己的快排方法只供参考:
char a[110000][50],b[110000][50];
void qsort(int l,int r)
{
	int i,j;
	char x[40],temp[40];
	i=l;j=r;strcpy(x,b[(i+j)>>1]);
	while(i<=j)
	{
		while(strcmp(b[i],x)<0) i++;
		while(strcmp(b[j],x)>0) j--;
		if(i<=j)
		{
			strcpy(temp,b[i]);
			strcpy(b[i],b[j]);
			strcpy(b[j],temp);
			i++;j--;
		}
	}
	if(i<r) qsort(i,r);
	if(j>l) qsort(l,j);
}

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