Shirlies
宁静专注认真的程序媛~
摘要: 这是一道纯粹的拓扑排序,刘汝佳的《算法入门经典》p110里面有例题. 1 #include "stdio.h" 2 #include "string.h" 3 4 int task[102][102]; 5 int vis[102]; 6 int n,m; 7 int k; 8 int topo[102]; 9 10 int dfs(int u);11 void toposort(void);12 13 int main()14 {15 int i;16 int a,b;17 while(scanf("%d%d",&n,&am 阅读全文
posted @ 2012-03-01 22:38 Shirlies 阅读(892) 评论(0) 推荐(0) 编辑
摘要: 这一题是参考别人的,但是此题用到了映射,第一次用映射,感觉到了stl的方便之处http://blog.csdn.net/acb0y/article/details/5865561 阅读全文
posted @ 2012-03-01 22:33 Shirlies 阅读(172) 评论(0) 推荐(0) 编辑