HDU-1241Oil Deposits】的更多相关文章

题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1241 Oil Deposits Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 13137    Accepted Submission(s): 7611 Problem Description The GeoSurvComp geologi…
Problem Description The GeoSurvComp geologic survey company is responsible for detecting underground oil deposits. GeoSurvComp works with one large rectangular region of land at a time, and creates a grid that divides the land into numerous square pl…
题目链接—— http://acm.hdu.edu.cn/showproblem.php?pid=1241 首先给出一个n*m的字符矩阵,‘*’表示空地,‘@’表示油井.问在这个矩阵中有多少组油井区? 每个点周围的8个点都可以与之相连. 从左上角的点开始向后枚举然后dfs搜索就可以了.记得记忆化. 废话说完,上代码—— #include <cstdio> #include <cmath> #include <cstring> #include <algorithm…
http://poj.org/problem?id=2386 http://acm.hdu.edu.cn/showproblem.php?pid=1241 求有多少个连通子图.复杂度都是O(n*m). #include <cstdio> ][]; int n,m; void dfs(int x,int y) { ;i<=;i++) ;j<=;j++) //循环遍历8个方向 { int xx=x+i,yy=y+j; &&xx<n&&yy>=…
因为这道题中给的数据比较小,所以可以直接用枚举的方式进行dfs搜索,每出现一个‘@’,就进行一次dfs的搜索,将所有相邻的‘@’全部变成‘*’. #include"iostream" #include"stdio.h" #include"algorithm" #include"string.h" #include"cmath" #include"queue" #define mx 105…
HDU 1241 题目大意:给定一块油田,求其连通块的数目.上下左右斜对角相邻的@属于同一个连通块. 解题思路:对每一个@进行dfs遍历并标记访问状态,一次dfs可以访问一个连通块,最后统计数量. /* HDU 1241 Oil Deposits --- 入门DFS */ #include <cstdio> int m, n; //n行m列 ][]; /* 将和i,j同处于一个连通块的字符标记出来 */ void dfs(int i, int j){ || j < || i >=…
HDU 1241  Oil Deposits L -DFS Time Limit:1000MS     Memory Limit:10000KB     64bit IO Format:%I64d & %I64u   Description The GeoSurvComp geologic survey company is responsible for detecting underground oil deposits. GeoSurvComp works with one large r…
HDU 1241 Oil Deposits(石油储藏) 00 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)   Problem Description - 题目描述 The GeoSurvComp geologic survey company is responsible for detecting underground oil deposits. GeoSurvComp works with one large…
链接: http://acm.hdu.edu.cn/showproblem.php?pid=1241 Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 18758    Accepted Submission(s): 10806 Problem Description The GeoSurvComp geologic survey comp…
HDOJ(HDU).1241 Oil Deposits(DFS) [从零开始DFS(5)] 点我挑战题目 从零开始DFS HDOJ.1342 Lotto [从零开始DFS(0)] - DFS思想与框架/双重DFS HDOJ.1010 Tempter of the Bone [从零开始DFS(1)] -DFS四向搜索/奇偶剪枝 HDOJ(HDU).1015 Safecracker [从零开始DFS(2)] -DFS四向搜索变种 HDOJ(HDU).1016 Prime Ring Problem (…