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 dnc1994 at 2011-01-07 15:20:46 on Problem 2227
用一个堆维护最低高度。先将四周的高度加入堆中。每次选取当前高度最低的点出堆作为源点,并访问它上下左右的点,如果未被访问过则将其加入堆中并标记为已访问。在此前提下若该点高度比源点低,则inc(ans,△H),并将该点高度修改为与源点相同。当堆空时退出程序。

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