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
Oil
Deposits
之DFS解题报告
OilDepositsTimeLimit:2000/1000MS(Java/Others) MemoryLimit:65536/32768K(Java/Others)TotalSubmission(s):7288 AcceptedSubmission(s):4256ProblemDescriptionTheGeoSurvCompgeologicsurveycompanyisrespon
caizi1991
·
2013-05-24 15:00
POJ 1562 Oil
Deposits
DescriptionTheGeoSurvCompgeologicsurveycompanyisresponsiblefordetectingundergroundoildeposits.GeoSurvCompworkswithonelargerectangularregionoflandatatime,andcreatesagridthatdividesthelandintonumeroussq
lphy2352286B
·
2013-04-23 14:00
HDU1241:Oil
Deposits
点击打开题目链接OilDepositsTimeLimit:2000/1000MS(Java/Others) MemoryLimit:65536/32768K(Java/Others)TotalSubmission(s):7150 AcceptedSubmission(s):4152ProblemDescriptionTheGeoSurvCompgeologicsurveycompany
l383137093
·
2013-04-21 17:00
数据结构
搜索
并查集
13.04.07 Oil
Deposits
(DFS)
OilDepositsTimeLimit:2000/1000ms(Java/Other) MemoryLimit:65536/32768K(Java/Other)TotalSubmission(s):46 AcceptedSubmission(s):20Font: TimesNewRoman | Verdana | GeorgiaFontSize: ← →ProblemDescriptio
SIOFive
·
2013-04-08 21:00
算法
搜索
DFS
并查集练习之 POJ(709) Oil
Deposits
http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemId=709TheGeoSurvCompgeologicsurveycompanyisresponsiblefordetectingundergroundoildeposits.GeoSurvCompworkswithonelargerectangularregionoflandatat
gaotong2055
·
2013-03-28 17:00
并查集练习之 POJ(709) Oil
Deposits
problemId=709 The GeoSurvComp geologic survey company is responsible for detecting underground oil
deposits
从此醉
·
2013-03-28 17:00
poj
Fixed Deposit account / savings account / installment load
Fixed Deposit Account (定期存款账户): customer
deposits
a big sum of money for a fixed duration of time
四书五经
·
2013-03-14 15:00
Install
POJ-1562-Oil
Deposits
这个题就是说以@代表油田,它周边8个方向若有@则表示同一个油田。给你一个图,问你图中有多少个油田。算是比较简单的DFS题,直接进行搜索,只是注意对已经搜索过的点进行标记操作。代码:#include #include #include #defineMAX101 usingnamespacestd; intn,m,ans; charmap[MAX][MAX]; boolvis[MAX][MAX];
z309241990
·
2013-03-09 19:00
DFS
UVA 572 - Oil
Deposits
(DFS)
用DFS把相邻的@字符标记掉,并统计块的个数就好了。#include intm,n; charmap[105][105]; intdir[8][2]={-1,-1,-1,0,-1,1,0,-1,//定义8个方向数组 0,1,1,-1,1,0,1,1}; voiddfs(intx,inty){ map[x][y]='*'; for(inti=0;im)contin
zcube
·
2013-02-28 07:00
Hdu 1241 - Oil
Deposits
深搜惭愧啊,这题之前的代码连测试数据都过不了我居然也写上来了,要不是复习搜索,我也不会发现这个bug。我的博客都是凭良心写的,每一篇代码都能AC!要是你CE了,换一种语言试试看! 搜索的时候把搜过的点置换成其他符号,避免重复搜索。由于有上下左右和对角线上相邻的点,所以要搜索八个方向。 AC代码:#include #include #include #include charmap[105][1
Chuck_0430
·
2012-11-24 00:00
hdu 1241 Oil
Deposits
OilDepositsTimeLimit:2000/1000MS(Java/Others)MemoryLimit:65536/32768K(Java/Others)TotalSubmission(s):5865AcceptedSubmission(s):3423ProblemDescriptionTheGeoSurvCompgeologicsurveycompanyisresponsiblefor
axcuian
·
2012-10-19 14:38
java
plot
each
input
character
output
DFS
java
poj 1562 Oil
Deposits
(dfs)
OilDepositsTimeLimit: 1000MS MemoryLimit: 10000KTotalSubmissions: 9732 Accepted: 5335DescriptionTheGeoSurvCompgeologicsurveycompanyisresponsiblefordete
xiuyang_leiasp
·
2012-10-16 15:00
Hdu 1241 Oil
Deposits
OilDepositsTimeLimit:2000/1000MS(Java/Others) MemoryLimit:65536/32768K(Java/Others)TotalSubmission(s):5839 AcceptedSubmission(s):3407ProblemDescriptionTheGeoSurvCompgeologicsurveycompanyisrespon
Magic____
·
2012-10-03 20:00
Oil
Deposits
(DFS,基础题)
OilDepositsTimeLimit:2000/1000MS(Java/Others) MemoryLimit:65536/32768K(Java/Others)TotalSubmission(s):5776 AcceptedSubmission(s):3360原题链接:点击打开链接ProblemDescriptionTheGeoSurvCompgeologicsurveycomp
cs_zlg
·
2012-09-02 20:00
struct
input
character
each
output
plot
poj 1562 Oil
Deposits
//和2386是一模一样的题目,当我在这题用c语言的输入的时候,就出错了,应该是有多个空格或者回车键在 //数据的后面,还是不是很懂c语言的输入,特需要注意! #include #include usingnamespacestd; constintMAX=110; charmatrix[MAX][MAX]; intn,m,vis[MAX][MAX],ans; //每一个点的八个方向坐标的增减!
yzl_rex
·
2012-09-02 08:00
HDU 1241 Oil
Deposits
DFS
题意:N*M的图中有一些'@',从该位置往四周8个位置延伸,求几块互不连通的‘@’构成的块。简单的DFS便能搞定 import java.util.Scanner; public class Main{ static int m,n; static char[][] arr=new char[101][101]; public static void main(S
believexkx
·
2012-08-17 22:00
java
图论
DFS
Uva 572 Oil
Deposits
题目:http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&problem=513 比较简单的一道题目,主要用dfs搜索。可能比较难想的是在每次搜完之后怎么去寻找下一个起点,方法是做好标记,从头到尾每个点都搜一遍就可以了。 #include<io
Jianquan
·
2012-08-11 11:00
uva
572
Oil Deposits
UVa 572 - Oil
Deposits
图题里最简单的一个吧,DFS~代码如下:#include #include #include #include #include #include usingnamespacestd; chara[100+2][100+2]; intflag[100+2][100+2]; voidDFS(intx,inty) { if(!(a[x][y]-'*')||flag[x][y]) return; fla
GooMaple
·
2012-07-31 09:00
c
uva 572 - Oil
Deposits
OilDeposits TheGeoSurvCompgeologicsurveycompanyisresponsiblefordetectingundergroundoildeposits.GeoSurvCompworkswithonelargerectangularregionoflandatatime,andcreatesagridthatdividesthelandintonumerous
Frankiller
·
2012-07-21 17:00
ini
input
character
each
output
plot
HDU-1244-Oil
Deposits
HDU-1244-OilDepositshttp://acm.hdu.edu.cn/showproblem.php?pid=1241基本的DFS#include #include #include charmap[105][105]; intn,m; intdir[8][2]={{-1,-1},{-1,0},{-1,1},{0,-1},{0,1},{1,-1},{1,0},{1,1}}; intg
Cambridgeacm
·
2012-07-12 18:00
ini
Go
uva 572 - Oil
Deposits
点击打开链接题目意思:给你一块区域里面分布着油田,只要有连着就属于同一个油田,求出该区域有几个油田解题思路:简单的Bfs或dfs可以搞定,注意对走过的进行标记用mark数组。代码://DFS代码(用到递归) #include #include #include #include usingnamespacestd; constintMAXN=110; intn,m,sum; charch[MAX
cgl1079743846
·
2012-07-07 01:00
UVa 572 - Oil
Deposits
搜索专题
572-Oil
Deposits
11158 58.77% 5511 95.30% 题目链接: http://uva.onlinejudge.org
king_tt
·
2012-07-06 00:00
uva
UVa 572 - Oil
Deposits
搜索专题
572 - OilDeposits1115858.77%551195.30%题目链接:http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=105&page=show_problem&problem=513题目类型:搜索样例输入:11 * 35 *@*@* **@** *@*@* 18 @@***
shuangde800
·
2012-07-06 00:00
c
struct
IM
UVaOJ 572 - Oil
Deposits
——byACodeRabbitDescription输入一张金矿的截面图,求有几个金快。要注意“horizontally”、“vertically”、“diagonally”这三个单词,说明几个金子只要竖直、水平斜角有相连就算同一块金块。TypesDateStructure::GraphsAnalysis简单经典的图论问题,求无向图的连通分支数,即图的强连通分支数。有定理:在强连通分支算法中,选择
Ra_WinDing
·
2012-07-06 00:00
Oil
Deposits
(广搜)
#include #include #include #include #include #include #include #definemaxn105 intdx[8]={-1,-1,-1,0,0,1,1,1}; intdy[8]={-1,0,1,-1,1,-1,0,1}; usingnamespacestd; charmap[maxn][maxn]; boolvisi
bigman_123
·
2012-05-08 21:00
Algorithm
include
iostream
HDU 1241Oil
Deposits
000http://acm.hdu.edu.cn/showproblem.php?pid=1241 #include#include#include#defineMAX120charmap[MAX][MAX];intoil,m,n;intdis[8][2]={-1,-1,-1,0,-1,1,0,-1,0,1,1,-1,1,0,1,1};voidClear(){ memset(map,0,
cddchina
·
2012-03-18 19:00
572 - Oil
Deposits
/* 简单连通图问题,采用深度优先搜索即可 题意:油矿之间存在联系(行,列,或对角线相连),则属于一块。 输出图中共存在多少油矿 */ #include #include intm,n; charG[105][105]; intcount; voiddfs(intr,intc) { if(G[r][c]=='@') { G[r][c]='*'; //这里使用有技巧,排版整齐,容易查错! dfs
lhshaoren
·
2012-02-06 22:00
c
poj 1562 || zoj 1709 Oil
Deposits
(DFS)
题意:油田问题:相邻的可以合为一块田,这里相邻是指边上的8个方向…求最少油田数量。分析:本题实际上是做一个搜索矩阵的连通子集。简单的dfs就可以解决,还不用剪枝。^_^一开始我回溯考虑太多了,其实只需在dfs函数里放个: if(a[x][y]=='*')return;就行的,然后又有个问题:什么时候计数增1.找我那么做,要疯了的。现在只需在一开始从起点开始计算count++,搞定。还有一个学习的
cqlf__
·
2011-11-17 16:00
ZOJ1709 POJ1562 Oil
Deposits
,并查集
这题一般都会用DFS来做的,但是我这里使用并查集来做,感觉效果也不错,以下是代码。/******************************************************************************* *Author:NeoFung *Email:
[email protected]
*Lastmodified:2011-08-2618:56 *Filen
neofung
·
2011-08-26 18:00
zoj 1709 Oil
Deposits
千淘万漉虽辛苦,吹尽狂沙始AC啊,这道题经过慎重的分析之后,思路应该是相当清晰,可写代码时没有注意把定义过的全局变量在主函数中又定义了一次,结果输出总是有误,把主函数中的定义删去,立竿见影,一下AC,我也很是迷茫啊,谁能帮忙解释一下的话万分感激;这也算是我才开始写的DFS,回顾一下我的原理:在标志数组中把相连的油井赋值为1;进行几次DFS赋值就有几块油井,感觉还行吧#include #includ
Slience_Perseverance
·
2011-08-22 21:00
zoj 1709 Oil
Deposits
千淘万漉虽辛苦,吹尽狂沙始AC啊,这道题经过慎重的分析之后,思路应该是相当清晰,可写代码时没有注意把定义过的全局变量在主函数中又定义了一次,结果输出总是有误,把主函数中的定义删去,立竿见影,一下AC,我也很是迷茫啊,谁能帮忙解释一下的话万分感激;这也算是我才开始写的DFS,回顾一下我的原理:在标志数组中把相连的油井赋值为1;进行几次DFS赋值就有几块油井,感觉还行吧#include #includ
wangxiaohigh
·
2011-08-22 21:00
ZOJ
poj 1562Oil
Deposits
( BFS DFS)
水啊,水啊……OilDepositsTimeLimit: 1000MS MemoryLimit: 10000KTotalSubmissions: 7657 Accepted: 4300DescriptionTheGeoSurvCompgeologicsurveycompanyisresponsiblefordetectingundergroundo
tanhaiyuan
·
2011-08-20 23:00
杭电 hdu 1241 Oil
Deposits
/* THE PROGRAM IS MADE BY PYY */ /*----------------------------------------------------------------------------// Copyright (c) 2011 panyanyany All rights reserved. URL : http://acm.hdu.edu.c
panyanyany
·
2011-08-14 15:00
搜索
ACM
DFS
杭电
杭电 hdu 1241 Oil
Deposits
/* THE PROGRAM IS MADE BY PYY */ /*----------------------------------------------------------------------------// Copyright (c) 2011 panyanyany All rights reserved. URL : http://acm.hdu.edu.cn/show
txf2004
·
2011-08-14 15:00
杭电 hdu
杭电 hdu 1241 Oil
Deposits
/*THEPROGRAMISMADEBYPYY*/ /*----------------------------------------------------------------------------// Copyright(c)2011panyanyanyAllrightsreserved. URL:http://acm.hdu.edu.cn/showproblem.php?pid=1
panyanyany
·
2011-08-14 15:00
c
测试
hdu 1241 Oil
Deposits
(最经典的dfs)
Oil
Deposits
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536
gzhu_101majia
·
2011-07-31 11:00
数据结构
C++
c
算法
ACM
经济金融英语术语汉英对照表
prioritize 暗补 implicit subsidy 暗亏 hidden loss B 颁发营业执照 to license;to grant a licence to 办理存款业务 to take
deposits
guoapeng
·
2011-03-21 16:00
生物
金融
velocity
performance
Exchange
hdu1241 Oil
Deposits
广搜题,题意为找到图中油田有多少块(相邻油田算入一块)。。。多次广搜,如果碰到'@'则置当前'@'为'*'同时counter++,然后从此点开始一次广搜,期间遇到'@'则立刻置为'*',重复进行直到图中所有点全部遍历完毕。。。。整体算法不难。。。写此解题报告纪念一下没有情人的情人节。。。^_^
zhang360896270
·
2011-02-14 17:00
POJ 1562 DFS水题练习
Oil
Deposits
Time Limit: 1000MS Memory Limit: 10000K Total Submissions: 6282 Accepted
thecloud
·
2010-11-19 08:00
poj
POJ 1562 DFS水题练习
Oil
Deposits
Time Limit: 1000MS Memory Limit: 10000K Total Submissions: 6282 Accepted
soboer
·
2010-11-19 08:00
poj
joj1349 Oil
Deposits
1349:OilDepositsResultTIMELimitMEMORYLimitRunTimesACTimesJUDGE3s8192K533260StandardTheGeoSurvCompgeologicsurveycompanyisresponsiblefordetectingundergroundoildeposits.GeoSurvCompworkswithonelargerectan
tonghu2010
·
2010-11-18 12:00
File
input
character
each
output
plot
zoj 1709 || poj 1562 Oil
Deposits
(DFS 好吧,目前我就是专门找水题做的。。。)
觉得有点像并查集啦。 以前的DFS水题都是搜的四个方向,现在搜八个了。。。FT。。 感觉这个不是太像DFS。。。没有回溯塞。。。觉得就是递归。。。额。。 @的八个方向有@的并一起,输出有多少个。。额。。多少棵这样的树吧,恩,可以这么说。 #include#include#include#includeusingnamespacestd;intmap[110][110];intvisit[110][
zxy_snow
·
2010-10-17 21:00
PKU 1562 Oil
Deposits
PKU1562OilDeposits问题:http://acm.pku.edu.cn/JudgeOnline/problem?id=1562思路:简单的深度优先搜索,类似求连通域 1 void 2 dfs(int x, int y) 3 { 4 int i, sx, sy; 5 visited[x][y] = 1; 6 for(i=0; i<8; i++) { 7
A Za, A Za, Fighting...
·
2010-07-04 11:00
1241 Oil
Deposits
1241OilDeposits找出油田的数量简单的dfs搜索遍历入门题http://acm.hdu.edu.cn/showproblem.php?pid=1241#include #include #define N 110int map[N][N];int n,m,ans;int visted[N][N];void dfs( int x,int y){ if(map[x][y]==0 ||
付翔的专栏
·
2010-05-18 13:00
DFS__1349: Oil
Deposits
由于是算油井数量,当是连接在一起的时候,8个方向搜索,如果是油井就把它改成'*',这样就没后顾之忧了.另外搜索也不需要一个数组用来保存是不是被搜索过这个问题!StatusIn/OutTIMELimitMEMORYLimitSubmitTimesSolvedUsersJUDGETYPEstdin/stdout3s8192K356201StandardTheGeoSurvCompgeologicsur
hqd_acm
·
2010-03-05 09:00
UVa 572 Oil
Deposits
UVa572OilDeposits图的连通性问题,我用的是dfs,如果bfs的话需要建队列,比较麻烦,也没有必要。以下是我的代码:#include#includeconst long maxn=108;long m,n,ans,xd[]={-1,-1,0,1,1,1,0,-1},yd[]={0,1,1,1,0,-1,-1,-1};char a[maxn][maxn];bool used[maxn]
心如止水
·
2010-01-07 13:00
joj 1349 Oil
Deposits
: a waste of time in debug 深搜 调试了一小时只因为把=写成了==!
joj1349OilDeposits:awasteoftimeindebug深搜调试了一小时只因为把=写成了==! #include#includeusing namespace std;int MATRIX[100][100];int fx[8]={0,0,1,-1,1,1,-1,-1},fy[8]={1,-1,0,0,-1,1,-1,1};int row,col; int ISALL()
I believe
·
2009-05-14 21:00
hdu 1241 Oil
Deposits
#include#includeusing namespace std;int sum,m,n;bool used[102][102];char maps[102][102];int a[8][2] = {{0,1},{0,-1},{1,0},{-1,0},{1,1},{1,-1},{-1,1},{-1,-1}};void Dfs(int i,int j){ int k; int s,
Feng
·
2009-04-23 13:00
ZOJ 1709 - Oil
Deposits
1 /* Accepted 1709 C++ 00:00.02 848K */ 2 #include 3 4 using namespace std; 5 6 int n, m; 7 char map[100][100]; 8 9 void floodfill(int x, int y)10 {11 map[x][y] = '*';12 for(int i = x - 1
superman
·
2008-05-03 21:00
ACM PKU 1562 Oil
Deposits
深度优先搜索
ACMPKU1562OilDeposits深度优先搜索Source CodeProblem: 1562 User: lnmm Memory: 96K Time: 0MS Language: C++ Result: Accepted Source Code #include "stdio.h"#include "iostream.h"bool visited[101][101];char ma
AClayton's ACM/ICPC Life 只切菜题 菜鸟乱飞
·
2007-11-06 16:00
上一页
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
其他