Problem 3820 · Medium

Pythagorean Distance Nodes in a Tree

Measure every node’s distance to three marked nodes with one breadth-first search each, then test whether the sorted triple of distances satisfies a squared sum rule.

Open the interactive visualisation