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:用一个灰常简洁的hash就可以到800+ms的。。。。。

Posted by zyz123 at 2011-12-30 21:10:33 on Problem 3274
In Reply To:用一个灰常简洁的hash就可以到800+ms的。。。。。 Posted by:talenth1 at 2011-09-12 18:21:50
> int hash(int x)
> {
>   int sum=0;
>   for(int i=2;i<=k;++i){
> 	sum*=ha;
> 	sum+=a[x][i];
> 	sum%=hm;
> 	if(sum<0)sum+=hm;
>   }
>   return sum;
> }
> 
> //hm=100003,ha=41

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