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

这道题的NC到底有什么用?我用hash过的,用的是lrj书上的hash函数,但是很慢,是不是需要设计和NC有关的hash函数?

Posted by firefox at 2005-09-20 18:07:06 on Problem 1200
unsigned int hash(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%NHASH;
}

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