SPOJ TWOPATHS. Two Paths
Original link: https://www.shuizilong.com/house/archives/spoj-twopaths-two-paths/ https://www.spoj.com/problems/TWOPATHS/ https://codeforces.com/problemset/problem/14/D Question: Find the maximum value of the product of two disjoint paths. Analysis: The dfs order maintains diameter has a very nice property. . . That is, you can find the diameter inside the subtree and the diameter outside the subtree. . So we only need to do dfs again, […]
SPOJ TWOPATHS. Two Paths Read More »