文章分类 -  拓扑

摘要://并查集+拓扑排序,‘=’ 用并查集处理#include#include#includeusing namespace std;vectornext[10005]; //相当于邻接表int set[10005]; //并查集数组int in[10005]; //记录入度int A[20005],B[20005]; char oper[20005];int n,m,sum;int find(int x){ return set[x]==x?x:find(set[x]);}int merge(int x,int y){ int a=find(x); int b=find... 阅读全文
posted @ 2013-09-12 10:08 heaventouch 阅读(93) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示