摘要:
http://acm.hdu.edu.cn/showproblem.php?pid=4185View Code 1 //4185 2 #include <cstdio> 3 #include <cstring> 4 using namespace std; 5 6 const int N=610; 7 char mz[N][N]; 8 const int dx[4]={0,1,0,-1}; 9 const int dy[4]={1,0,-1,0};10 int n;11 int mat[N][N],vis[N][N];12 int h(int x,int y)13 {1
阅读全文
posted @ 2012-04-17 16:21
Qiuqiqiu
阅读(291)
推荐(0)
编辑
摘要:
http://acm.hdu.edu.cn/showproblem.php?pid=1498最小点覆盖View Code 1 //1498 2 #include <cstdio> 3 #include <cstring> 4 using namespace std; 5 6 const int N=110; 7 int g[N][N],n; 8 int mat[N],vis[N]; 9 bool find(int u,int c)10 {11 for(int v=0;v<n;v++)12 if(g[u][v]==c && !vis[v])13 {1
阅读全文
posted @ 2012-04-17 13:20
Qiuqiqiu
阅读(161)
推荐(0)
编辑
摘要:
http://acm.hdu.edu.cn/showproblem.php?pid=1281View Code 1 //1281 2 #include <cstdio> 3 #include <cstring> 4 using namespace std; 5 6 const int N=110; 7 int g[N][N],n,m,u[N],v[N]; 8 int mat[N],vis[N]; 9 bool find(int u)10 {11 for(int v=1;v<=m;v++)12 if(g[u][v] && !vis[v])13 {14
阅读全文
posted @ 2012-04-17 12:28
Qiuqiqiu
阅读(154)
推荐(0)
编辑
摘要:
http://acm.hdu.edu.cn/showproblem.php?pid=1151DAG图的最小路径覆盖数=节点数-最大匹配数View Code 1 //1151 2 #include <cstdio> 3 #include <cstring> 4 using namespace std; 5 6 const int N=150; 7 int g[N][N],n; 8 int mat[N],vis[N]; 9 bool find(int u)10 {11 for(int v=1;v<=n;v++)12 if(g[u][v] && !vis
阅读全文
posted @ 2012-04-17 11:08
Qiuqiqiu
阅读(229)
推荐(0)
编辑
摘要:
http://acm.hdu.edu.cn/showproblem.php?pid=1150最小顶点覆盖View Code 1 #include <cstdio> 2 #include <cstring> 3 using namespace std; 4 5 const int N=150; 6 int g[N][N],n,m; 7 int mat[N],vis[N]; 8 bool match(int u) 9 {10 for(int v=1;v<m;v++)11 if(g[u][v] && !vis[v])12 {13 v...
阅读全文
posted @ 2012-04-17 10:06
Qiuqiqiu
阅读(147)
推荐(0)
编辑
摘要:
http://acm.hdu.edu.cn/showproblem.php?pid=1068View Code 1 #include <cstdio> 2 #include <cstring> 3 using namespace std; 4 5 const int N=1500; 6 int g[N][N],n; 7 int mat[N],vis[N]; 8 bool match(int u) 9 {10 for(int v=0;v<n;v++)11 if(g[u][v] && !vis[v])12 {13 vis[v]=1...
阅读全文
posted @ 2012-04-17 08:35
Qiuqiqiu
阅读(195)
推荐(0)
编辑