随笔分类 -  图论 --- 拓扑排序

hdu 1811 Rank of Tetris
摘要:Problem Description自从Lele开发了Rating系统,他的Tetris事业更是如虎添翼,不久他遍把这个游戏推向了全球。为了更好的符合那些爱好者的喜好,Lele又想了一个新点子:他将制作一个全球Tetris高手排行榜,定时更新,名堂要比福布斯富豪榜还响。关于如何排名,这个不用说都知道是根据Rating从高到低来排,如果两个人具有相同的Rating,那就按这几个人的RP从高到低来排。终于,Lele要开始行动了,对N个人进行排名。为了方便起见,每个人都已经被编号,分别从0到N-1,并且编号越大,RP就越高。同时Lele从狗仔队里取得一些(M个)关于Rating的信息。这些信息可能 阅读全文

posted @ 2013-05-02 23:35 江财小子 阅读(230) 评论(0) 推荐(0) 编辑

poj 3687 Labeling Balls
摘要:Labeling BallsTime Limit: 1000MSMemory Limit: 65536KTotal Submissions: 8225Accepted: 2234DescriptionWindy 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 阅读全文

posted @ 2012-11-12 14:49 江财小子 阅读(169) 评论(0) 推荐(0) 编辑

poj 1270 Following Orders
摘要:Following OrdersTime Limit: 1000MS Memory Limit: 10000KTotal Submissions: 2732 Accepted: 1041DescriptionOrder 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 m... 阅读全文

posted @ 2012-11-12 14:45 江财小子 阅读(182) 评论(0) 推荐(0) 编辑

ZOJ 1083 Frame Stacking
摘要:Frame StackingTime Limit: 2 Seconds Memory Limit: 65536 KBConsider the following 5 picture frames placed on an 9 x 8 array.Now place them on top of one another starting with 1 at the bottom and ending up with 5 on top. If any part of a frame covers another it hides that part of the frame below.... 阅读全文

posted @ 2012-11-12 14:43 江财小子 阅读(500) 评论(0) 推荐(0) 编辑

zoj 2193 Window Pains
摘要:Window PainsTime Limit: 2 Seconds Memory Limit: 65536 KBBoudreaux likes to multitask, especially when it comes to using his computer. Never satisfied with just running one application at a time, he usually runs nine applications, each in its own window. Due to limited screen real estate, he ove... 阅读全文

posted @ 2012-11-12 14:38 江财小子 阅读(521) 评论(0) 推荐(0) 编辑

POJ 1094 Sorting It All Out(经典拓扑,唯一排序)
摘要:DescriptionAn 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 implies that A < B, B < C and C < D. in this problem, we will give you a set of re 阅读全文

posted @ 2012-04-21 11:05 江财小子 阅读(242) 评论(0) 推荐(0) 编辑

HDU 1285 确定比赛名次(第一个拓扑排序题目)
摘要:有N个比赛队(1<=N<=500),编号依次为1,2,3,。。。。,N进行比赛,比赛结束后,裁判委员会要将所有参赛队伍从前往后依次排名,但现在裁判委员会不能直接获得每个队的比赛成绩,只知道每场比赛的结果,即P1赢P2,用P1,P2表示,排名时P1在P2之前。现在请你编程序确定排名。Input输入有若干组,每组中的第一行为二个数N(1<=N<=500),M;其中N表示队伍的个数,M表示接着有M行的输入数据。接下来的M行数据中,每行也有两个整数P1,P2表示即P1队赢了P2队。Output给出一个符合要求的排名。输出时队伍号之间有空格,最后一名后面没有空格。其他说明:符合条 阅读全文

posted @ 2012-04-19 18:15 江财小子 阅读(523) 评论(0) 推荐(0) 编辑