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
pku2386 Lake Counting 数湖(简单深搜)
同 pku1562 Oil
Deposits
油田合并(简单深搜) 输入: 10 12 W........WW. .WWW.....WWW ....WW...WW. .......
·
2015-10-21 10:12
count
UVA 572 Oil
Deposits
UVA_572 这是个相对容易的搜索题目,只要依次遍历图,遇到没有访问过的“@”就开始广搜或者深搜,直到把8个方位相邻的“@”都搜完位置。 每进入一次搜索,总数就加1。 #include<stdio.h>#include<string.h>int a[110][110],vis[110][110],num;char b[110];int dx[]={-1,1,0
·
2015-10-21 10:35
uva
hdu 1241 Oil
Deposits
(dfs)
OilDepositsTimeLimit:2000/1000MS(Java/Others)MemoryLimit:65536/32768K(Java/Others)TotalSubmission(s):18935AcceptedSubmission(s):10902ProblemDescriptionTheGeoSurvCompgeologicsurveycompanyisresponsiblef
Grit_ICPC
·
2015-10-03 16:00
DFS
1241:Oil
Deposits
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1241方法:dfs思路:一看题觉得搜索倒是不难,难就难在怎样判断连通图。后查阅资料,发现了一种与dfs巧妙结合的神奇方法,真是拜服啊!首先还是按照一般原则对地图进行深搜,不同的是,我们的dfs函数不返回任何值,其作用就是对原图进行修改。修改的方法是,以一个点为基准,向他周围八个方向辐射,如果这些点中有油
freedom098
·
2015-09-30 19:00
UVA 572 Oil
Deposits
基础题目!dfs,搜索图!#include #include usingnamespacestd; chararr[105][105]; intm,n; intdir[8][2]={{1,0},{1,1},{0,1},{-1,1},{-1,0},{-1,-1},{0,-1},{1,-1}}; intdfs(intx,inty) { arr[x][y]='*'; for(intk=0;k>m>>n&
MrSiz
·
2015-09-29 22:00
图
DFS
uva
hdu1241 Oil
Deposits
从今天巩固一下搜索方面的题,从简单的做起吧http://acm.hdu.edu.cn/showproblem.php?pid=1241ProblemDescription TheGeoSurvCompgeologicsurveycompanyisresponsiblefordetectingundergroundoildeposits.GeoSurvCompworkswithonelargerec
aonaigayiximasi
·
2015-09-15 20:00
HDU1241 Oil
Deposits
题目地址:http://acm.hdu.edu.cn/showproblem.php?pid=1241/*HDU1241OilDepositshttp://acm.hdu.edu.cn/showproblem.php?pid=1241二维并查集坐标转换(ij)->(i*列数+j)*/ #include #include #include #include #include #include usi
qq_26437925
·
2015-09-04 09:00
POJ 1562 && HDU 1241 Oil
Deposits
(dfs)
Description给出一个N*M的矩形区域和每个区域的状态–@有/*没有石油,(定义)如果两个有石油的区域是相邻的(水平、垂直、斜)则认为这是属于同一个油田。求这块矩形区域一共有多少油田Input多组输入,每组输入包括两个整数n,m表示矩阵区域的列数和行数(1 #include #include usingnamespacestd; #definemaxn105 charmap[maxn][m
V5ZSQ
·
2015-08-25 10:00
hdu1241Oil
Deposits
搜索水题http://acm.hdu.edu.cn/showproblem.php?pid=1241八个方向如果有@则为同一油田,问共多少油田。#include #include #include usingnamespacestd; chars[105][105]; intm,n; intf[8][2]={-1,-1,-1,0,-1,1,0,-1,0,1,1,-1,1,0,1,1}; voidd
aonaigayiximasi
·
2015-08-18 12:00
DFS-HDU-1241-Oil
Deposits
OilDepositsTimeLimit:2000/1000MS(Java/Others)MemoryLimit:65536/32768K(Java/Others)TotalSubmission(s):18633AcceptedSubmission(s):10736ProblemDescriptionTheGeoSurvCompgeologicsurveycompanyisresponsiblef
Roy_Yuan
·
2015-08-17 19:00
c
DFS
Oil
Deposits
(dfs深搜)
ProblemDescriptionTheGeoSurvCompgeologicsurveycompanyisresponsiblefordetectingundergroundoildeposits.GeoSurvCompworkswithonelargerectangularregionoflandatatime,andcreatesagridthatdividesthelandintonum
Scarlett_geng
·
2015-08-13 02:00
HDU
DFS
HDU 1241 Oil
Deposits
DFS
HDU1241OilDepositsProblemDescriptionTheGeoSurvCompgeologicsurveycompanyisresponsiblefordetectingundergroundoildeposits.GeoSurvCompworkswithonelargerectangularregionoflandatatime,andcreatesagridthatdiv
qq_21120027
·
2015-08-10 19:00
DFS
杭电
hdu 1241 Oil
Deposits
深搜 Ac
1241hdu原链接处packagecn.hncu.start; importjava.util.Scanner; publicclassp1241{ staticintn,m; finalstaticintb[][]={//因为题目要求连起来的才算一个,所以必须要把上下左右等八个坐标表示出来 {0,-1}, {0,1}, {-1,0}, {1,0}, {-1,-1}, {-1,1}, {1,
yangxin_blog
·
2015-08-10 17:00
深搜
hdu1241 Oil
Deposits
裸的搜哦哦哦哦
rt题目#include #include usingnamespacestd; charch[105][105]; intn,m; intdir[8][2]={{1,0},{-1,0},{0,1},{0,-1},{1,1},{1,-1},{-1,1},{-1,-1}}; voiddfs(intx,inty) { ch[x][y]='*'; for(inti=0;in)continue; if(n
zhou_yujia
·
2015-08-10 09:00
搜索
hdu 1241 Oil
Deposits
(经典dfs)
题目:http://acm.hdu.edu.cn/showproblem.php?pid=1241大意:寻找一块区域中有多少的‘@’域,左右上下还有四个斜45度的相邻点都算作连起来的。SampleInput 11 * 35 *@*@* **@** *@*@* 18 @@****@* 55 ****@ *@@*@ *@**@ @@@*@ @@**@ 00 SampleOutput
theArcticOcean
·
2015-08-06 20:00
HDU
DFS
杭电 1241 Oil
Deposits
递归 DFS
OilDepositsTimeLimit:2000/1000MS(Java/Others) MemoryLimit:65536/32768K(Java/Others)TotalSubmission(s):18322 AcceptedSubmission(s):10568ProblemDescriptionTheGeoSurvCompgeologicsurveycompanyisresp
qq_24678203
·
2015-08-06 11:00
HDU 1241:Oil
Deposits
【递归】
OilDepositsTimeLimit:2000/1000MS(Java/Others) MemoryLimit:65536/32768K(Java/Others)TotalSubmission(s):18221 AcceptedSubmission(s):10503ProblemDescriptionTheGeoSurvCompgeologicsurveycompanyisresp
lin14543
·
2015-08-04 10:00
C++
递归
HDU
HDOJ 1241 Oil
Deposits
(dfs)
OilDepositsTimeLimit:2000/1000MS(Java/Others) MemoryLimit:65536/32768K(Java/Others)TotalSubmission(s):18204 AcceptedSubmission(s):10495ProblemDescriptionTheGeoSurvCompgeologicsurveycompanyisresp
zwj1452267376
·
2015-08-03 22:00
Oil
Deposits
OilDepositsTimeLimit:2000/1000ms(Java/Other) MemoryLimit:65536/32768K(Java/Other)TotalSubmission(s):55 AcceptedSubmission(s):38ProblemDescriptionTheGeoSurvCompgeologicsurveycompanyisresponsiblefor
yanghui07216
·
2015-08-03 21:00
Oil
Deposits
TimeLimit:2000/1000MS(Java/Others) MemoryLimit:65536/32768K(Java/Others)TotalSubmission(s):18183 AcceptedSubmission(s):10480ProblemDescriptionTheGeoSurvCompgeologicsurveycompanyisresponsibleford
l15738519366
·
2015-08-03 20:00
hdoj 1241 Oil
Deposits
【DFS】
OilDepositsTimeLimit:2000/1000MS(Java/Others) MemoryLimit:65536/32768K(Java/Others)TotalSubmission(s):18094 AcceptedSubmission(s):10431ProblemDescriptionTheGeoSurvCompgeologicsurveycompanyisresp
liu6886
·
2015-08-03 16:00
搜索
hdu1241(Oil
Deposits
)
点击打开hdu1241ProblemDescriptionTheGeoSurvCompgeologicsurveycompanyisresponsiblefordetectingundergroundoildeposits.GeoSurvCompworkswithonelargerectangularregionoflandatatime,andcreatesagridthatdividesthe
u011479875
·
2015-08-02 21:00
DFS深搜
hdu1241
暑假集训第三周周六赛 搜索 F - Oil
Deposits
油块
F- OilDepositsTimeLimit:1000MS MemoryLimit:32768KB 64bitIOFormat:%I64d&%I64uSubmit Status Practice HDU1241DescriptionTheGeoSurvCompgeologicsurveycompanyisresponsiblefordetectingundergroundoild
linyuxilu
·
2015-08-02 14:00
深搜
HDOJ 1241 Oil
Deposits
(8方位dfs)
OilDepositsTimeLimit:2000/1000MS(Java/Others) MemoryLimit:65536/32768K(Java/Others)TotalSubmission(s):17828 AcceptedSubmission(s):10250ProblemDescriptionTheGeoSurvCompgeologicsurveycompanyisresp
helloiamclh
·
2015-07-29 10:00
HDU 1241 Oil
Deposits
题目地址:点击打开链接思路:DFSAC代码:#include usingnamespacestd; intm,n; charlol[110][110]; intx[8]={-1,-1,-1,0,0,1,1,1}; inty[8]={-1,0,1,-1,1,-1,0,1}; voiddfs(inta,intb) { lol[a][b]='*'; inti,newx,newy; for(i=0;i=0
qq_25605637
·
2015-07-26 21:00
zoj 1562 Oil
Deposits
(DFS)
DescriptionTheGeoSurvCompgeologicsurveycompanyisresponsiblefordetectingundergroundoildeposits.GeoSurvCompworkswithonelargerectangularregionoflandatatime,andcreatesagridthatdividesthelandintonumeroussq
h1021456873
·
2015-07-24 19:00
HDU - 1241 - Oil
Deposits
题意:给你一个二维数组,输出有几块油田,由样例可知,八个方向只要相连,就算是一个油田,所有八个方向都要搜索到。#include #defineMAXN150 chars[MAXN][MAXN]; intmove[8][2]={{1,0},{-1,0},{0,1},{0,-1},{1,1},{-1,1},{1,-1},{-1,-1}}; intm,n,k,ans; voiddfs(intx,in
violet_echo_0908
·
2015-07-22 11:00
搜索
DFS
杭电
HDOJ 1241 Oil
Deposits
(8方位简单dfs)
OilDepositsTimeLimit:2000/1000MS(Java/Others) MemoryLimit:65536/32768K(Java/Others)TotalSubmission(s):17290 AcceptedSubmission(s):9961ProblemDescriptionTheGeoSurvCompgeologicsurveycompanyisrespo
helloiamclh
·
2015-07-22 10:00
UVA 572 Oil
Deposits
油田(DFS求连通块)
UVA 572 DFS(floodfill) 用DFS求连通块 Time Limit:1000MS Memory Limit:65536KB 64bit IO Format:%I64d & %I64u Desc
·
2015-07-22 08:00
DFS
poj1562 Oil
Deposits
(简单的深搜)
OilDepositsTimeLimit: 1000MS MemoryLimit: 10000KTotalSubmissions: 14391 Accepted: 7823DescriptionTheGeoSurvCompgeologicsurveycompanyisresponsiblefordetectingundergroundoildeposits.GeoSurvCompworkswith
su20145104009
·
2015-07-18 15:00
poj
oil
1562
poj1562
Deposits
Oil
Deposits
cid=82828#problem/L Oil
Deposits
Time Limit:1000MS Memory Limit:32768KB
·
2015-07-16 16:00
OS
L - Oil
Deposits
很清新的一道题,搜索里面最基础的题目,深搜广搜都可以.....不过还是喜欢深搜,写起来简单》。。 //////////////////////////////////////////////// #include<queue> #include<stdio.h> #include< string.h> using
·
2015-07-16 10:00
OS
UVa 572 - Oil
Deposits
【图DFS】
OilDepositsTheGeoSurvCompgeologicsurveycompanyisresponsiblefordetectingundergroundoildeposits.GeoSurvCompworkswithonelargerectangularregionoflandatatime,andcreatesagridthatdividesthelandintonumeroussq
a995549572
·
2015-06-16 20:00
ACM
图
uva
572
L_Oil
Deposits
(HDU_1241)
DescriptionTheGeoSurvCompgeologicsurveycompanyisresponsiblefordetectingundergroundoildeposits.GeoSurvCompworkswithonelargerectangularregionoflandatatime,andcreatesagridthatdividesthelandintonumeroussq
highmath_Final
·
2015-05-11 11:00
HDU1241 Oil
Deposits
DFS
OilDepositsTimeLimit:1000MS MemoryLimit:32768KB 64bitIOFormat:%I64d&%I64uSubmitStatusPracticeHDU1241DescriptionTheGeoSurvCompgeologicsurveycompanyisresponsiblefordetectingundergroundoildeposits.
wr132
·
2015-05-01 15:00
HDU
DFS
oil
Deposits
1241
文章标题 分类: dfs 2015-04-29 21:41 21人阅读 评论(0) 收藏
Description The GeoSurvComp geologic survey company is responsible for detecting underground oil
deposits
·
2015-04-29 21:00
DFS
uva 572 Oil
Deposits
种子填充/************************************************Author:xryzEmail:
[email protected]
:4-1320:55:27FileName:\Users\xryz\Desktop\OilDeposits.cpp**********************************************
xinag578
·
2015-04-13 21:00
hdu 1241Oil
Deposits
竞赛的时候一直吧题意错了。。。adjacent相邻的。。。妈的英语我最头痛啊啊啊~~~ 哎如果理解了题意就多对一个了 #include #include intn,m,num,visit[105][105],a[10000],q=0; charmap[105][105]; voiddfs(intx,inty) { if(x>=m||x=n||y<0||visit[x][y]||map[x][y]=
su20145104009
·
2015-04-10 19:00
poj
oil
poj1241
1241
Deposits
HDU-1241 Oil
Deposits
http://acm.hdu.edu.cn/showproblem.php?pid=1241 OilDepositsTimeLimit:2000/1000MS(Java/Others) MemoryLimit:65536/32768K(Java/Others)TotalSubmission(s):15444 AcceptedSubmission(s):8863P
·
2015-04-02 21:00
HDU
HDU 1241--Oil
Deposits
【DFS】
OilDepositsTimeLimit:2000/1000MS(Java/Others) MemoryLimit:65536/32768K(Java/Others)TotalSubmission(s):15293 AcceptedSubmission(s):8789ProblemDescriptionTheGeoSurvCompgeologicsurveycompanyisrespo
hpuhjh
·
2015-03-30 16:00
Oil
Deposits
OilDepositsTimeLimit:1000MS MemoryLimit:32768KB 64bitIOFormat:%I64d&%I64uSubmit Status Practice HDU1241DescriptionTheGeoSurvCompgeologicsurveycompanyisresponsiblefordetectingundergroundoildeposits.
Ash_Zheng
·
2015-03-30 14:00
HDU 1241 Oil
Deposits
ProblemDescriptionTheGeoSurvCompgeologicsurveycompanyisresponsiblefordetectingundergroundoildeposits.GeoSurvCompworkswithonelargerectangularregionoflandatatime,andcreatesagridthatdividesthelandintonum
lishuzhai
·
2015-03-15 19:00
搜索DFS
HDU1241 Oil
Deposits
DFS
题目大意:有一块油田,@表示改点为原油,*表示空地,每相邻的原油点(即上,下,左,右,斜边共8个方向相邻任意一方向相邻都可),他们的品种是一样的,现在问你该油田共有多少种不同的原油品种。分析:枚举每一个坐标点,如果该点为原油,计数器++,同时以该点为起点进行深搜,标记和该点相连的原油点为*。这样,枚举完每一个点之后,我们也就找到了不同的原油品种的数目了。裸DFS就行,下面是我的代码:#includ
AC_Gibson
·
2015-03-11 15:00
HDU-Oil
Deposits
-油田搜索
问题及代码:ProblemC OilDepositsTimeLimit:2000/1000ms(Java/Other) MemoryLimit:65536/32768K(Java/Other)TotalSubmission(s):6 AcceptedSubmission(s):3Font: TimesNewRoman | Verdana | GeorgiaFontSize: ← →Prob
MIKASA3
·
2015-02-27 22:00
C++
递归
oil
Deposits
油田(Oil
Deposits
)
OilDepositsTimeLimit:3000MS MemoryLimit:Unknown 64bitIOFormat:%lld&%lluSubmit StatusDescriptionTheGeoSurvCompgeologicsurveycompanyisresponsiblefordetectingundergroundoildeposits.GeoSurvCompworkswitho
qq_15096707
·
2015-02-24 22:00
java
图
uva
油田
oil
Deposits
HDU 1241 Oil
Deposits
ProblemDescriptionTheGeoSurvCompgeologicsurveycompanyisresponsiblefordetectingundergroundoildeposits.GeoSurvCompworkswithonelargerectangularregionoflandatatime,andcreatesagridthatdividesthelandintonum
jtjy568805874
·
2015-02-19 16:00
图论
HDU
DFS
uva572 - Oil
Deposits
入门经典II 第六章数据结构基础 例题6-12
题目:http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=7&page=show_problem&problem=513说明:用DFS求连通块,理解了之后挺简单的。#include #include #include usingnamespacestd; chars[110][110]; in
f1024042400
·
2015-01-18 18:00
hdu1241Oil
Deposits
(dfs)
题目:http://acm.hdu.edu.cn/showproblem.php?pid=1241 这一题已经是第二道搜索的问题了,可是感觉对于搜索的问题处理起来还是有点不舒服。这道题还是参考了《挑战程序设计竞赛》上的例题才明白了,所以对于搜索的问题还有待提高。(还要多刷几题啊) 这一题我们采用的是dfs,先寻找@,找到之后便将它变为*,然后从8个方向进行遍历。之后只需将dfs的次数记录下来
luomingjun12315
·
2015-01-05 14:00
poj 1562(
Deposits
)水题(八连通)
这才是我第一次接触深度优先遍历的典型例子,看到小媛学姐说这不是典型的dfs,说没有回溯,像是并查集,但我却认为这才是最典型的dfs,回溯是不属于dfs不知道我这种想法对不对,这道题目是八连通问题,只要一直进行深度搜索就行了,确实是个水题。#include #include #include chara[105][105]; intstep[8][2]={-1,-1,-1,0,-1,1,0,
sinat_22659021
·
2014-12-20 14:00
UVA - 572 - Oil
Deposits
(图的DFS!)
UVA-572OilDepositsTimeLimit: 3000MS MemoryLimit: Unknown 64bitIOFormat: %lld&%lluSubmit StatusDescription OilDeposits TheGeoSurvCompgeologicsurveycompanyisresponsiblefordetectingundergroundoildeposit
u014355480
·
2014-12-16 20:00
数据结构
图论
DFS
uva
traversal
上一页
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
其他