
图论相关
文章平均质量分 82
zhb1997
OIer
展开
-
bzoj1051 [HAOI2006]受欢迎的牛
Description每一头牛的愿望就是变成一头最受欢迎的牛。现在有N头牛,给你M对整数(A,B),表示牛A认为牛B受欢迎。 这种关系是具有传递性的,如果A认为B受欢迎,B认为C受欢迎,那么牛A也认为牛C受欢迎。你的任务是求出有多少头牛被所有的牛认为是受欢迎的。Input第一行两个数N,M。 接下来M行,每行两个数A,B,意思是A认为B是受欢迎的(给出的信息有可能重复,即有原创 2014-09-20 13:05:04 · 582 阅读 · 0 评论 -
poj1330 Nearest Common Ancestors
DescriptionA rooted tree is a well-known data structure in computer science and engineering. An example is shown below: In the figure, each node is labeled with an integer from {1, 2,...,16原创 2014-09-18 16:46:21 · 376 阅读 · 0 评论 -
codevs2822 爱在心中
2822 爱在心中 时间限制: 1 s 空间限制: 128000 KB 题目等级 : 钻石 Diamond题目描述 Description“每个人都拥有一个梦,即使彼此不相同,能够与你分享,无论失败成功都会感动。爱因为在心中,平凡而不平庸,世界就像迷宫,却又让我们此刻相逢原创 2014-09-20 20:20:57 · 653 阅读 · 0 评论 -
bzoj1654 [Usaco2006 Jan]The Cow Prom 奶牛舞会
DescriptionThe N (2 <= N <= 10,000) cows are so excited: it's prom night! They are dressed in their finest gowns, complete with corsages and new shoes. They know that tonight they will each try to原创 2014-10-03 20:56:20 · 1327 阅读 · 0 评论