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
hdu1312
hdu1312
/**/#include#include#include#include#include#include#include#include#include#include#include#includetypedeflonglongLL;usingnamespacestd;intn,m;chars[25][25];intsx,sy,ans;intdist[4][2]={0,1,0,-1,1,0,-1
oneplus54
·
2020-09-15 02:29
dfs
HDU1312
dfs
本来以为还要回溯.不需要只要一直搜索下去就行了#include#include#includeintmaps[101][101];intstatus[101][101];intx,y,total;intn,k;voiddfs(inti,inth){if(i>1&&!maps[i-1][h]&&!status[i-1][h]){status[i-1][h]=1;total+=1;dfs(i-1,h)
_夏日阳光
·
2020-09-15 02:06
acm
dfs水题_
hdu1312
,人间不值得
RedandBlackTimeLimit:2000/1000MS(Java/Others)MemoryLimit:65536/32768K(Java/Others)TotalSubmission(s):28227AcceptedSubmission(s):17064ProblemDescriptionThereisarectangularroom,coveredwithsquaretiles.Ea
屁话很多的美妆博主
·
2020-09-15 02:20
HDU1312
BFS-Numerically Speaking
DescriptionThereisarectangularroom,coveredwithsquaretiles.Eachtileiscoloredeitherredorblack.Amanisstandingonablacktile.Fromatile,hecanmovetooneoffouradjacenttiles.Buthecan’tmoveonredtiles,hecanmoveonl
geekword
·
2020-09-11 14:06
BFS
HDU1312
/ POJ1979 / ZOJ2165 Red and Black(红与黑) 解题报告
题目链接:
HDU1312
/POJ1979/ZOJ2165RedandBlack(红与黑)RedandBlackTimeLimit:2000/1000MS(Java/Others)MemoryLimit:
I_Array
·
2020-08-18 03:36
HDU
DFS
ACM-搜索之Red and Black——
hdu1312
RedandBlackProblemDescriptionThereisarectangularroom,coveredwithsquaretiles.Eachtileiscoloredeitherredorblack.Amanisstandingonablacktile.Fromatile,hecanmovetooneoffouradjacenttiles.Buthecan'tmoveonred
ltree98
·
2020-07-29 20:13
ACM-搜索
漫漫刷题路
hdu1312
题解
这道题从名称来看看不出什么。所以我们先读一下题干Thereisarectangularroom,coveredwithsquaretiles.Eachtileiscoloredeitherredorblack.Amanisstandingonablacktile.Fromatile,hecanmovetooneoffouradjacenttiles.Buthecan'tmoveonredtiles
jyichen
·
2020-02-06 11:00
HDU1312
Red and Black(dfs+连通性问题)
这有一间铺满方形瓷砖的长方形客房。每块瓷砖的颜色是红色或者黑色。一个人站在一块黑色瓷砖上,他可以从这块瓷砖移动到相邻(即,上下左右)的四块瓷砖中的一块。但是他只能移动到黑色瓷砖上,而不能移动到红色瓷砖上。编写一个程序,通过重复上述动作来计算他可以达到的黑色瓷砖的数量。Input输入包含多组数据。每组数据包含两个正整数W和H;H表示瓷砖的行数,W表示瓷砖的列数。W和H不超过20。瓷砖的颜色用字符表示
qdu_lkc
·
2020-01-28 20:00
HDU1312
Red and Black(黑红砖块)(dfs入门水题)
题目链接:点击打开链接题目大意:有一个长方形的房间,铺满了正方形瓷砖。每个瓷砖都是红色或黑色的。一个人站在一块黑色的瓷砖上。从一个瓷砖上,他可以移动到四个相邻(上下左右)的瓷砖中的一个。但是他不能移动到红色的瓷砖,只能在黑色的瓷砖上移动。通过重复上面描述的动作,编写一个程序来计算他能达到的黑瓷砖的数量。输入:多个数据。第一行给出两个数m,n(0,0代表结束输入);m代表列,n代表行。m,n均不超过
本该如此
·
2018-04-02 19:00
OJ刷题
图论
HDU1312
迷宫问题
问题描述:Thereisarectangularroom,coveredwithsquaretiles.Eachtileiscoloredeitherredorblack.Amanisstandingonablacktile.Fromatile,hecanmovetooneoffouradjacenttiles.Buthecan’tmoveonredtiles,hecanmoveonlyonbla
UncleJokerly
·
2016-12-22 13:00
ACM-HDU
路径问题系列之
HDU1312
Red and Black(DFS)
HDU1312RedandBlack题目TimeLimit:1000MSMemoryLimit:32768KBDescriptionThereisarectangularroom,coveredwithsquaretiles.Eachtileiscoloredeitherredorblack.Amanisstandingonablacktile.Fromatile,hecanmovetooneof
dtxm123
·
2016-07-26 14:58
acm
hdu1312
Red and Black(DFS深搜,入门题目)
1)注意刚开始是输入列数n,行数m#include #include usingnamespacestd; constintmaxx=23; intdir[4][2]={-1,0,1,0,0,1,0,-1};//上下左右 intstep; intm,n; charroom[maxx][maxx]; boolbj[maxx][maxx]; voidDFS(intx,inty) { bj[x][y]=
a272846945
·
2016-02-18 17:00
基础
HDU
DFS
HDU1312
Red and Black (DFS || BFS)
DescriptionThereisarectangularroom,coveredwithsquaretiles.Eachtileiscoloredeitherredorblack.Amanisstandingonablacktile.Fromatile,hecanmovetooneoffouradjacenttiles.Buthecan'tmoveonredtiles,hecanmoveonl
Hoaresky1998
·
2016-02-17 17:00
C++
算法
ACM
DFS
bfs
HDU1312
Red and Black [DFS问题]
一、这道题自己写起来还是挺吃力的,但是过后就觉得也就那样吧,总结一下自己犯的错误:1.用了八连通模板,这个题是四个方向,而我写的时候计算了八个方向;2.在搜索时,若为NXM矩阵,在判断坐标时候,因为要+1,所以x #include #defineF110 usingnamespacestd; intans; intdir[4][2]={{-1,0},{1,0},{0,-1},{0,1}};//*标
qq_33638791
·
2016-01-13 11:00
HDU1312
View Code 1 /* 2 dfs 从一个点出发最多能走多少步 3 用bfs较为麻烦 4 */ 5 #include<stdio.h> 6 #include<string.h> 7 #include<stdlib.h> 8 #include<algorithm> 9 #include<iostrea
·
2015-11-13 00:28
HDU
hdu1312
//简单搜索,只要走遍所有可达的路径BFS版:#include "iostream" #include "cstdio" #include "memory.h" #include "queue" using namespace std; const int MAX = 22; const int dx[] =
·
2015-10-31 09:14
HDU
HDU1312
:Red and Black(DFS)
题目描述 There is a rectangular room, covered with square tiles. Each tile is colored either red or black. A man is standing on a black tile. From a tile, he can move to one of four adjacent tiles. But
·
2015-10-21 13:44
HDU
hdu1312
RedandBlackTimeLimit:2000/1000MS(Java/Others) MemoryLimit:65536/32768K(Java/Others)TotalSubmission(s):13457 AcceptedSubmission(s):8334ProblemDescriptionThereisarectangularroom,coveredwithsquaret
qq_27599517
·
2015-08-13 19:00
搜索算法集锦 Ⅰ
搜索:带有方向性的枚举(自我理解)分类:广度优先搜索(BFS)和深度优先搜索(DFS)(含有回溯)[
hdu1312
:](http://acm.hdu.edu.cn/showproblem.php?
PNAN222
·
2015-08-05 17:00
搜索
hdu1312
(Red and Black)
点击打开杭电1312ProblemDescriptionThereisarectangularroom,coveredwithsquaretiles.Eachtileiscoloredeitherredorblack.Amanisstandingonablacktile.Fromatile,hecanmovetooneoffouradjacenttiles.Buthecan'tmoveonredt
u011479875
·
2015-08-03 20:00
java
HDU
深搜
1312
HDU1312
Red and Black DFS
题目大意:有一个矩形的地板涂有红,黑两种颜色,一次只能向上下左右移动一步且只能移动到相邻的黑色地板,问一共可以走多少块黑色地板。典型的搜索题,下面是深搜的代码:#include #include usingnamespacestd; intw,h; charmap[25][25]; intdfs(inti,intj) { if(ih||j=w)return0; if(map[i][
AC_Gibson
·
2014-12-29 17:00
HDU1312
Red and Black
RedandBlackTimeLimit:2000/1000MS(Java/Others) MemoryLimit:65536/32768K(Java/Others)TotalSubmission(s):9732 AcceptedSubmission(s):6060ProblemDescriptionThereisarectangularroom,coveredwithsquareti
u012846486
·
2014-08-13 18:00
hdu1312
HDU1312
#include#include#include#include#definemaxn 25usingnamespacestd;charmap[maxn][maxn];intmovex[4]={0,0,-1,1};intmovey[4]={1,-1,0,0};intw,h,ans,sx,sy;voiddfs(intx,inty){ //cout=1&&tx=1&&ty<=w&&map[tx][t
u013570474
·
2014-05-02 22:00
ACM-搜索之Red and Black——
hdu1312
RedandBlackProblemDescriptionThereisarectangularroom,coveredwithsquaretiles.Eachtileiscoloredeitherredorblack.Amanisstandingonablacktile.Fromatile,hecanmovetooneoffouradjacenttiles.Buthecan'tmoveonred
lx417147512
·
2014-04-02 21:00
搜索
ACM
red
and
black
hdu1312
CSUST2013:专题训练[下半学年]
ProblemA HDU1372 KnightMovesProblemB HDU1728 逃离迷宫ProblemC HDU2717 CatchThatCowProblemD
HDU1312
l383137093
·
2013-07-26 15:00
CSUST
HDU1312
Red and Black
RedandBlackTimeLimit:2000/1000MS(Java/Others) MemoryLimit:65536/32768K(Java/Others)TotalSubmission(s):6103 AcceptedSubmission(s):3887ProblemD
lsh670660992
·
2013-07-18 10:00
HDU1312
:Red and Black(DFS)
ProblemDescriptionThereisarectangularroom,coveredwithsquaretiles.Eachtileiscoloredeitherredorblack.Amanisstandingonablacktile.Fromatile,hecanmovetooneoffouradjacenttiles.Buthecan'tmoveonredtiles,hecan
libin56842
·
2013-05-27 21:00
ACM
HDU
DFS
解题报告
HDU1312
:Red and Black
点击打开题目链接RedandBlackTimeLimit:2000/1000MS(Java/Others) MemoryLimit:65536/32768K(Java/Others)TotalSubmission(s):5226 AcceptedSubmission(s):3403ProblemDescriptionThereisarectangularroom,coveredwith
l383137093
·
2013-04-20 21:00
搜索
DFS
hdu1312
赤裸BFS
RedandBlackTimeLimit:2000/1000MS(Java/Others) MemoryLimit:65536/32768K(Java/Others)TotalSubmission(s):3893 AcceptedSubmission(s):2505ProblemDescriptionThereisarectangularroom,coveredwithsquareti
hnust_xiehonghao
·
2012-07-20 21:00
c
input
character
each
output
Numbers
HDU1312
( Red and Black )
Problem:1312(RedandBlack)JudgeStatus:Accepted RunId:5535840Language:C++Author:ssun CodeRenderStatus:RenderedByHDOJC++CodeRenderVersion0.01Beta #include #include usingnamespacestd; intn,m; intcount;//
ssun125
·
2012-03-13 08:00
c
zoj 2165(
hdu1312
) Red and Black(深搜)
还是深搜,还是陈题。这次的发现是:1,代码的模块化的确是个好主意,这样的话,修改和读起来更方便了2,搜索时,如果不初始化map[][]的话,就要特别注意边界问题,因为有可能上一组测试实例的地图较大,所以在新图读入的时候,边界以外就不再是0了,不注意的话可能会影响最后的结果下面是代码:#includeintn,m,si,sj,count;intdir[4][2]={0,1,0,-1,1,0,-1,0
l04205613
·
2011-02-11 00:00
测试
ini
上一页
1
下一页
按字母分类:
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
其他