摘要:
原题 A. Generous Kefatime limit per test:2 secondsmemory limit per test:256 megabytes input:standard input output:standard output One day Kefa found n b 阅读全文
摘要:
概念 公共祖先,就是两个节点在这棵树上深度最大的公共的祖先节点 举个例子吧,如下图所示4和5的最近公共祖先是2,5和3的最近公共祖先是1,2和1的最近公共祖先是1。 算法 常用的求LCA的算法有:Tarjan/DFS+ST/倍增 其中 :ST和倍增都是在线的;Taijian是离线的 这里介绍离线的T 阅读全文