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 hkrcn at 2010-04-02 09:38:53 on Problem 1324
(1) BFS得出蛇的所有可能的形态(不考虑石子阻隔),存在table数组里面;
(2) 直接对蛇头进行BFS,根据table数组扩展。

因为蛇从旧位置到新位置,实际上只有蛇头是占用了新的格子,又因为table数组里记录的是所有合法的蛇的扩展形态,所以,直接对蛇头进行BFS即可。
这样比较好实现,效率也可以接受(329ms)

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