Cool.Thanks.

Active In

Competitive Programming

Machine Learning

Bitcoin and Blockchain

International Olympiad in Informatics

Indian Computing Olympiad (ICO)

Artificial Intelligence

ACM International Collegiate Programming Contest

Featured Contributions

reply in this discussion

reply in this discussion

What's the best practice strategy?

- To participate in more&more live contest and upsolve them. OR
- To choose a category and practice it for weeks.

Read more… (24 words)

reply in this discussion

So I finally understood the editorial :D

Our Main Focus is to find the base of windmill .

- First run a dfs from say vertex 1 and record the farthest node from vertex 1 ,let it be V1.
- Now this vertex V1 must be one end of a diameter of the tree. For proof read this : Proof of correctness: Algorithm for diameter of a tree in graph theory
- Now if you run a dfs from V1 you'll get the other end of the diameter say V2.(distance from V1 recorded in dV1[ ])
- Now run dfs vertex from V2 too and record distance of all the vertices.(distance from V2 recorded in dV2[ ])
- So now you have distance of all vertices from both ends of diameter which will ultimately become BASE of your windmill.
- Now simply check for every node in the graph whether it is connected to more than 5 vertices or not.
- If it is then size of it's windmill will b...

Read more… (189 words)

reply in this discussion

reply in this discussion

reply in this discussion

I kinda understood the solution given.

Mathematical Proof?

Read more… (8 words)