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:您有空的话帮忙看一下。。。。

Posted by sunmoonstar_love at 2005-08-23 18:57:26 on Problem 2513
In Reply To:您有空的话帮忙看一下。。。。 Posted by:fujieyun at 2005-08-23 18:51:19

function hash( st : string ): longint;
  var i, h, g : longint;
  begin
    h := 0;
   for i := 1 to length(st) do  // 这个是不是可以用 len = length(s);代替呢
      begin
      h := h shl 4 + ord( st[i] );
      g := h and ($f0000000);
      if g>0 then h := h xor( g shr 24 );
      h := h and (not g);
      end;
    h := h mod m;
    hash := h;
    {h := 0;
    for i := 1 to length(st) do
      h := (h*256 + ord( st[i] )) mod m;}
  end;

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