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

解题报告:DP

Posted by lvcheng at 2010-05-24 22:22:03 on Problem 1071
DP解法,用Reach[k][i][j]表示经过k次后能到达的格子,当然是倒着走。
然后根据方向分类讨论,对于每一个方向,决策范围是[L,R]闭区间,很容易想到用单调队列,但此题有一个特殊之处,就是最优决策和不优决策的差别就是一个为真,一个为假,
(真表示上一轮能到达该格子,假表示不能),所以只要用一个变量保存离状态最近的决策就可以了。维护方法同单调队列。时间复杂度:O(N*M*K).

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