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表存储不同的连通块,求出连通分量点的x和y的平均值。以每个点到平均值差的四次方作为哈希值 为啥是四次方。我想当然的认为是2次方也行。结果不对 1 111 1 11 111如果平方是错误。 Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator