Online Judge | Problem Set | Authors | Online Contests | User | ||||||
---|---|---|---|---|---|---|---|---|---|---|
Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest |
很简单In Reply To:谁能说说hash函数是怎么找的啊? 我只会trie解法 Posted by:lijinwu at 2010-04-14 14:57:31 int hash(char s[12]) { int h=1; int n=strlen(s); for(int j=0;j<n;j++) { h+=h*29+(s[j]-'a'); h%=N; } return h; } Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator