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

我用的ELFhash也TLE了,下官方数据看了下,字符串都长的长不多“zaaabclnk zaaabclnl”(见内),这种情况下ELFhash是不是冲突会变得暴多?有没有用ELFhash过了?

Posted by bluewind at 2007-08-15 17:37:50 on Problem 2513
In Reply To:您的细节写得糙了吧,写得好的话可以到 1000ms的,当然trie时最好了 Posted by:sunmoonstar_love at 2005-08-23 17:59:49
int ELFhash(char *key){
	unsigned int g,h=0;
	while(*key){
		h=(h<<4)+(*key++);
		g=h & 0xf0000000L;
		if (g) h^=g>>24;
		h&=~g;
	}
	return h%M;
}

zaaabclni zaaabclnj
zaaabclnk zaaabclnl
zaaabclnm zaaabclnn
zaaabclno zaaabclnp
zaaabclnq zaaabclnr
zaaabclns zaaabclnt
zaaabclnu zaaabclnv
zaaabclnw zaaabclnx
zaaabclny zaaabclnz
zaaabcloa zaaabclob
zaaabcloc zaaabclod
zaaabcloe zaaabclof
zaaabclog zaaabcloh
zaaabcloi zaaabcloj
zaaabclok zaaabclol
zaaabclom zaaabclon
zaaabcloo zaaabclop
zaaabcloq zaaabclor
zaaabclos zaaabclot
zaaabclou zaaabclov
zaaabclow zaaabclox
zaaabcloy zaaabcloz
zaaabclpa zaaabclpb
zaaabclpc zaaabclpd
zaaabclpe zaaabclpf
zaaabclpg zaaabclph
zaaabclpi zaaabclpj
zaaabclpk zaaabclpl
zaaabclpm zaaabclpn
zaaabclpo zaaabclpp
zaaabclpq zaaabclpr
zaaabclps zaaabclpt
zaaabclpu zaaabclpv
zaaabclpw zaaabclpx
zaaabclpy zaaabclpz
zaaabclqa zaaabclqb
zaaabclqc zaaabclqd
zaaabclqe zaaabclqf
zaaabclqg zaaabclqh
zaaabclqi zaaabclqj
zaaabclqk zaaabclql
zaaabclqm zaaabclqn
zaaabclqo zaaabclqp
zaaabclqq zaaabclqr
zaaabclqs zaaabclqt

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