codeforces 671D Roads in Yusland & hdu 5293 Tree chain problem

dp dp优化 dfs序 线段树

算是一个套路。可以处理在树上取链的问题。

原文地址:https://www.cnblogs.com/wuyuanyuan/p/9826752.html