题目链接:http://acm.tzc.edu.cn/acmhome/problemdetail.do?&method=showdetail&id=1607
分析:LCA问题,转化为RMQ问题,可以看看一份非常好的学习资料:
http://community.topcoder.com/tc?module=Static&d1=tutorials&d2=lowestCommonAncestor
#include
#include
#include
#include
#include
#include