HDU 4185】的更多相关文章

Oil Skimming Time Limit:1000MS     Memory Limit:32768KB     64bit IO Format:%I64d & %I64u Submit Status Practice HDU 4185 Description Thanks to a certain "green" resources company, there is a new profitable industry of oil skimming. There ar…
http://acm.hdu.edu.cn/showproblem.php?pid=4185 两个挨着的'#'可以配成一对,求最多能配成几对 挨着的'#'就连边,然后求一次最大匹配,答案是最大匹配除以二(因为1 2和2 1这两对匹配实际效果是1,但是会算成2) #include <iostream> #include <cstdio> #include <cstring> using namespace std ; struct node{ int s,t,nxt ;…
链接: http://acm.hdu.edu.cn/showproblem.php?pid=4185 http://acm.hust.edu.cn/vjudge/contest/view.action?cid=82834#problem/G 与上题(H)相似 代码: #include <iostream> #include <cstdio> #include <cstring> #include <algorithm> using namespace std…
题意用1*2的木板覆盖矩阵中的‘#’,(木板要覆盖的只能是‘#’),问最多能用几个木板覆盖 将#抽象为二分图的点,一个木板就是一个匹配,注意最后结果要除以2 Sample Input 1 6 ...... .##... .##... ....#. ....## ...... Sample Output Case 1: 3   #include<cstdio> #include<iostream> #include<algorithm> #include<cstri…
题目大意:在一个N*N的矩阵里寻找最多有多少个“##”(横着竖着都行).     题目分析:重新构图,直接以相邻的两个油井算中间算以条边,然后进行匹配,看看两两之间最多能匹配多少对. #include<stdio.h> #include<string.h> #include<algorithm> #include<iostream> #include<vector> #include<queue> #include<cmath&…
题意:在大海里有一些石油 ‘#’表示石油, ‘.’表示水,有个人有一个工具可以回收这些石油,不过只能回收1*2大小的石油块,里面不能含有海水,要不就没办法使用了,求出来最多能回收多少块石油 分析:先把数据处理一下,给每一点石油都进行编号,然后查找一下四周联合是否能组成石油块,能的话就连接,因为一点有可能即在左边又在右边,所以最后的结果应该除去 2 ************************************************************************* #…
Problem Description Thanks to a certain "green" resources company, there is a new profitable industry of oil skimming. There are large slicks of crude oil floating in the Gulf of Mexico just waiting to be scooped up by enterprising oil barons. O…
<题目链接> 题目大意: 给你一张图,图中有 '*' , '.' 两点,现在每次覆盖相邻的两个 '#' ,问最多能够覆盖几次. 解题分析: 无向图二分匹配的模板题,每个'#'点与周围四个方向的'#'建立匹配关系,然后用匈牙利跑一遍,因为匹配的两点各会进行相互匹配一次,所以最大匹配数为ans/2. #include <cstdio> #include <cstring> #include <algorithm> using namespace std; +;…
Oil Skimming Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 3426    Accepted Submission(s): 1432 Problem Description Thanks to a certain "green" resources company, there is a new profitabl…
Oil Skimming Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 1487    Accepted Submission(s): 612 Problem Description Thanks to a certain "green" resources company, there is a new profitable…