拓扑排序
黑码
这个作者很懒,什么都没留下…
展开
-
poj 2367 拓扑排序
The system of Martians’ blood relations is confusing enough. Actually, Martians bud when they want and where they want. They gather together in different groups, so that a Martian can have one parent a原创 2017-02-07 00:55:55 · 330 阅读 · 0 评论 -
hdu 4857 逃生 反向拓扑排序
糟糕的事情发生啦,现在大家都忙着逃命。但是逃命的通道很窄,大家只能排成一行。 现在有n个人,从1标号到n。同时有一些奇怪的约束条件,每个都形如:a必须在b之前。 同时,社会是不平等的,这些人有的穷有的富。1号最富,2号第二富,以此类推。有钱人就贿赂负责人,所以他们有一些好处。 负责人现在可以安排大家排队的顺序,由于收了好处,所以他要让1号尽量靠前,如果此时还有多种情况,就再让2号尽量靠前,如果还原创 2017-06-09 00:52:53 · 345 阅读 · 0 评论 -
hdu 2647 Reward 逆拓扑排序+队列
Dandelion’s uncle is a boss of a factory. As the spring festival is coming , he wants to distribute rewards to his workers. Now he has a trouble about how to distribute the rewards. The workers will原创 2017-06-14 10:26:20 · 652 阅读 · 0 评论 -
hdu 5438 Ponds 拓扑排序 + 并查集
Betty owns a lot of ponds, some of them are connected with other ponds by pipes, and there will not be more than one pipe between two ponds. Each pond has a value vv. Now Betty wants to remove some pon原创 2017-06-14 12:05:26 · 360 阅读 · 0 评论