Skip to main content
๐Ÿ“œ WAYPOINT LESSON

Contest 3-A: Signal Chain

โญ beginnerโณ 40 min read๐Ÿ“ Lesson 197 of 281

Mock contest 3, problem A: LCA path sums with binary lifting. Target: solved within 40 minutes.

Contest 3-A โ€” Signal Chain. Node-weighted path sums: preprocess root distances and a binary-lifting table; answer = rd[u] + rd[v] - 2*rd[lca] + w[lca]. Graded near-miss: per-query parent climbing.

Contest 3-A. The wrong version produces correct answers but walks O(depth) per query โ€” the bamboo load test buries it.