
拓扑排序
风之旅@
努力到一定的程度,幸运就会与你不期而遇
展开
-
HDU - 1285 确定比赛名次
有N个比赛队(1<=N<=500),编号依次为1,2,3,。。。。,N进行比赛,比赛结束后,裁判委员会要将所有参赛队伍从前往后依次排名,但现在裁判委员会不能直接获得每个队的比赛成绩,只知道每场比赛的结果,即P1赢P2,用P1,P2表示,排名时P1在P2之前。现在请你编程序确定排名。 Input 输入有若干组,每组中的第一行为二个数N(1<=N<=500),...原创 2019-01-24 17:22:35 · 120 阅读 · 0 评论 -
POJ - 2367 Genealogical tree
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...原创 2019-01-25 17:34:43 · 213 阅读 · 0 评论 -
HDU - 2094 产生冠军
有一群人,打乒乓球比赛,两两捉对撕杀,每两个人之间最多打一场比赛。 球赛的规则如下: 如果A打败了B,B又打败了C,而A与C之间没有进行过比赛,那么就认定,A一定能打败C。 如果A打败了B,B又打败了C,而且,C又打败了A,那么A、B、C三者都不可能成为冠军。 根据这个规则,无需循环较量,或许就能确定冠军。你的任务就是面对一群比赛选手,在经过了若干场撕杀之后,确定是否已经实际上产生了冠军...原创 2019-01-25 17:50:12 · 104 阅读 · 0 评论 -
POJ - 2585 Window Pains
Boudreaux 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. D...原创 2019-01-25 18:18:54 · 197 阅读 · 0 评论 -
HDU - 3342 Legal or Not
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, Qinz and so on chat on-...原创 2019-01-26 14:03:56 · 138 阅读 · 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...原创 2019-01-27 16:55:10 · 187 阅读 · 0 评论