Rikka with Tree 题意:给出树的定义,给出树相似的定义和不同的定义,然后给出一棵树,求是否存在一颗树即和其相似又与其不同.存在输出NO,不存在输出YES. 思路:以1号节点为根节点,我们观察到一颗树如果不存在这种树即与其相似又与其不同,那么这棵树要么所有节点的深度都不一样,要么有深度一样的并且他们的父节点都一样,后来想想,如果当前节点的父节点有多个儿子,那么当前节点则不能有儿子节点,否则就可以将儿子节点转移到兄弟节点上.思路很正确,比赛的时候用深搜递归写就错了,改成两层循环枚举任意…
Sea and Sky are the most favorite things of iSea, even when he was a small child. Suzi once wrote: white dew fly over the river, water and light draw near to the sky. What a wonderful scene it would be, connecting the two charming scenery. But iSea…