### AminAnvari's blog

By AminAnvari, 8 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

| Write comment?
 » 8 years ago, # |   +11 Here I found a few LCA / LCA modifications :)
•  » » 6 years ago, # ^ |   -6 Some basic LCA problems? Which can be solved by only using LCA? By some I mean many please! O_o
 » 8 years ago, # |   +6 Thank you so much for taking the time to compile all these lists.I really appreciate your work!
 » 8 years ago, # |   +21 504E - Misha and LCP on TreeLCA + hash
 » 8 years ago, # |   +6 Thanks for gathering all problems with same tag!! I was looking for LCA ones :D
 » 8 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
•  » » 8 years ago, # ^ | ← Rev. 2 →   0 342E — Xenia and Tree can be solved by both -decomposition and centroid decomposition.
 » 8 years ago, # |   +3
 » 7 years ago, # | ← Rev. 2 →   0 A great LCA problem from codechef : TOMJERGA
 » 6 years ago, # |   +9 916E - Jamie and Treethe newest one :)
•  » » 5 years ago, # ^ |   0 Nice problem
 » 6 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
 » 6 years ago, # |   +3 986E - Prince's ProblemNice problem :)
 » 6 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.
 » 6 years ago, # |   0 https://codeforces.com/contest/1062/problem/E Nice LCA problem ^_^
•  » » 5 years ago, # ^ |   0 But Why I am getting WA :(My CODE
•  » » 5 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!!!
 » 6 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
 » 6 years ago, # |   0 Two easy ones and a harder one
 » 4 years ago, # |   -22 Thanks for these problem list and i was waited for this
 » 4 years ago, # |   +4 this problem from a recent round1-Trees and Queries
 » 4 years ago, # |   +9 https://codeforces.com/contest/1328/problem/Ein the recently contest
 » 3 years ago, # | ← Rev. 2 →   0 csacademy's Identifying-Infected is a LCA tagged problem. How to approach this? Sorry for necro-bumping.
•  » » 3 years 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.
 » 23 months ago, # | ← Rev. 4 →   +5 LCA problem from the contest just now codeforces.com/contest/1702/problem/G2
 » 23 months ago, # | ← Rev. 2 →   +3 Highly recommend))) 786D - Rap God
 » 10 months ago, # | ← Rev. 2 →   0 if you have provided the solution or explanation on how to solve such problems will be of great help. thnxs