随笔分类 -  DP----树形换根dp

摘要:洛谷 P6626 [省选联考 2020 B 卷] 消息传递 Problem 原题传送门 给一棵有$n$个节点的树。有$m$个询问,每次给出一对$x,k$表示查询到点$x$的距离为$k$的点有多少个。 $T$组数据。 $1\sim3:1\le n,m\le10^3\$ $4\sim6:1\le n,m 阅读全文
posted @ 2021-03-05 10:40 Vanilla_chan 阅读(197) 评论(0) 推荐(0)
摘要:【2020.11.25提高组模拟】小 T 与灵石(stone) 题解 题意简述 给一棵根为$1$的树。一共$q$次操作,每次选$k_i$个节点$p_1,p_2,\dots,p_$。设$f_{x,i}$表示$k_i$个点中所有点$p_j$到点$x$的最远距离,即$max_{dis(x,p_i)}$,再 阅读全文
posted @ 2020-11-27 15:34 Vanilla_chan 阅读(150) 评论(0) 推荐(0)