摘要: 求出一个这个工程的工作序列的算法被成为拓扑排序。比如说 1,5,2,3,6,4 就可以算作一个工作序列。拓扑排序的过程大概是这样的:1 选择一个入度为 0 的结点并直接输出。2 删除这个结点以及与它关联的所有边。3 重复步骤 (1) 和 (2),直到找不到入度为 0 的结点。通常情况下,在实现的时候 阅读全文
posted @ 2018-01-22 19:30 lmjer 阅读(875) 评论(0) 推荐(0) 编辑
摘要: #include<stdio.h>#include<cstring>#include<queue>#include<algorithm>using namespace std;struct my{ int v; int next; int dist;};int m,n;const int maxn= 阅读全文
posted @ 2018-01-22 18:22 lmjer 阅读(125) 评论(0) 推荐(0) 编辑