Codeforces and Polygon may be unavailable between Aug. 17, 19:00 (UTC) to Aug. 17, 22:00 (UTC) due to planned power outages. ×

Comments
+1

1st and 3rd part must have the same length x

0

Maybe that's the reason why he's still gray.

+9

I print nothing and got WA at first...

0

An edge from u to v doesn't mean that u is the parent of v if we build the tree from root 1

0

There's a template function in c++17 names "std::data", which makes your data variable ambiguous

0

OMG... I tried to calculate the MIN danger, which should be 2^(n — v) where v is the vertices number of the max complete sub-graph, which is NP... it bordered me so long since I find that it's just a misunderstanding when reading this....