When Did We Meet — Solution & Editorial
Parallel binary search: give every query a candidate time window and, per round, replay the edge timeline ONCE through a union-find, resolving all queries whose midpoint equals the current time. O(log M) replays total. (A Kruskal-tree or link-by-time forest with LCA also works.)
Complexity: O((M + Q) log M · α(N))