Vasya and a Tree 题意: 给定一棵树,对树有3e5的操作,每次操作为,把树上某个节点的不超过d的子节点都加上值x; 思路: 多开一个vector记录每个点上的操作.dfs这颗树,同时以深度开一个树状数组,踩到u节点的时候,给数组add(deep, x); add(min(maxn,deep + op[u][i].fi + 1), - op[u][i].se); 搜索下去,反回前得到这个节点的答案,并消去这个点的影响. //#pragma GCC optimize(3) //#pr…