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 xieranmaya at 2008-11-12 13:20:08 on Problem 1002 and last updated at 2008-11-12 13:20:19
In Reply To:终于过了!!总结一下超时的地方希望有所帮助。 Posted by:20071121181 at 2008-11-04 13:42:44
		for(j=0;j<l;j++)
		{
			if(k==3)tmp[k++]='-';
			if(str[i][j]>='0'&&str[i][j]<='9')
				tmp[k++]=str[i][j];
			else if(str[i][j]>='A'&&str[i][j]<='P')
				tmp[k++]=(str[i][j]-'A')/3+2+'0';
			else if(str[i][j]>='R'&&str[i][j]<='Y')
				tmp[k++]=(str[i][j]-'A'-1)/3+2+'0';
		}

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