随笔分类 -  动态规划--树形dp

hdu 6035(树形dp)
摘要:题意:给你棵树,树上每个节点都有颜色,每条路径上有m种颜色 问你所有路径上出现的颜色的和 思路:答案求的是每种颜色对路径的贡献 我们可以反过来每种颜色不经过的路径的条数 假设根节点的颜色为x 我们就可以知道不过x颜色的路径一定不经过这个根节点 和不经过这个子树中颜色为x的节点 所有树形dp。。。。。 阅读全文

posted @ 2017-10-22 20:10 见字如面 阅读(190) 评论(0) 推荐(0)

hdu 4123(树形dp+倍增)
摘要:Bob’s Race Time Limit: 5000/2000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 3741 Accepted Submission(s): 1206 Prob 阅读全文

posted @ 2017-09-23 00:30 见字如面 阅读(143) 评论(0) 推荐(0)

CodeForces - 743D Chloe and pleasant prizes
摘要:Chloe and pleasant prizes time limit per test 2 seconds time limit per test memory limit per test 256 megabytes memory limit per test input standard i 阅读全文

posted @ 2017-08-08 00:08 见字如面 阅读(290) 评论(0) 推荐(0)

POJ - 3107 Godfather(树的重心)
摘要:Godfather Last years Chicago was full of gangster fights and strange murders. The chief of the police got really tired of all these crimes, and decide 阅读全文

posted @ 2017-03-26 22:37 见字如面 阅读(328) 评论(0) 推荐(0)

导航