拓扑排序
拓扑排序
DeterminedDiligent
这个作者很懒,什么都没留下…
展开
-
Labeling Balls POJ3687 【拓扑排序反向建边】【邻接表】
http://poj.org/problem?id=3687 Description Windy has N balls of distinct weights from 1 unit to N units. Now he tries to label them with 1 to N in such a way that: No two balls share the原创 2015-08-18 16:12:45 · 586 阅读 · 0 评论 -
确定比赛名次 HDU杭电1285 【拓扑排序】
Problem Description 有N个比赛队(1 Input 输入有若干组,每组中的第一行为二个数N(1 Output 给出一个符合要求的排名。输出时队伍号之间有空格,最后一名后面没有空格。 其他说明:符合条件的排名可能不是唯一的,此时要求输出时编号小的队伍在前;输入数据保证是正确的,即输入数据确保一定能有一个符合要求原创 2015-08-14 16:29:15 · 347 阅读 · 0 评论 -
Reward HDU杭电2647【反向拓扑+队列】
Problem Description 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 rewa原创 2015-08-14 20:09:31 · 396 阅读 · 0 评论 -
逃生 HDU杭电4857 【反向拓扑+优先队列+反向输出】
Problem Description 糟糕的事情发生啦,现在大家都忙着逃命。但是逃命的通道很窄,大家只能排成一行。 现在有n个人,从1标号到n。同时有一些奇怪的约束条件,每个都形如:a必须在b之前。 同时,社会是不平等的,这些人有的穷有的富。1号最富,2号第二富,以此类推。有钱人就贿赂负责人,所以他们有一些好处。 负责人现在可以安排大家排队的顺序,由于收了好处,所以他要让1号原创 2015-08-14 16:33:06 · 592 阅读 · 0 评论 -
Legal or Not HDU杭电3342【拓扑排序】
Problem Description ACM-DIY is a large QQ group where many excellent acmers get together. It is so harmonious that just like a big family. Every day,many "holy cows" like HH, hh, AC, ZT, lcc, BF, Q原创 2015-08-14 18:54:18 · 309 阅读 · 0 评论 -
Triangle LOVE 杭电HDU4324 【拓扑排序】
Problem Description Recently, scientists find that there is love between any of two people. For example, between A and B, if A don’t love B, then B must love A, vice versa. And there is no possibil原创 2015-08-18 10:09:00 · 338 阅读 · 0 评论 -
Genealogical tree POJ 2367【拓扑排序】
Genealogical tree Special Judge Problem Description The system of Martians' blood relations is confusing enough. Actually, Martians bud when they want and where they want. They gather t原创 2015-08-18 21:07:57 · 477 阅读 · 0 评论