![](https://img-blog.csdnimg.cn/20201014180756757.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
LCA
文章平均质量分 79
black_miracle
这个作者很懒,什么都没留下…
展开
-
Kattis boxes LCA
There are NN boxes, indexed by a number from 11 to NN. Each box may (or not may not) be put into other boxes. These boxes together form a tree structure (or a forest structure, to be precise).Yo原创 2017-02-28 23:03:33 · 349 阅读 · 0 评论 -
SDU 1247 LCA
CastleTime Limit: 1s Memory Limit: 128.0 MBDescriptionThe cosmic leader Loki is exploring a castle full of treasure. The castle can be considered as a connected undirected graph with NN ve原创 2017-04-17 20:36:34 · 308 阅读 · 0 评论 -
FJU 1154 LCA+tarjan
Fat Brother And His LoveTime Limit: 2 Sec Memory Limit: 128 MBDescriptionAswe know, fat Brother and his goddess is in a same city. The city isconsist of N locations and the N locations原创 2017-04-17 21:58:23 · 270 阅读 · 0 评论 -
codeforces 1062E
传送门:https://codeforces.com/contest/1062/problem/E题意:给你一棵树,每次询问[l,r]区间删掉一个点后,剩余的点的lca深度最大是多少,输出删除的点和lca深度。题解:首先一堆点的lca就是dfs序最大的点和最小的点的lca,那么我们只用考虑删掉这两个点后的lca是多少就可以了,维护区间dfs序最大和次大,最小和次小。#include&...原创 2019-01-24 12:02:51 · 233 阅读 · 0 评论