本文版权归ljh2000和博客园共有,欢迎转载,但须保留此声明,并给出原文链接,谢谢合作。
本文作者:ljh2000
作者博客:http://www.cnblogs.com/ljh2000-jump/
转载请注明出处,侵权必究,保留最终解释权!
题目链接:BZOJ2594
正解:LCT
解题报告:
这道题需要维护动态删边,每次查询两点间的最大边权的最小值。
显然用LCT维护最小生成时即可,由于是删边,我们转化为倒着加边就可以了,就跟上一道题:魔法森林几乎一模一样了。
注意这题卡常,对于边的话,可以先sort一遍,依次往里面加,相当于是做了一遍最小生成树,常数小很多。
//It is made by ljh2000
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include