摘要: Bobo has a tree with n vertices numbered by 1,2,…,n and (n-1) edges. The i-th vertex has color c i, and the i-th edge connects vertices a i and b i. L 阅读全文
posted @ 2019-01-19 21:34 StarHai 阅读(291) 评论(0) 推荐(0) 编辑
摘要: You are given a rooted undirected tree consisting of nn vertices. Vertex 11 is the root. Let's denote a depth array of vertex xx as an infinite sequen 阅读全文
posted @ 2019-01-19 21:28 StarHai 阅读(418) 评论(0) 推荐(0) 编辑
摘要: You are given a rooted tree with root in vertex 1. Each vertex is coloured in some colour. Let's call colour c dominating in the subtree of vertex v i 阅读全文
posted @ 2019-01-19 21:18 StarHai 阅读(416) 评论(1) 推荐(0) 编辑
摘要: Once in a forest, there lived N aggressive monkeys. At the beginning, they each does things in its own way and none of them knows each other. But monk 阅读全文
posted @ 2019-01-19 21:09 StarHai 阅读(319) 评论(0) 推荐(0) 编辑
摘要: 在一个忍者的帮派里,一些忍者们被选中派遣给顾客,然后依据自己的工作获取报偿。在这个帮派里,有一名忍者被称之为 Master。除了 Master以外,每名忍者都有且仅有一个上级。为保密,同时增强忍者们的领导力,所有与他们工作相关的指令总是由上级发送给他的直接下属,而不允许通过其他的方式发送。现在你要招 阅读全文
posted @ 2019-01-19 21:05 StarHai 阅读(343) 评论(0) 推荐(0) 编辑