http://www.51nod.com/onlineJudge/questionCode.html#!problemId=1500 思路: 树形dp. 我们考虑当前结点 i ,对于结点 i ,它可以属于它的子树,也可以不属于,换句话说,我们可以计算出与 i 结点相连的连通块中是否具有黑点的方案数. 于是,d[i][1]表示包含 i 的连通块中含有黑点,d[i][0]表示不含有. 接下来考虑状态转移方程: d[u][]=(d[u][]*(d[v][]+d[v][])+d[u][]*d[v][])…
Dividing Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 14861 Accepted Submission(s): 4140 Problem Description Marsha and Bill own a collection of marbles. They want to split the collection…