3687专题

Poj 3687 Labeling Balls[拓扑排序]

题目链接:点击打开链接 很给力的道题,拓扑排序的应用,算是对TopSort认识更深了吧。 拓扑排序这里不做过多的解释,主要来说这道题的应用。 题目的意思就是给1——N质量的N个球贴标签,要求就是满足要求下的标签小的尽量轻。 没什么深入想,直接TopSort。果断WA,WA的。后来看题,发现了很多的问题。输出的是Label1-LabelN标签的重量。还有很多的问题没有看太清晰。 再看了几

两次入坑逆向拓扑序(POJ 3687 Labeling Balls and HDU 4857 逃生)

第一次跳坑 POJ 3687 Labeling Balls 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 same label