
拓扑排序
永夜莫明
菜是原罪
展开
-
Sorting It All Out (拓扑排序是否有环是否严格有序)
Sorting It All OutAn 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 seq...原创 2018-11-22 21:23:18 · 948 阅读 · 0 评论 -
确定比赛名次(拓扑排序模板题)
确定比赛名次有N个比赛队(1<=N<=500),编号依次为1,2,3,。。。。,N进行比赛,比赛结束后,裁判委员会要将所有参赛队伍从前往后依次排名,但现在裁判委员会不能直接获得每个队的比赛成绩,只知道每场比赛的结果,即P1赢P2,用P1,P2表示,排名时P1在P2之前。现在请你编程序确定排名。Input输入有若干组,每组中的第一行为二个数N(1<=N<=500),M;...原创 2018-11-22 21:29:30 · 288 阅读 · 0 评论 -
任务调度的合理性(拓扑排序裸题)
7-13 任务调度的合理性 (25 分)假定一个工程项目由一组子任务构成,子任务之间有的可以并行执行,有的必须在完成了其它一些子任务后才能执行。“任务调度”包括一组子任务、以及每个子任务可以执行所依赖的子任务集。比如完成一个专业的所有课程学习和毕业设计可以看成一个本科生要完成的一项工程,各门课程可以看成是子任务。有些课程可以同时开设,比如英语和C程序设计,它们没有必须先修哪门的约束;有些课程则...原创 2018-12-17 08:07:18 · 376 阅读 · 0 评论 -
Fox And Names(拓扑排序)
题目链接:http://codeforces.com/problemset/problem/510/C?csrf_token=baadfd2935ac90d344554ddd90621166Input3rivestshamiradlemanOutputbcdefghijklmnopqrsatuvwxyzInput10touristpetrwjmzbmryeputons...原创 2018-12-29 00:42:12 · 179 阅读 · 0 评论 -
Paint the Grid Again(拓扑排序)
题目链接:https://cn.vjudge.net/problem/ZOJ-3780Leo has a grid with N × N cells. He wants to paint each cell with a specific color (either black or white).Leo has a magical brush which can paint any ro...原创 2019-04-23 16:12:45 · 313 阅读 · 0 评论