https://www.hackerrank.com/contests/illuminati/challenges/tree-covering 这道题先是在上次交流讨论了一下,然后两位百度的朋友先写完代码share出来了,觉得是道很好的题,就做了一下.https://gist.github.com/coder32167/6964331 https://gist.github.com/snakeDling/6965299基本思想是贪心.根据题意,所选的点必然是叶子节点,那么首先找出树的直径,直径上…