
LCA
UCAS王小二
不念过去,不畏未来...
展开
-
HDU 2586 How far away ?【LCA入门】
There are n houses in the village and some bidirectional roads connecting them. Every day peole always like to ask like this “How far is it if I want to go from house A to house B”? Usually it hard...原创 2018-04-11 21:23:10 · 228 阅读 · 0 评论 -
NAIPC2016 I. Tourists【LCA】
题意:求一棵树上∑i\sum i∑i号节点到它所有因子的路径和; 分析:预处理因子,LCA求树上两点距离(logn). #include <cstdio> #include <algorithm> #include <cmath> #include <queue> #include <vector> #include <cstrin...原创 2018-10-03 09:53:34 · 345 阅读 · 0 评论