### AminAnvari's blog

By AminAnvari, 6 years ago,

Hi :)
These are some LCA (lowest common ancestor) problems. I hope you enjoy them.
I tried to sort them by difficulty. If you know more problems, add it to comments.

• +94

 » 6 years ago, # |   +11 Here I found a few LCA / LCA modifications :)
•  » » 4 years ago, # ^ |   -6 Some basic LCA problems? Which can be solved by only using LCA? By some I mean many please! O_o
 » 6 years ago, # |   +6 Thank you so much for taking the time to compile all these lists.I really appreciate your work!
 » 6 years ago, # |   +21 504E - Misha and LCP on TreeLCA + hash
 » 6 years ago, # |   +6 Thanks for gathering all problems with same tag!! I was looking for LCA ones :D
 » 6 years ago, # |   +11 Another LCA problmes:Qtree spoj : LCA + Heavy-light Decomposition + segment tree372D - Choosing Subtree is Fun : LCA + sorting + dfs(starting time calculating) + two_pointer (or Heavy-light Decomposition)342E - Xenia and Tree : LCA + Sqrt Decomposition
•  » » 6 years ago, # ^ | ← Rev. 2 →   0 342E — Xenia and Tree can be solved by both -decomposition and centroid decomposition.
 » 6 years ago, # |   +3
 » 5 years ago, # | ← Rev. 2 →   0 A great LCA problem from codechef : TOMJERGA
 » 4 years ago, # |   +9 916E - Jamie and Treethe newest one :)
•  » » 3 years ago, # ^ |   0 Nice problem
 » 4 years ago, # | ← Rev. 3 →   0 I wrote code for 191C but I got verdict: wrong answer on test 3. please, tell to me, why my code does not works correctly. link: https://codeforces.com/contest/191/submission/39604271
 » 4 years ago, # |   +3 986E - Prince's ProblemNice problem :)
 » 4 years ago, # | ← Rev. 2 →   0 http://www.spoj.com/problems/DISQUERY/ this is problem based only on LCA. this problem is from the SPOJ. update: this problem is not based only on lca, sorry for mistake.
 » 3 years ago, # |   0 https://codeforces.com/contest/1062/problem/E Nice LCA problem ^_^
•  » » 3 years ago, # ^ |   0 But Why I am getting WA :(My CODE
•  » » 3 years ago, # ^ | ← Rev. 2 →   0 DFS + LCA + Dual Segment Tree...Solved in O(n*log(n)^2)Longest Code in my life but what a nice problem!!!
 » 3 years ago, # | ← Rev. 2 →   0 Marathon on a Tree Simple application of LCA
 » 3 years ago, # | ← Rev. 2 →   0 https://www.hackerrank.com/contests/101hack26/challenges/sherlock-and-queries-on-the-graph (LCA + Bridge finding) :) and thank you so much for your list
 » 3 years ago, # |   0 Two easy ones and a harder one
 » 2 years ago, # |   -22 Thanks for these problem list and i was waited for this
 » 2 years ago, # |   +4 this problem from a recent round1-Trees and Queries
 » 2 years ago, # |   +9 https://codeforces.com/contest/1328/problem/Ein the recently contest
 » 17 months ago, # | ← Rev. 2 →   0 csacademy's Identifying-Infected is a LCA tagged problem. How to approach this? Sorry for necro-bumping.
•  » » 17 months ago, # ^ |   0 Answer is the number of cut vertices on the simple path between query vertices in the Block-Cut Tree of the graph. This can be found in logN time by calculating the LCA of the Block-Cut Tree.
•  » » » 12 months ago, # ^ |   0 would you plz provide a link about block-cut tree.