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

dfs,一次ac。简单的思路

Posted by shishaobing at 2011-07-12 11:29:33 on Problem 1111
    根据起始位置的坐标进行8个方向的探索,如果某个方向为X,则以该点为起点继续,同时将原来的点标记为走过。对于每一个点都计算一下四周有几个X,假设有num个X,则在周长perimeter加上4-num。
    刚开始写的时候我只用了一个数组来存储地图,结果计算错误了:原因在于我把走过的标记了以后会对后面的点计算周长产生影响;于是乎---------------------我用了两个数组。

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