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:4860ms....我怀疑我写的到底是不是BST..

Posted by ARA at 2010-06-22 19:57:30 on Problem 2418
In Reply To:4860ms....我怀疑我写的到底是不是BST.. Posted by:ARA at 2010-05-16 08:41:55
改成 Hash 后只有 800ms!!!!!!ORZ!!!

function BKBHash(t: tstr): longint;
const
	dumb_seed = 131313;
var
	l, i, result: longint;
begin
	l := length(t);
	result := 0;
	for i := 1 to l do
		result := (result * dumb_seed + ord(t[i])) and $7fffffff;
	result := result mod magic_seed;
	exit(result);
end;

magic_seed 请自己 YY

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