Codeforces 练习计划 #2

Codeforces 414E

RXDoi posted @ 2016年1月20日 15:34 in Codeforces , 57 阅读

wjz大爷一个多月前随手秒的题……


考虑Splay维护DFS序,记左右括号,维护深度。LCA就是它们之间深度最小的点的父亲。(再特判下)

注意到深度在DFS序上是连续的,因此第三个操作只要在Splay上面走一遍就可以了。

 

或者可以用欧拉遍历序。LCA直接取个min就可以了。

Avatar_small
Mystic Messenger 说:
2022年8月08日 19:11

This game is quite captivating and in this article we will be showing you how you can download this game, Mystic messenger for Android and IOS. At the same time we will also discuss the possibilities of downloading Mystic messenger for PC. Mystic Messenger One of the reasons why this game is quite sleek to play is because the size is around 28MB which ensures that your device is on top performance while playing this game.


登录 *


loading captcha image...
(输入验证码)
or Ctrl+Enter