随笔分类 -  其它 -- 虚树

摘要:A. 组队比赛 签到。 Code cpp / Author: heyuhhh Created Time: 2020/4/18 12:10:50 / include include include include include include include include include incl 阅读全文
posted @ 2020-04-21 08:51 heyuhhh 阅读(370) 评论(0) 推荐(0) 编辑
摘要:P2495 [SDOI2011]消耗战 "题目链接" 题解: 虚树$dp$入门题吧。虚树的核心思想其实就是每次只保留关键点,因为关键点的dfs序的相对大小顺序和原来的树中结点dfs序的相对大小顺序都是一样的,所以可以就求出dfs序并且利用它来构造。最后的图中只有关键点以及某些关键点对的lca。 具体 阅读全文
posted @ 2019-05-21 22:34 heyuhhh 阅读(141) 评论(0) 推荐(0) 编辑