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 MrRight at 2008-07-23 11:39:46 on Problem 3659
In Reply To:我也想请教下树形DP怎么过?比赛时使用贪心过的 Posted by:ruc_t5 at 2008-07-23 10:24:36
//f[i][0] 表示以i为根的子树,根不取,所有点都满足条件的最优值
//f[i][1] 表示以i为根的子树,根取,所有点都满足条件的最优值
//f[i][2] 表示以i为根的子树,根不取,除了根之外其他点都满足条件的最优值 (根满足也行不满足也行) 

这样设状态可以过,也有其他几种不同的表示方法吧。不过好像最少都要三个状态的

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