HDU3078 Network LCA+RMQ

题意是给你一棵树,树上的节点有权值,输入a,b,c,查询b到c路径中排第a的值,若是a是0,则是修改点b的值为c.这题只要打一个在线的LCA而后每次查询,把路径上的值记录在数组中,排序并输出就好。 #include <stdio.h> #include <string.h> #include <iostream> #include <algorithm> #include <stack> #inc
相关文章
相关标签/搜索