Online Judge | Problem Set | Authors | Online Contests | User | ||||||
---|---|---|---|---|---|---|---|---|---|---|
Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest |
提供一种可行的哈希做法设一棵子树的哈希值为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: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator