拓扑排序
文章平均质量分 90
ACLJW
这个作者很懒,什么都没留下…
展开
-
08-图8 How Long Does It Take
7-12 How Long Does It Take(25 分)Given the relations of all the activities of a project, you are supposed to find the earliest completion time of the project.Input Specification:Each input file contain...原创 2017-12-23 11:05:43 · 399 阅读 · 0 评论 -
08-图9 关键活动
08-图9 关键活动(30 point(s))假定一个工程项目由一组子任务构成,子任务之间有的可以并行执行,有的必须在完成了其它一些子任务后才能执行。“任务调度”包括一组子任务、以及每个子任务可以执行所依赖的子任务集。比如完成一个专业的所有课程学习和毕业设计可以看成一个本科生要完成的一项工程,各门课程可以看成是子任务。有些课程可以同时开设,比如英语和C程序设计,它们没有必须先修哪门的约束;有些课程...原创 2018-02-02 21:53:09 · 258 阅读 · 1 评论 -
10305:Ordering Tasks
Ordering Tasks这题比较简单,就是拓扑排序,而且肯定是有向无环图,直接DFS即可。注意数据读取,只要 n 和 m 有一个不为0即可。。。不考虑是否存在环:#include<bits/stdc++.h>using namespace std;const int maxn = 100 + 10;int m,n,t;int visited[maxn];...原创 2018-08-05 00:29:29 · 182 阅读 · 0 评论