2013年10月17日
摘要: 并查集 找最大的子集 或者 bfs#include #include #include #include #define N 30000+10#define INF 999999using namespace std;int n,m;int p[N];int v[N];int a,b;int find(int x){return p[x]==x?x:p[x]=find(p[x]); }int main(){ int t; scanf("%d",&t); while(t--) { scanf("%d %d",&n,&m); mems 阅读全文
posted @ 2013-10-17 16:40 风流monkey 阅读(179) 评论(0) 推荐(0) 编辑