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

Re:我也想请教下树形DP怎么过?比赛时使用贪心过的

Posted by shi_mj at 2008-07-23 17:40:02 on Problem 3659
In Reply To:Re:我也想请教下树形DP怎么过?比赛时使用贪心过的 Posted by:MrRight at 2008-07-23 11:39:46
> //f[i][0] 表示以i为根的子树,根不取,所有点都满足条件的最优值
> //f[i][1] 表示以i为根的子树,根取,所有点都满足条件的最优值
> //f[i][2] 表示以i为根的子树,根不取,除了根之外其他点都满足条件的最优值 (根满足也行不满足也行) 
> 
> 这样设状态可以过,也有其他几种不同的表示方法吧。不过好像最少都要三个状态的


不明白为啥要第三种状态 ,  我只写了前两个状态  不过WA了  -。-

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