2011年7月27日
摘要: 题目:http://poj.org/problem?id=2446本题和hdu1507类似,具体解释:http://www.cnblogs.com/lujiacheng/archive/2011/07/25/2116247.html代码:View Code 1 #include<stdio.h> 2 #include<string.h> 3 #define maxn 51 4 int dx[]={-1,1,0,0}; 5 int dy[]={0,0,-1,1}; 6 7 int n,m,k,ans; 8 int a[maxn][maxn],mark[maxn*maxn] 阅读全文
posted @ 2011-07-27 10:38 渲染独白 阅读(183) 评论(0) 推荐(0)
摘要: 题目:http://poj.org/problem?id=2594最小路径覆盖, 要求每个点只经过一次。此题说明一个点可以经过无数次。。那么.....刚开始看到。。。狂wa当数据为5 41 22 34 22 5时,求匹配时在用到4之前,2已经被匹配了,4这里就找不到匹配的了,4和5也就成孤立点了用最最小路径求的1-》2-》3后,2就被删除了,4和5就连不起来了,所以用floyd求某两点之间是否可达..然后用新图求最小路径覆盖.....代码:View Code 1 #include<stdio.h> 2 #include<string.h> 3 #define maxn 阅读全文
posted @ 2011-07-27 09:46 渲染独白 阅读(135) 评论(0) 推荐(0)