Good day CF community.
Today I tried to challenge myself and solve a hard problem and I did...kinda.
Right now I'm stuck in test 8 I have no idea what's wrong with my solution could somebody please help me out ???
Here is my code 22656856 and the problem 588E - Duff in the Army.
My idea is to find the IDs from node u to node 1 and from node v to node 1 and from LCA(u,v) to node 1 and then my answer will be (IDs(u) + IDs(v) — IDs(LCA(u,v))) I'm not sure if the idea is wrong or the implementation.
I'll be very grateful for any kind of help.
Thank you for reading.
:)