摘要: LCA-求树上两点最近公共祖先问题 lrj的紫书上提供了一种将LCA问题转化为RMQ问题的方法,即dfs一次处理出一个序列,first(u)代表u第一次出现的下标,则对于u,v的最近公共祖先的下标即为RMQ(first(u), first(v))。 LCA->RMQ(在线处理): Tarjan算法( 阅读全文
posted @ 2017-03-20 21:23 Robin! 阅读(163) 评论(0) 推荐(0) 编辑
摘要: Description The multiplication puzzle is played with a row of cards, each containing a single positive integer. During the move player takes one card 阅读全文
posted @ 2017-03-20 17:30 Robin! 阅读(307) 评论(0) 推荐(0) 编辑