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

提供一种可行的哈希做法

Posted by PoPoQQQ at 2014-07-20 17:22:44 on Problem 1635
设一棵子树的哈希值为hash,大小为size,根节点深度为deep
则hash[x]=hash[ son[x][1] ]^hash[ son[x][2] ]^...^hash[ son[x][k] ]+size*pow(a,deep)
a为一个大于1500的常数 我用的是1523
异或改成*会被卡死 这题真阴

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