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
oil
ZOJ 1709
Oil
Deposits
就是找有几部分的石油,按顺序每次找到‘@’后把与它同一部分的都标记为已找,直至把所有都遍历完,就可以确定有几部分了。#include #include #include #include usingnamespacestd; intdx[8]={0,1,1,1,0,-1,-1,-1},dy[8]={1,1,0,-1,-1,-1,0,1}; intvis[100][100]; intm,n; cha
yzj577
·
2014-07-31 15:00
C++
算法
ZOJ
bfs
UVA - 572
Oil
Deposits(DFS和BFS两种解法)
OilDeposits TheGeoSurvCompgeologicsurveycompanyisresponsiblefordetectingundergroundoildeposits.GeoSurvCompworkswithonelargerectangularregionoflandatatime,andcreatesagridthatdividesthelandintonumerous
HelloWorld10086
·
2014-07-28 15:00
uva
oil
Deposits
ZOJ 1709
Oil
Deposits
problemCode=1709
Oil
Deposits Time Limit: 2 Seconds Memory
hellojyj
·
2014-07-15 09:00
ZOJ 1709 BFS 油田
HDU 1241
Oil
Deposits
OilDepositsTimeLimit:2000/1000MS(Java/Others) MemoryLimit:65536/32768K(Java/Others)TotalSubmission(s):11221 AcceptedSubmission(s):6535ProblemDescriptionTheGeoSurvCompgeologicsurveycompanyisrespo
u013889450
·
2014-07-02 17:00
uva 572 -
Oil
Deposits
八个方向dfs,统计个数。 #include #defineMAX105 intmap[MAX][MAX]; intm,n; voiddfs(inti,intj){ if(im||j>n) return; if(map[i][j]==0) return; map[i][j]=0; dfs(i-1,j-1); dfs(i-1,j); dfs(i-1,j+1);
jdflyfly
·
2014-06-24 20:00
POJ1562
Oil
Deposits(图论入门)
#include #include #include usingnamespacestd; charmap[111][111]; intn,m; voiddfs(intx,inty) { map[x][y]='*'; if(x-1>=0&&map[x-1][y]=='@') dfs(x-1,y); if(x+1=0&&y-1>=0&&map[x-1][y-1]=='@') dfs(x-1,y-1)
rebelqsp
·
2014-05-19 19:00
hdu 1241
Oil
Deposits (连通块的个数)
思路:bfs代码:#include #include #include #include #include #include #include #include #include #include #include usingnamespacestd; #definemst(a,b)memset(a,b,sizeof(a)) #defineeps10e-10 #definePIacos(-1.
ljd4305
·
2014-05-17 22:00
UVa 572 -
Oil
Deposits
传送门UVa572-OilDeposits应该是最简单的图的题目吧,够水了,和书上图的例题差不多.不多说了.#include #include usingnamespacestd; charoil[110][110]; voidDFS(intx,inty); intmain() { //freopen("input.txt","r",stdin); introw,col; inti,j,cn
u014247806
·
2014-05-06 12:00
ACM
uva
Oil
Deposits (HDU 1241)
说实话,当我真正看懂这题后,感觉虽然有想法,但是却很难实现,我郁闷地看着电脑屏幕。。最可恨的是我同学已经写出来了,感觉很不爽额。。 然后我就不管那么多了,慢慢写吧,能写多少写多少,我就不信写不出来,哼。。接着写着写着,就发现似乎不难,思路很清晰了,最后,,哈哈,一次性AC了^-^ OilDepositsTimeLimit:2000/1000MS(Java/
jxust_tj
·
2014-04-28 16:00
搜索
图
hdu 1241
Oil
Deposits
#include #include intn,m; intnum[110][110]; voidDFS(intx,inty){ inta,b,i,j; num[x][y]=0; for(i=-1;in||b>m||!num[a][b]){ continue; } DFS(a,b); } } } intmain(){ charc; inti,j,s; while
u013365671
·
2014-04-24 21:00
DFS
UVa572
Oil
Deposits DFS求连通块
技巧:遍历8个方向 for(int dr = -1; dr <= 1; dr++) for(int dc = -1; dc <= 1; dc++) if(dr != 0 || dc != 0) dfs(r+dr, c+dc, id); 我的解法: #include<cstdio> #include<cstring&
·
2014-04-04 16:00
DFS
POJ 1562
Oil
Deposits (简单深搜)
链接:http://poj.org/problem?id=1562思路:遍历每一个油田,当遍历到某一个油田时,查找出与它相连接的油田,标记或者换成‘*’,一边统计个数就行了;代码如下:#include #include #include #include #defineMAXN105 #defineRST(N)memset(N,0,sizeof(N)) usingnamespacestd; ch
u012823258
·
2014-04-02 18:00
搜索
DFS
POJ 1562
Oil
Deposits(dfs)
题目链接:POJ1562OilDepositsdfs。很简单的dfs,对于每个符合要求的位置搜索其周围的八个方向。#include usingnamespacestd; constintMAX_N=100+10; char_map[MAX_N][MAX_N]; intn,m,cnt; void_search(inti,intj) { if(i=n||j=m) return; if(_map[
fobdddf
·
2014-03-30 22:00
ACM-DFS之
Oil
Deposits——hdu1241
OilDepositsProblemDescriptionTheGeoSurvCompgeologicsurveycompanyisresponsiblefordetectingundergroundoildeposits.GeoSurvCompworkswithonelargerectangularregionoflandatatime,andcreatesagridthatdividesthe
lx417147512
·
2014-02-25 12:00
ACM
DFS
oil
Deposits
hdu1241
HDU 1241
Oil
Deposits(dfs搜索)
ProblemDescriptionTheGeoSurvCompgeologicsurveycompanyisresponsiblefordetectingundergroundoildeposits.GeoSurvCompworkswithonelargerectangularregionoflandatatime,andcreatesagridthatdividesthelandintonum
u013013910
·
2014-02-17 14:00
编程
算法
搜索
C语言
572 -
Oil
Deposits
题目:572-OilDeposits题目大意:就是求大块油田的个数。大块的油田指的是(水平,垂直,或对角相邻的油田组成的)。#include #include constintN=105; intm,n; ints[N][N],visit[N][N]; voiddfs(intx,inty){ if(!s[x][y]||visit[x][y]) return; visit[x][y]=1; d
u012997373
·
2014-02-11 13:00
【UVaOJ】 572
Oil
Deposits
572-OilDepositsTimelimit:3.000secondsTheGeoSurvCompgeologicsurveycompanyisresponsiblefordetectingundergroundoildeposits.GeoSurvCompworkswithonelargerectangularregionoflandatatime,andcreatesagridthatdi
copica
·
2013-12-25 13:00
572
UvaOJ
oil
Deposits
期货品种代码
豆粕--M 豆油--Y 玉米--C LLDPE--L 棕榈油--P corn Palm
Oil
yangbinfx
·
2013-12-25 10:00
代码
Oil
Deposits (POJ No.1562) DFS
OilDepositsTimeLimit: 1000MS MemoryLimit: 10000KTotalSubmissions: 11423 Accepted: 6208DescriptionTheGeoSurvCompgeologicsurveycompanyisresponsiblefordetectingundergroundoildeposits.GeoSurvCompworkswith
q745401990
·
2013-12-22 11:00
C++
算法
poj
DFS
【九度】题目1460:
Oil
Deposit
题目地址:http://ac.jobdu.com/problem.php?pid=1460题目描述:TheGeoSurvCompgeologicsurveycompanyisresponsiblefordetectingundergroundoildeposits.GeoSurvCompworkswithonelargerectangularregionoflandatatime,andcreat
u013027996
·
2013-12-20 16:00
uva 572 -
Oil
Deposits
八个方向dfs,统计个数。 #include<stdio.h> #define MAX 105 int map[MAX][MAX]; int m, n; void dfs(int i, int j) { if (i < 0 || j < 0 || i > m || j > n) return; if (map[
249326109
·
2013-12-13 10:00
uva
HDU 1241
Oil
Deposits (DFS)
OilDepositsTimeLimit:2000/1000MS(Java/Others) MemoryLimit:65536/32768K(Java/Others)TotalSubmission(s):8754 AcceptedSubmission(s):5109ProblemDescriptionTheGeoSurvCompgeologicsurveycompanyisrespon
u012659423
·
2013-11-28 21:00
搜索
HDU
[ACM - 深度优先搜索]
Oil
Deposits
ProblemDescription TheGeoSurvCompgeologicsurveycompanyisresponsiblefordetectingundergroundoildeposits.GeoSurvCompworkswithonelargerectangularregionoflandatatime,andcreatesagridthatdividesthelandintonu
sr19930829
·
2013-11-27 09:00
ACM
DFS
深度优先搜索
每日英语:China Pipeline Explosions Kill 52
BEIJING—The death toll from a pair of
oil
pipeline explosions on Friday in the eastern China port city
·
2013-11-26 16:00
pipeline
POJ 1562
Oil
Deposits (HDU 1241 ZOJ 1562) DFS
现在,又可以和她没心没肺的开着玩笑,感觉真好。思念,是一种后知后觉的痛。她说,今后做好朋友吧,说这句话的时候都没感觉。。我想我该恨我自己,肆无忌惮的把她带进我的梦,当成了梦的主角。梦醒之后总是无边的疼痛,无比的失落。我果然还是不死心。我为什么非得离开你,在夜的利刃上劈伤自己?早上考完数逻,考试太水。好吧期中考。TT来水一发,准备去做数据结构作业,种树呀种树。。。两颗啊两颗。。。----------
murmured
·
2013-11-23 12:00
ACM
poj
DFS
hdu 1241
Oil
Deposits - bfs
先把所有点标记为0,所有的'.'标记为1。然后从(0,0)开始搜索,如果遇到标记为0的就把他加入队列,并把他标记为1,再看他周围8个点,如果有遇到标记为0的就把他加入队列并标记为1,重复此步骤,直到队列为空。当一个队列处理完后再从(0,0)开始搜索,重复以上步骤,直到搜索到右下角最后一个点。#include #include #include #include usingnamespacestd;
u011281853
·
2013-11-15 10:00
Burning Midnight
Oil
二分注意细节:n #include intmain() { intn,k,sum,i,mid=1,ans=1; scanf("%d%d",&n,&k); intlow=1; inthigh=n; intok=1; while(low0;i*=k)//不能写mid/i!=0,因为mid/i>0时一定能保证i在int范围内,但不能保证i*k不会溢出 sum+=mid/i; if(sum=n) { h
u011281853
·
2013-11-15 10:00
滤镜之油画
Oil
Painting
首先看效果图: 油画我的理解是色彩比较重,而且会有一片一片区域的同样色彩,没有什么细节,灰阶降低,只表现为一些特定的色彩。算法上的原理如下:1. 统计每个像素领域半径中出现的R,G,B的直方图,以及灰度的直方图,该直方图的bin的大小是设定好的,由此可以统计出落在某个bin上的数量2. 统计直方图中出现次数最多的R、G、B的均值,就是最要这个像素的结果。 从某个人的博客中借用了一个
chshplp_liaoping
·
2013-10-16 10:00
图像
滤镜
油画
zoj 1709
Oil
Deposits
题目点击打开链接#include #include usingnamespacestd; constintMAXN=105; charmap1[MAXN][MAXN]; intdir[8][2]={{-1,0},{-1,-1},{0,-1},{1,-1},{1,0},{1,1},{0,1},{-1,1}}; intm,n; voidDFS(intx,inty) { map1[x][y]='*'
Hearthougan
·
2013-10-06 10:00
DFS
hdu4185
Oil
Skimming (最大匹配)
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=4185题解:水平和竖直方向;有#相邻,连一条边,求最大匹配。#include #include #include #defineMAXN602 #defineMAXV1000 usingnamespacestd; vectormp[MAXN]; intfrom[MAXV],visited[MAXV];
lezong2011
·
2013-10-03 21:00
POJ:1562
Oil
Deposits
经典的DFS。八连块问题,UVa上做过原题。注意下有关字符串的输入问题,scanf(“%s”,s)不会读入换行。 #include #include #include #include #include usingnamespacestd; intN,M; chargrid[105][105]; boolvis[105][105]; voiddfs(inti,intj) { if(vis[i][j
kkkwjx
·
2013-09-19 21:00
DFS
水
HDU 1241
Oil
Deposits(简单搜索题)
OilDepositsTimeLimit:2000/1000MS(Java/Others) MemoryLimit:65536/32768K(Java/Others)TotalSubmission(s):8471 AcceptedSubmission(s):4949ProblemDescriptionTheGeoSurvCompgeologicsurveycompanyisrespon
opm777
·
2013-09-05 22:00
简单搜索
POJ 1562
Oil
Deposits
转载请注明出处:http://blog.csdn.net/a1dark大规模的图论切题之旅正式开始了、由于今天停了一天的电、所以晚上才开始切题、直到昨晚才把图论大概看了一遍、虽然网络流部分还是不怎么懂、但是也懂得了一些基础的算法、相信只要不断的刷题、必然可以可以搞懂、至于连通和匹配还是只是有那么一些概念、只会一些模板、等做题做多了自然就会懂了、努力切题中。。。分析:刚开始水一发、这题很简单、应该尽
verticallimit
·
2013-09-01 21:00
ACM
图论
DFS遍历
HDU-1241
Oil
Deposits (DFS)
OilDepositsTimeLimit:2000/1000ms(Java/Other) MemoryLimit:65536/32768K(Java/Other)TotalSubmission(s):15 AcceptedSubmission(s):14Font: TimesNewRoman | Verdana
·
2013-08-24 02:00
HDU
UVA 572
Oil
Deposits (简单BFS)
OilDepositsTheGeoSurvCompgeologicsurveycompanyisresponsiblefordetectingundergroundoildeposits.GeoSurvCompworkswithonelargerectangularregionoflandatatime,andcreatesagridthatdividesthelandintonumeroussq
u011217342
·
2013-08-04 01:00
uva 572
Oil
Deposits(DFS遍历图)
OilDeposits TheGeoSurvCompgeologicsurveycompanyisresponsiblefordetectingundergroundoildeposits.GeoSurvCompworkswithonelargerectangularregionoflandatatime,andcreatesagridthatdividesthelandintonumerouss
u011328934
·
2013-08-01 00:00
poj1562--
Oil
Deposits(DFS)
DescriptionTheGeoSurvCompgeologicsurveycompanyisresponsiblefordetectingundergroundoildeposits.GeoSurvCompworkswithonelargerectangularregionoflandatatime,andcreatesagridthatdividesthelandintonumeroussq
bingsanchun
·
2013-07-27 09:00
java
开发技术
WEB API:语音识别
淘宝语音搜索)x-webkit-speech方法支持webkit内核:http://www.wufangbo.com/x-webkit-speech/google语音搜索识别API:http://php.
oil
58
樂天
·
2013-07-20 20:00
HDU1241
Oil
Deposits
OilDepositsTimeLimit:2000/1000MS(Java/Others) MemoryLimit:65536/32768K(Java/Others)TotalSubmission(s):7709 AcceptedSubmission(s):451
lsh670660992
·
2013-07-18 10:00
HDU 1241
Oil
Deposits
题目连接:OilDeposits解题思路:求连通子图数量,每一次搜索一个子图,将其记录下来。#include #include #defineMAX110 intv[MAX][MAX],m,n,ans; intdir[8][2]={-1,-1,-1,0,-1,1,0,-1,0,1,1,-1,1,0,1,1}; charmap[MAX][MAX]; voidDFS(intx,in
u010787640
·
2013-07-17 19:00
深度优先搜索
poj 1562
Oil
Deposits
/*OilDeposits TimeLimit:1000MSMemoryLimit:10000K TotalSubmissions:10708Accepted:5802 Description TheGeoSurvCompgeologicsurveycompanyisresponsiblefordetectingundergroundoildeposits.GeoSurvCompwor
locusxt
·
2013-07-07 20:00
poj
cpp
UVaOJ572---
Oil
Deposits
这道题其实是一个图的遍历,就是看几次能把图遍历完全,刚开始我考虑到用深度优先遍历,而因为图是用邻接矩阵存储的要求当前遍历结点的下一个访问的结点有点麻烦,所以,结合题意“相邻”,所以只要以当前结点为圆心访问其一周,就可以知道是不是在同一个包里了,比深度优先方便了很多,可以实现题目的要求 失误1:没看清题目要求,数组定义过小; 失误2:遍历一周的节点的数组没写好一开始#include #inc
yf924092
·
2013-06-10 23:00
遍历
ACM
UVaOJ572---Oil
Depos
hdu 1241
Oil
Deposits
OilDepositsTimeLimit:2000/1000MS(Java/Others)MemoryLimit:65536/32768K(Java/Others)TotalSubmission(s):7359AcceptedSubmission(s):4301ProblemDescriptionTheGeoSurvCompgeologicsurveycompanyisresponsiblefor
y5885922
·
2013-06-08 16:00
c
算法
ACM
HDU/HDOJ 1241
Oil
Deposits (DFS)深度优先搜索
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1241题意:相当于求图中连通子图的个数,这里的连通按照题意要求为八邻域连通(上,下,左,右,四个对角)思路:深度优先,依次搜索图中每个点的八邻域,并注意标记访问,不然后果很严重.AC代码:46MS416K速度不慢,可能对于图中障碍比较多的缘故。#include #include #include #in
xiaozhuaixifu
·
2013-05-31 13:00
搜索
DFS
地图
连通分量
杭电1241 HDU acm --
Oil
Deposits---DFS深度优先算法实现详解
题目地址:http://acm.hdu.edu.cn/showproblem.php?pid=1241又是经典搜索题!还是那句话,数据量小,要求简单,果断DFS!这道题目跟以前的题目稍微有点不一样的是方向有点变化,由原来的四方向变成了八个方向,其实是一样的只不过是在遍历的时候多几个而已,直接给出代码#include #include usingnamespacestd; #defineN101 i
zhuihunmiling
·
2013-05-27 14:00
空格样例HDU1241:
Oil
Deposits
每日一贴,今天的内容关键字为空格样例 ProblemDescription TheGeoSurvCompgeologicsurveycompanyisresponsiblefordetectingundergroundoildeposits.GeoSurvCompworkswithonelargerectangularregionoflandatatime,andcreatesagri
·
2013-05-26 23:00
HDU
HDU1241:
Oil
Deposits(DFS)
ProblemDescriptionTheGeoSurvCompgeologicsurveycompanyisresponsiblefordetectingundergroundoildeposits.GeoSurvCompworkswithonelargerectangularregionoflandatatime,andcreatesagridthatdividesthelandintonum
libin56842
·
2013-05-25 22:00
ACM
HDU
DFS
解题报告
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
美国即将成为石油自主国家
; The International Energy Agency (IEA) describes a US 'supply shock' rippling through world
oil
oywl2008
·
2013-05-23 23:00
POJ 1562
Oil
Deposits
DescriptionTheGeoSurvCompgeologicsurveycompanyisresponsiblefordetectingundergroundoildeposits.GeoSurvCompworkswithonelargerectangularregionoflandatatime,andcreatesagridthatdividesthelandintonumeroussq
lphy2352286B
·
2013-04-23 14:00
上一页
6
7
8
9
10
11
12
13
下一页
按字母分类:
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
其他