摘要: /*无向图*/ #include #include #include #include using namespace std; bool f[100],a[100][100]; int n,m,x,y; void bfs(int t) { int k,closed,open,p[100]={0}; cout>n; cin>>m; memset(f,0,sizeof(f)); memset(a... 阅读全文
posted @ 2016-03-22 21:04 球痞丶小七 阅读(571) 评论(0) 推荐(0)
摘要: 这是一道经典的水题,提供两种方法:①深搜 ②并查集 NO.1 深度优先搜索: #include<iostream>#include<cstdio>#include<algorithm>#include<cstring>using namespace std;bool a[10100],f[10100 阅读全文
posted @ 2016-03-22 21:03 球痞丶小七 阅读(143) 评论(0) 推荐(0)