雕刻时光

just do it……nothing impossible
  博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

2011年7月21日

摘要: View Code #include<stdio.h>#include<math.h>#include<string.h>#define MAXN 109#define inf 1000000000#define _clr(x) memset(x,0xff,sizeof(int)*MAXN)int mat[109][109];int match1[MAXN];int match2[MAXN];struct data{ int fi,fj; }H[109];struct data1{ int fi,fj;}M[109];int KM(int m,int n,i 阅读全文

posted @ 2011-07-21 15:20 huhuuu 阅读(281) 评论(0) 推荐(0) 编辑

摘要: 一开始没看到You should notice that the roads of two different robots may contain some same point. WA了好几次它是说如果1-22-3那么1-3图的传递性可以用floyd快速求解View Code #include<stdio.h>#include<math.h>#include<string.h>int g,m;bool map[509][509];int mark[509];bool flag[509];bool dfs(int x){ int i; for(i=1;i& 阅读全文

posted @ 2011-07-21 10:10 huhuuu 阅读(534) 评论(0) 推荐(0) 编辑

摘要: 路径覆盖就是在图中找一些路经,使之覆盖了图中的所有顶点,且任何一个顶点有且只有一条路径与之关联最小路径覆盖就是找出最小的路径条数,使之成为P的一个路径覆盖.最小路径覆盖=顶点数-最大匹配数(貌似与最大独立集同)建图:集合A,B分别放顶点P,P'如果出租车在X点可以Y点,则map[x][y]=1;//因为是X->Y,而题意Y显然无法到X,所以单向图附上测试数据:1500:00 0 0 1 100:02 1 1 2 200:06 2 2 3 300:03 1 1 4 400:12 4 4 5 5输出2View Code #include<stdio.h>#include& 阅读全文

posted @ 2011-07-21 09:21 huhuuu 阅读(1207) 评论(0) 推荐(0) 编辑