摘要:
题意:是否唯一确定顺序,根据情况输出#include #include#include#includeusing namespace std;/* run this program using the console pauser or add your own getch, system("pause") or input loop */#define N 30int n,m;int map[N][N],indegree[N],list[N];int toposort(int n){ int in[N],flag,t,num; memcpy(in,indegree,siz 阅读全文
posted @ 2013-07-31 15:44
Teemo的技术blog
阅读(147)
评论(0)
推荐(0)
摘要:
题意:求最出小环,输出路径#include #includeusing namespace std;#define N 110#define INF 0xffffffint map[N][N],n,m,dist[N][N],pre[N][N],path[N];/* run this program using the console pauser or add your own getch, system("pause") or input loop */void floyd(){ int i,j,k,ans=INF,num,p; for(i=0;idist[i][k]+d 阅读全文
posted @ 2013-07-31 11:04
Teemo的技术blog
阅读(64)
评论(0)
推荐(0)
摘要:
#include #includeusing namespace std;#define N 110#define INF 0xffffffint map[N][N],n,m,dist[N][N];/* run this program using the console pauser or add your own getch, system("pause") or input loop */void floyd(){ int i,j,k,ans=INF; for(i=0;id) map[a-1][b-1]=map[b-1][a-1]=d; } floyd(); } re 阅读全文
posted @ 2013-07-31 10:08
Teemo的技术blog
阅读(107)
评论(0)
推荐(0)