Hi
We have a problem on a tree.
Imagine order of our algorithm is:
Sigma x(i) ^ 2
That if we define sz[v] as number of vertices in subtree of v, x(i) is number of different sz[u] between v's children.
It's easy to see it's O(n * sqrt(n)).
But after this submission for problem 1179D I saw it was realy fast and now I think it might be better than O(n * sqrt(n)).
Any idea?