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:TLE 哪位好心人帮忙看一下瓶颈在那里,该怎么改进?

Posted by ykt at 2005-08-31 16:38:35 on Problem 2503
In Reply To:TLE 哪位好心人帮忙看一下瓶颈在那里,该怎么改进? Posted by:ykt at 2005-08-30 23:59:37
终于AC了,把hash function 改了一下

int evalKey(char *p){
	int key=0; 
	while(*p){
		key=(*p++)+PRIME_NUM*key;
			key=key%MAX_WORD_NUM;
	}
			

	return key; 
}

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