Online Judge | Problem Set | Authors | Online Contests | User | ||||||
---|---|---|---|---|---|---|---|---|---|---|
Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest |
其实不用在意哪棵树输入的时候处理一下,把相邻相同的树合并在一起,这样tree[i],tree[i-1]的转移一定需要移动一次, dp[i][j]=max(dp[i-2][j],dp[i-1][j-1])+tree[i]; Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator