Tried getting an answer with Claude Opus but didn't work.. after 10 minutes of thinking got a "I'd be mildly surprised but not shocked if there's an O(N polylog) tree algorithm — none of the standard tricks (centroid decomp, small-to-large, heavy-light, virtual tree, segment tree merging)" Problem: There is a tree size N where some nodes are marked (there are people living on the nodes or something). You have to organize a meeting so the maximum amount of people attend, but no one wants to go to a meeting if it's farther than X nodes away. Answer for each X, whats the maximum amount of people that will attend the meeting if the meeting node is choosed optimally. i.e. find for each X find a node in a tree that has the maximum marked nodes within X distance. O(N^2) is obvious.. looking for something faster submitted by /u/ItsJakov [link] [comments]