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 morenan at 2011-05-23 13:28:12 on Problem 1424 and last updated at 2011-05-23 13:28:54
将曼哈顿距离转化,即:(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:
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