GYM D - Beauty and The Tree Gym - 101864D(启发式合并)
题意:一棵树,每层深度的值为这层深度所有节点权值和。求删掉iii节点对应子树后的最大深度值。思路:裸的启发式合并。先递归轻子树并清空,再递归重子树并且不清空,再遍历轻子树统计结果。#include<cstdio>#include<string>#include<cstring>#include<iostream>#include<algorithm>#inc