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 |
这题竟然可以发现标准hash的bug......经过我提交本题20+次 加上搜索网上数据得出 int ELFhash(char* key) { unsigned long h = 0; while(*key) { h = (h<<4) + *key++; unsigned long g = h & 0Xf0000000L; if(g) h ^= g >> 24; h &= ~g; } return h % M; } 这个hash算法有覆盖= =; 例如eeeeeefvnb eeeeeegfnb这2个hash值竟然一样(函数里h算出来的就一样) 厄。。。。。 Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator