E-COM-NET
首页
在线工具
Layui镜像站
SUI文档
联系我们
推荐频道
Java
PHP
C++
C
C#
Python
Ruby
go语言
Scala
Servlet
Vue
MySQL
NoSQL
Redis
CSS
Oracle
SQL Server
DB2
HBase
Http
HTML5
Spring
Ajax
Jquery
JavaScript
Json
XML
NodeJs
mybatis
Hibernate
算法
设计模式
shell
数据结构
大数据
JS
消息中间件
正则表达式
Tomcat
SQL
Nginx
Shiro
Maven
Linux
Deposits
hdu-1241 Oil
Deposits
(求子块个数)
OilDepositsTimeLimit:2000/1000MS(Java/Others)MemoryLimit:65536/32768K(Java/Others)TotalSubmission(s):3087AcceptedSubmission(s):1765ProblemDescriptionTheGeoSurvCompgeologicsurveycompanyisresponsiblefor
xcpooo
·
2023-04-16 23:18
hdu 1241 Oil
Deposits
搜索水题,等价于求一个图的连通分量的数目
OilDepositsTimeLimit:2000/1000MS(Java/Others)MemoryLimit:65536/32768K(Java/Others)TotalSubmission(s):28896AcceptedSubmission(s):16666ProblemDescriptionTheGeoSurvCompgeologicsurveycompanyisresponsiblef
Lionel_D
·
2020-09-12 05:40
图论
搜索
HDU 1241 Oil
Deposits
hdoj1241OilDepositsProblemDescriptionTheGeoSurvCompgeologicsurveycompanyisresponsiblefordetectingundergroundoildeposits.GeoSurvCompworkswithonelargerectangularregionoflandatatime,andcreatesagridthatdi
三寸雪
·
2020-09-11 18:12
bfs
&
dfs
L - Oil
Deposits
HDU - 1241 JAVA
importjava.util.ArrayList;importjava.util.LinkedList;importjava.util.Queue;importjava.util.Scanner;publicclassMain{publicstaticintdfs[][];publicstaticchararr[][];publicstaticinta,b;publicstaticintall=
OCHEAN
·
2020-09-11 13:06
dfs
bfs
UVA 572 - Oil
Deposits
(油田) By SuCicada
例题6-12油田(OilDeposits,UVa572)输入一个m行n列的字符矩阵,统计字符“@”组成多少个八连块。如果两个字符“@”所在的格子相邻(横、竖或者对角线方向),就说它们属于同一个八连块。例如,图6-9中有两个八连块。SampleInput11*35@@*@@@*18@@***@55****@@@@@**@@@@@@@**@00SampleOutput0122本家连接恩,嘛,遍历跑呗。
小米的蝉
·
2020-08-24 16:38
poj 1562 Oil
Deposits
//和2386是一模一样的题目,当我在这题用c语言的输入的时候,就出错了,应该是有多个空格或者回车键在//数据的后面,还是不是很懂c语言的输入,特需要注意!#include#includeusingnamespacestd;constintMAX=110;charmatrix[MAX][MAX];intn,m,vis[MAX][MAX],ans;//每一个点的八个方向坐标的增减!intdir[8]
yzl_rex
·
2020-08-20 13:30
POJ
HDU 1241 Oil
Deposits
深搜(DFS)
题意解析:给你一个地图,找出所有不相连(八个方向)的@组合有多少个?深度优先遍历图VS广度优先遍历图深度优先遍历图VS广度优先遍历图.gifimportjava.io.BufferedReader;importjava.io.BufferedWriter;importjava.io.InputStreamReader;importjava.io.OutputStreamWriter;importj
TinyDolphin
·
2020-08-20 10:51
kuangbin专题——Oil
Deposits
HDU - 1241
题目链接比较简单的,每次深搜把他周围的都标记了,深搜的次数输出就行#include#include#includeusingnamespacestd;intn,m,num;intvis[105][105];//是否能染色charmp[105][105];//记录地图intdt[8][2]={{0,-1},{0,1},{1,0},{-1,0},{1,-1},{1,1},{-1,-1},{-1,1}}
NGUP_LEE
·
2020-08-20 05:15
kuangbin专题
北京大学2013计算机所本科生保研夏令营考试——E:Oil
Deposits
原题链接:http://poj.grids.cn/jss2013/E/题目描述:总时间限制:1000ms内存限制:65536kB描述TheGeoSurvCompgeologicsurveycompanyisresponsiblefordetectingundergroundoildeposits.GeoSurvCompworkswithonelargerectangularregionofland
SmarterYu
·
2020-08-19 08:14
OJ
(改进)北京大学2013计算机所本科生保研夏令营考试——E:Oil
Deposits
上一篇给出的参考代码个人觉得太差,然后就重新改进写了一个,直接上代码了,具体描述什么的见上一篇博客:http://blog.csdn.net/smarteryu/article/details/11745355改进的参考代码:#includeusingnamespacestd;chargrids[102][102];intvisited[102][102];intnexti[8]={-1,-1,-
SmarterYu
·
2020-08-19 08:14
OJ
HDU1241-Oil
Deposits
OilDepositsTimeLimit:2000/1000MS(Java/Others)MemoryLimit:65536/32768K(Java/Others)TotalSubmission(s):25355AcceptedSubmission(s):14592ProblemDescriptionTheGeoSurvCompgeologicsurveycompanyisresponsiblef
Wang_128
·
2020-08-18 08:38
HDU
----dfs
hdu1241 Oil
Deposits
OilDepositsTimeLimit:2000/1000MS(Java/Others)MemoryLimit:65536/32768K(Java/Others)TotalSubmission(s):11512AcceptedSubmission(s):6699ProblemDescriptionTheGeoSurvCompgeologicsurveycompanyisresponsiblefo
my1995
·
2020-08-17 01:23
深度优先搜索
SDNU-DFS——B - Oil
Deposits
TheGeoSurvCompgeologicsurveycompanyisresponsiblefordetectingundergroundoildeposits.GeoSurvCompworkswithonelargerectangularregionoflandatatime,andcreatesagridthatdividesthelandintonumeroussquareplots.I
Df_cjc
·
2020-08-15 13:00
oj
Oil
Deposits
(八个方向搜索)
题目描述:TheGeoSurvCompgeologicsurveycompanyisresponsiblefordetectingundergroundoildeposits.GeoSurvCompworkswithonelargerectangularregionoflandatatime,andcreatesagridthatdividesthelandintonumeroussquarepl
我想改个名字
·
2020-08-14 08:16
深搜
杭电 1241 Oil
Deposits
#include#include#includeintn,m;inthash[105][105];charmap[105][105];intisok(inti,intj){if(i>=0&&i=0&&j
dengjing9914
·
2020-08-12 16:10
例题6-12-Oil
Deposits
-UVa 572
题目描述::**TheGeoSurvCompgeologicsurveycompanyisresponsiblefordetectingundergroundoildeposits.GeoSurvCompworkswithonelargerectangularregionoflandatatime,andcreatesagridthatdividesthelandintonumeroussquar
elorole
·
2020-08-11 01:09
紫书
DFS
UVa572——Oil
Deposits
TheGeoSurvCompgeologicsurveycompanyisresponsiblefordetectingundergroundoildeposits.GeoSurvCompworkswithonelargerectangularregionoflandatatime,andcreatesagridthatdividesthelandintonumeroussquareplots.I
westbrook1998
·
2020-08-11 00:17
ACM练习题
[C++]油田(Oil
Deposits
)-用DFS求连通块
[本博文非博主原创,均摘自:刘汝佳《算法竞赛入门经典》(第2版)6.4图][程序代码根据书中思路,非独立实现]例题6-12油田(OilDeposits,UVa572)输入一个m行n列的字符矩阵,统计字符“@”组成多少个八连块。如果两个字符“@”所在的格子相邻(横、纵或者对角线方向),就说它们属于一个八连块。例如,下图中有两个八连块。一、分析1.1整体思路图也有DFS和BFS遍历。由于DFS更容易编
weixin_30802171
·
2020-08-10 23:45
Oil
Deposits
ProblemDescriptionTheGeoSurvCompgeologicsurveycompanyisresponsiblefordetectingundergroundoildeposits.GeoSurvCompworkswithonelargerectangularregionoflandatatime,andcreatesagridthatdividesthelandintonum
tansanity
·
2020-08-10 21:37
例题6-12 油田(Oil
Deposits
, UVa 572)
欢迎访问我的Uva题解目录哦https://blog.csdn.net/richenyunqi/article/details/81149109题目描述题意解析输入一个m行n列的字符矩阵,统计字符“@”组成多少个八连块。如果两个字符“@”所在的格子相邻(横、竖或者对角线方向),就说它们属于同一个八连块。算法设计用DFS找连通块,从每个“@”格子出发,递归遍历它周围的“@”格子。开辟一个二维数组vi
日沉云起
·
2020-08-10 20:28
算法竞赛入门经典
-
Uva
[kuangbin带你飞]专题一 简单搜索- L - Oil
Deposits
#include#include#include#include#include#include#includeusingnamespacestd;#defineINF0x3f3f3fintgcd(inta,intb){returnb==0?a:gcd(b,a%b);}intn,m;chars[110][110];intmp[110][110];intvis[110][110];intxx[]={
Rrrrya
·
2020-08-10 20:13
kuangbin
问题 : Oil
Deposits
(油田) DFS经典例题 再此使用递归求解
题目描述由于最近下雨,水已集中在FarmerJohn田野的不同地方,由N×M(1intM,N;usingnamespacestd;voidfind(chara[100][100],intn,intm)//判断该处是否为一个油田{if(a[n][m]=='.'||nM-1||n>N-1)return;//如果该处已经被采集将其变为石头a[n][m]='.';//采集该处find(a,n-1,m-1)
JIDAIN
·
2020-08-10 20:25
dfs算法经典例题 Oil
Deposits
#include#includeintm,n,sum;charmap[102][102];intdir[8][2]={0,1,0,-1,1,0,-1,0,-1,-1,1,1,-1,1,1,-1};voiddfs(inti,intj){for(ints=0;s=m||dj>=n||map[di][dj]=='*')continue;map[di][dj]='*';dfs(di,dj);}}intma
Get *null
·
2020-08-10 19:41
搜索
Algorithm
水题
dfs
hdu 1241 Oil
Deposits
(最经典的dfs)
OilDepositsTimeLimit:1000MSMemoryLimit:32768KB64bitIOFormat:%I64d&%I64uSubmitStatusDescriptionTheGeoSurvCompgeologicsurveycompanyisresponsiblefordetectingundergroundoildeposits.GeoSurvCompworkswithone
qaz135135135
·
2020-08-10 18:47
BFS和DFS
HDOJ(HDU).1241 Oil
Deposits
(DFS)
HDOJ(HDU).1241OilDeposits(DFS)[从零开始DFS(5)]点我挑战题目从零开始DFSHDOJ.1342Lotto[从零开始DFS(0)]—DFS思想与框架/双重DFSHDOJ.1010TempteroftheBone[从零开始DFS(1)]—DFS四向搜索/奇偶剪枝HDOJ(HDU).1015Safecracker[从零开始DFS(2)]—DFS四向搜索变种HDOJ(HD
pengwill97
·
2020-08-10 18:51
算法---搜索
算法竞赛入门经典 例题 6-12 油田(Oil
Deposits
, UVa 572)
输入一个m行n列的字符矩阵,统计字符“@”组成多少个八连块。如果两个字符“@”所在的格子相邻(横、竖或者对角线方向),就说它们属于同一个八连块。SampleInput11*35*@*@***@***@*@*18@@****@*55****@*@@*@*@**@@@@*@@@**@00SampleOutput0122#include#include#includeusingnamespacestd;
杂家
·
2020-08-10 16:08
信息学竞赛
C&C++
例题6-12 UVA Oil
Deposits
油田
简单的DFS和那个上篇POJ一样的题目!#include#include#includeusingnamespacestd;constintmaxn=100+10;intN,M;charmep[maxn][maxn];voiddfs(intx,inty){mep[x][y]='*';for(intdx=-1;dx=0&&nx=0&&ny>N>>M&&N&&M){getchar();for(inti
aozil_yang
·
2020-08-10 15:41
第六章
数据结构基础(例题)
例题6-12 UVa572 Oil
Deposits
(DFS)
题意:就是看有几个可以搜索完的块,求连通块,有个专门的算法名:种子填充要点:标准深搜,有上下左右和斜对角的可以用二重循环来表示#include#include#includeboolidx[150][150];charmap[150][150];intm,n;voiddfs(intx,inty){if(!idx[x][y]||map[x][y]!='@')return;if(x=m||y=n)re
SeasonJoe
·
2020-08-10 14:55
搜索
算法竞赛入门经典
数据结构
HDU 1241 Oil
Deposits
(DFS)
OilDeposits原题链接:HDU1241ProblemDescriptionTheGeoSurvCompgeologicsurveycompanyisresponsiblefordetectingundergroundoildeposits.GeoSurvCompworkswithonelargerectangularregionoflandatatime,andcreatesagridth
PythonXQ
·
2020-08-10 14:48
算法
刷题
C - Oil
Deposits
C-OilDepositsTheGeoSurvCompgeologicsurveycompanyisresponsiblefordetectingundergroundoildeposits.GeoSurvCompworkswithonelargerectangularregionoflandatatime,andcreatesagridthatdividesthelandintonumerous
Free_BB
·
2020-08-10 13:04
dfs
搜索
例题6-12 UVA572 Oil
Deposits
基础dfs求连通块
题目连接:https://vjudge.net/problem/UVA-572思路:基础dfsCode:(紫书版本)#include#include#includeusingnamespacestd;constintAX=1e2+5;charmp[AX][AX];intid[AX][AX];intn,m;voiddfs(intr,intc,intidx){if(r=m||c=n)return;if
Dave_L
·
2020-08-10 13:33
图-DFS
算法竞赛入门经典-数据结构基础
深搜之入门例题 DFS Oil
Deposits
OilDepositsTimeLimit:2000/1000MS(Java/Others)MemoryLimit:65536/32768K(Java/Others)TotalSubmission(s):21383AcceptedSubmission(s):12319ProblemDescriptionTheGeoSurvCompgeologicsurveycompanyisresponsiblef
越努力越幸运i
·
2020-08-10 12:09
STL搜索
Oil
Deposits
ZOJ - 1709
https://zoj.pintia.cn/problem-sets/91827364500/problems/91827365208第一次用Python来A算法题习惯问题和用C写的大差不差的样子。。importnumpyasnpimportqueuedefbfs(e,book,n,m,x,y):next=[[0,-1],[-1,0],[0,1],[1,0],[-1,-1],[-1,1],[1,1
sunyutian1998
·
2020-08-03 04:57
搜索
Problem (D.SDUT 2018 Autumn Individual Contest - H)
ProblemD.滴答滴答---题目链接DepositsInputfile:
deposits
.inOutputfile:
deposits
.outTimelimit:3secondsMemorylimit
chen_zan_yu_
·
2020-08-01 11:06
VJ
杭电1241 HDU acm --Oil
Deposits
---DFS深度优先算法实现详解
题目地址:http://acm.hdu.edu.cn/showproblem.php?pid=1241又是经典搜索题!还是那句话,数据量小,要求简单,果断DFS!这道题目跟以前的题目稍微有点不一样的是方向有点变化,由原来的四方向变成了八个方向,其实是一样的只不过是在遍历的时候多几个而已,直接给出代码#include#includeusingnamespacestd;#defineN101intm,
百变魔君
·
2020-07-30 06:28
杭电解题
POJ - 1562 Oil
Deposits
(广搜)
题目链接:http://poj.org/problem?id=1562点击打开链接OilDepositsTimeLimit:1000MSMemoryLimit:10000KTotalSubmissions:18371Accepted:9727DescriptionTheGeoSurvCompgeologicsurveycompanyisresponsiblefordetectingundergro
xuejye
·
2020-07-30 05:36
搜索
杭电1241--Oil
Deposits
(Dfs)
OilDepositsTimeLimit:2000/1000MS(Java/Others)MemoryLimit:65536/32768K(Java/Others)TotalSubmission(s):17887AcceptedSubmission(s):10298ProblemDescriptionTheGeoSurvCompgeologicsurveycompanyisresponsiblef
weixin_34256074
·
2020-07-30 03:35
hdu 杭电 1241 Oil
Deposits
题意:找图中没有连在一起的'@'的个数。解法:广搜ac代码:ViewCode#include#includeusingnamespacestd;constintM=100+10;charmap[M][M];//地图booluse[M][M];//用作标记intvec[8][2]={-1,0,-1,-1,0,-1,1,-1,1,0,1,1,0,1,-1,1};//方向向量:左,左上,上,右上,右,右
francis_zhaogf
·
2020-07-30 01:54
acm
A - Oil
Deposits
A-OilDepositsTimeLimit:1000MSMemoryLimit:32768KB64bitIOFormat:%I64d&%I64uSubmitStatusDescriptionTheGeoSurvCompgeologicsurveycompanyisresponsiblefordetectingundergroundoildeposits.GeoSurvCompworkswitho
shi201619616
·
2020-07-30 00:32
dfs
HDU-1241 Oil
Deposits
搜索HDU-1241OilDeposits题目链接:杭电1241题目大意:寻找油田一个@是有油@周围8个方向的@视为同一个油田求给定的区域一共多少个油田解题思路:首先用BFS主函数循环找到@找到后将坐标传入BFS函数八个方向遍历有@就推入队列并把@变为*一个坐标的八个方向遍历完把队列首项推出直到队列为空这BFS函数执行一次就是一个油田统计函数执行次数并输出其次用DFS主函数循环找到@找到后将坐标传
「已注销」
·
2020-07-29 23:40
搜索
Oil
Deposits
( 简单搜索,连通性)
TheGeoSurvCompgeologicsurveycompanyisresponsiblefordetectingundergroundoildeposits.GeoSurvCompworkswithonelargerectangularregionoflandatatime,andcreatesagridthatdividesthelandintonumeroussquareplots.I
qq_36424540
·
2020-07-29 22:54
【ACM-搜索】
HDU 1241 Oil
Deposits
搜索
OilDepositsTimeLimit:2000/1000MS(Java/Others)MemoryLimit:65536/32768K(Java/Others)TotalSubmission(s):45465AcceptedSubmission(s):26205ProblemDescriptionTheGeoSurvCompgeologicsurveycompanyisresponsiblef
xcatf
·
2020-07-29 21:40
Oil
Deposits
TheGeoSurvCompgeologicsurveycompanyisresponsiblefordetectingundergroundoildeposits.GeoSurvCompworkswithonelargerectangularregionoflandatatime,andcreatesagridthatdividesthelandintonumeroussquareplots.I
mytzs123
·
2020-07-29 21:44
深搜DFS—广搜BFS
杭电1241 Oil
Deposits
(搜索题)
OilDepositsTimeLimit:2000/1000MS(Java/Others)MemoryLimit:65536/32768K(Java/Others)TotalSubmission(s):19973AcceptedSubmission(s):11475ProblemDescriptionTheGeoSurvCompgeologicsurveycompanyisresponsiblef
mengxiang000000
·
2020-07-29 21:54
搜索
杭电 1241 Oil
Deposits
OilDepositsTimeLimit:2000/1000ms(Java/Other)MemoryLimit:65536/32768K(Java/Other)TotalSubmission(s):4AcceptedSubmission(s):4ProblemDescriptionTheGeoSurvCompgeologicsurveycompanyisresponsiblefordetectin
小白菜小青菜
·
2020-07-29 20:29
ACM_数据结构
ACM_搜索
hdu1241——Oil
Deposits
(广搜的简单应用)
这道题,求的是油矿!关键是有相邻的话,要归并为一个油矿!对此,我们对每个点进行遍历,如果这个点还没进行过bfs,且它是一个油矿,那么,对其标记为已经bfs,并对其为起点bfs,遍历过的且为油矿的点,标记为已bfs。其中,设置一个计数,用来记录有多少个点进行过bfs,即为题目所求!#include#include#definemax105charg[max][max];intn,m,used[max
lazy_virus
·
2020-07-29 19:29
杭电ACM-1241 Oil
Deposits
#include#defineN150#defineM150usingnamespacestd;charoil[N][M];voiddfs(intx,inty){oil[x][y]='*';inti,j,n,m;for(i=-1;i=0&&n=0&&m>N1>>M1;if(N1==0)return0;for(inti=0;i>oil[i][j];for(intx1=0;x1
jiang__shuai
·
2020-07-29 19:04
杭电 hdu 1241 Oil
Deposits
/*THEPROGRAMISMADEBYPYY*//*----------------------------------------------------------------------------//Copyright(c)2011panyanyanyAllrightsreserved.URL:http://acm.hdu.edu.cn/showproblem.php?pid=1241N
iteye_910
·
2020-07-29 19:28
【杭电1241】Oil
Deposits
(DFS)
OilDepositsTimeLimit:1000MSMemoryLimit:32768KB64bitIOFormat:%I64d&%I64uSubmitStatusDescriptionTheGeoSurvCompgeologicsurveycompanyisresponsiblefordetectingundergroundoildeposits.GeoSurvCompworkswithone
idealistic
·
2020-07-29 19:37
杭电acm~bestcoder
DFS(深度搜索)
编程语言
HDU--杭电--1241--Oil
Deposits
--广搜
OilDepositsTimeLimit:2000/1000MS(Java/Others)MemoryLimit:65536/32768K(Java/Others)TotalSubmission(s):7955AcceptedSubmission(s):4678ProblemDescriptionTheGeoSurvCompgeologicsurveycompanyisresponsiblefor
LV耗子
·
2020-07-29 19:33
广搜
上一页
1
2
3
4
5
6
7
8
下一页
按字母分类:
A
B
C
D
E
F
G
H
I
J
K
L
M
N
O
P
Q
R
S
T
U
V
W
X
Y
Z
其他