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

400题咯^_^ 基本思路:

Posted by 2008022118 at 2010-08-24 19:54:01 on Problem 1810
因为题目说了,不存在整数坐标,即点的x,y不会为整数。这就好办了,我们直接把小数变成整数即可,相当于这些点落在正方形的小格子里面。然后就是个二位的树状数组,求包含最多的点数M*M的正方形。因为N<=1000,也可直接dp。反正先要记录每个格子的点数,即val[i][j].
点落在哪个格子,很简单,强制转换一下即可。

我用的树状数组,效率不太高1800+ms。不会树状数组的,dp也行,dp[i][j]:以i,j为右上角的到(0,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