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

ac不易……一些经验,为后来人少走弯路

Posted by wyq517 at 2009-09-07 17:58:56 on Problem 3347 and last updated at 2009-09-07 18:18:16
将坐标系扩大sqrt2倍,这样就变成整点运算,降低复杂度

之后是排列,方块紧挨y轴或前方的方块,无交叉

这里就是求新方块 i 的x,我的方法,除 i 是第一个或i长度比i-1小的,都枚举之前所有方块贴紧后的坐标,利用其斜45°特性,x为之前某方块x + 当前两方块较小方块的边长 * 2,取最大(当然可以在适当的时候中断,避免不必要的比较)

最后是遮挡,转化成线段,对每一线段,从左到右枚举在其上的线段,有部分被遮挡则x1增加,直至x1=x2;


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