拓扑排序
墨碎江南
这个作者很懒,什么都没留下…
展开
-
HDU - 4857 逃生 (拓扑排序)
糟糕的事情发生啦,现在大家都忙着逃命。但是逃命的通道很窄,大家只能排成一行。 现在有n个人,从1标号到n。同时有一些奇怪的约束条件,每个都形如:a必须在b之前。 同时,社会是不平等的,这些人有的穷有的富。1号最富,2号第二富,以此类推。有钱人就贿赂负责人,所以他们有一些好处。 负责人现在可以安排大家排队的顺序,由于收了好处,所以他要让1号尽量靠前,如果此时还有多种情况,就再让2号尽量靠前,如果还有...原创 2018-04-19 10:31:37 · 151 阅读 · 0 评论 -
Rank of Tetris HDU - 1811 (拓扑排序)
自从Lele开发了Rating系统,他的Tetris事业更是如虎添翼,不久他遍把这个游戏推向了全球。为了更好的符合那些爱好者的喜好,Lele又想了一个新点子:他将制作一个全球Tetris高手排行榜,定时更新,名堂要比福布斯富豪榜还响。关于如何排名,这个不用说都知道是根据Rating从高到低来排,如果两个人具有相同的Rating,那就按这几个人的RP从高到低来排。 终于,Lele要开始行动了,对N个...原创 2018-04-24 16:45:15 · 151 阅读 · 0 评论 -
POJ - 1094 Sorting It All Out (拓扑排序)
An ascending sorted sequence of distinct values is one in which some form of a less-than operator is used to order the elements from smallest to largest. For example, the sorted sequence A, B, C, D im...原创 2018-04-25 21:28:53 · 130 阅读 · 0 评论 -
POJ - 3687 Labeling Balls(拓扑排序)
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.The labeling satisfies several constrains like...原创 2018-04-27 17:23:08 · 116 阅读 · 0 评论 -
POJ - 1270 Following Orders(拓扑排序+dfs回溯)
Order is an important concept in mathematics and in computer science. For example, Zorn's Lemma states: ``a partially ordered set in which every chain has an upper bound contains a maximal element.'' ...原创 2018-04-27 20:39:00 · 463 阅读 · 0 评论 -
Drazil and Tiles CodeForces - 515D
Drazil created a following problem about putting 1 × 2 tiles into an n × m grid: "There is a grid with some cells that are empty and some cells that are occupied. You should use 1 × 2 tiles to cover ...原创 2018-11-03 19:46:47 · 159 阅读 · 0 评论