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 |
我的想法将曼哈顿距离转化,即:(x,y)->(x+y,x-y) 这样,距离公式|x2-x1|+|y2-y1|就变成了max(|x2-x1|,|y2-y1|) 斜着的正方形就变正了 但要注意的是,(x and 1) xor (y and 1) 必须为0 所以要枚举正方形边长,用两个线段树扫描 Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator