03 March 2020

Codeforces Ozon Tech Challenge (Div. 1 + Div. 2) Postmortem

What went well
  • C was a silly number theory problem, which I got in ~10 minutes. This might be my fastest C solve yet.
What went wrong
  • I was unable to debug my solution to D in ~2 hours. I initially started pursuing an idea which involved querying vertices from pairs of vertices, but then I wasn't sure which two of the (up to) four vertices I should query. Then I noticed that I can just "trim the tree" by querying two leaves at once and pruning the tree if the LCA were neither leaves queried. However, I overcomplicated my solution by removing the vertices in the path from the leaf to the LCA, so I'm sure the bug is somewhere in there.
  • I wasn't sure how to prove B, which took me 20 minutes to solve.
Where I got lucky
  • I gained elo so my rating is back above 1700. Yay!