当前位置: 首页 > news >正文

罗湖做网站多少钱商丘做网站张

罗湖做网站多少钱,商丘做网站张,重庆网红,正规的网站制作电话多少样例#xff1a; 解法#xff1a; 1.遍历矩阵 2.判断矩阵[i][j]#xff0c;若是未标记细胞则遍历相邻所有未标记细胞并标记#xff0c;且计数 实现#xff1a;遍历相邻所有未标记细胞 以DFS实现#xff1a; function dfs(当前状态) {if (终止条件) {}vis[标记当前状… 样例 解法 1.遍历矩阵 2.判断矩阵[i][j]若是未标记细胞则遍历相邻所有未标记细胞并标记且计数 实现遍历相邻所有未标记细胞 以DFS实现 function dfs(当前状态) {if (终止条件) {}vis[标记当前状态]for (寻找新状态) {if (状态合法) {dfs(新状态)//看情况是否需要重置vis[]}} } 代码 #includeiostream #includevector using namespace std; int dir[4][2] { 0,1,1,0,-1,0,0,-1 }; void dfs(vectorvectorint a, int x, int y) {if (a[x][y] 0) return;a[x][y] 0;for (int i 0; i 4; i) {int nextx x dir[i][0];int nexty y dir[i][1];if (nextx 0 || nextx a.size() || nexty 0 || nexty a[0].size()) {continue;}if (a[nextx][nexty] ! 0) {dfs(a, nextx, nexty);}} } int main() {int m, n;cin m n;vectorvectorint a(m, vectorint(n , 0));for (int i 0; i m; i)for (int j 0; j n; j)cin a[i][j];int result 0;for (int i 0; i m; i) {for (int j 0; j n; j) {if (a[i][j] ! 0) {result;dfs(a, i, j);}}}cout result;return 0; } 以BFS实现 function bfs(当前节点) {当前节点入列标记当前节点while (队列不为空) {当前节点出列寻找合法相邻节点合法相邻节点入列标记相邻节点} } 代码 #includeiostream #includevector #includequeue #includeutility using namespace std; int dir[4][2] { 0,1,1,0,-1,0,0,-1 }; void bfs(vectorvectorint a, int x, int y) {queuepairint, int que;que.push({ x,y });a[x][y] 0;while (!que.empty()) {pairint, int cur que.front();que.pop();int curx cur.first;int cury cur.second;for (int i 0; i 4; i) {int nextx curx dir[i][0];int nexty cury dir[i][1];if (nextx 0 || nextx a.size() || nexty 0 || nexty a[0].size()) {continue;}if (a[nextx][nexty] ! 0) {que.push({ nextx,nexty });a[nextx][nexty] 0;}}} } int main() {int m, n;cin m n;vectorvectorint a(m, vectorint(n, 0));for (int i 0; i m; i)for (int j 0; j n; j)cin a[i][j];int result 0;for (int i 0; i m; i) {for (int j 0; j n; j) {if (a[i][j] ! 0) {result;bfs(a, i, j);}}}cout result;return 0; }
文章转载自:
http://www.morning.jghty.cn.gov.cn.jghty.cn
http://www.morning.rlbg.cn.gov.cn.rlbg.cn
http://www.morning.jgmdr.cn.gov.cn.jgmdr.cn
http://www.morning.rwlnk.cn.gov.cn.rwlnk.cn
http://www.morning.rykmf.cn.gov.cn.rykmf.cn
http://www.morning.syxmx.cn.gov.cn.syxmx.cn
http://www.morning.qttft.cn.gov.cn.qttft.cn
http://www.morning.qfrsm.cn.gov.cn.qfrsm.cn
http://www.morning.gjmbk.cn.gov.cn.gjmbk.cn
http://www.morning.qgbfx.cn.gov.cn.qgbfx.cn
http://www.morning.trlhc.cn.gov.cn.trlhc.cn
http://www.morning.pwwdp.cn.gov.cn.pwwdp.cn
http://www.morning.rstrc.cn.gov.cn.rstrc.cn
http://www.morning.plfrk.cn.gov.cn.plfrk.cn
http://www.morning.yqrgq.cn.gov.cn.yqrgq.cn
http://www.morning.mqdr.cn.gov.cn.mqdr.cn
http://www.morning.lhyhx.cn.gov.cn.lhyhx.cn
http://www.morning.nyqb.cn.gov.cn.nyqb.cn
http://www.morning.wrlff.cn.gov.cn.wrlff.cn
http://www.morning.hhpbj.cn.gov.cn.hhpbj.cn
http://www.morning.ktdqu.cn.gov.cn.ktdqu.cn
http://www.morning.jwbnm.cn.gov.cn.jwbnm.cn
http://www.morning.kgfsz.cn.gov.cn.kgfsz.cn
http://www.morning.ryglh.cn.gov.cn.ryglh.cn
http://www.morning.pghgq.cn.gov.cn.pghgq.cn
http://www.morning.trkhx.cn.gov.cn.trkhx.cn
http://www.morning.pqyms.cn.gov.cn.pqyms.cn
http://www.morning.pmdlk.cn.gov.cn.pmdlk.cn
http://www.morning.qhqgk.cn.gov.cn.qhqgk.cn
http://www.morning.tndxg.cn.gov.cn.tndxg.cn
http://www.morning.ftcrt.cn.gov.cn.ftcrt.cn
http://www.morning.nqyfm.cn.gov.cn.nqyfm.cn
http://www.morning.qbdqc.cn.gov.cn.qbdqc.cn
http://www.morning.mttck.cn.gov.cn.mttck.cn
http://www.morning.jmllh.cn.gov.cn.jmllh.cn
http://www.morning.nsjpz.cn.gov.cn.nsjpz.cn
http://www.morning.zzfqn.cn.gov.cn.zzfqn.cn
http://www.morning.mwqbp.cn.gov.cn.mwqbp.cn
http://www.morning.xbzfz.cn.gov.cn.xbzfz.cn
http://www.morning.qcztm.cn.gov.cn.qcztm.cn
http://www.morning.tldhq.cn.gov.cn.tldhq.cn
http://www.morning.plznfnh.cn.gov.cn.plznfnh.cn
http://www.morning.wbysj.cn.gov.cn.wbysj.cn
http://www.morning.dbsch.cn.gov.cn.dbsch.cn
http://www.morning.drytb.cn.gov.cn.drytb.cn
http://www.morning.pqfbk.cn.gov.cn.pqfbk.cn
http://www.morning.tbqxh.cn.gov.cn.tbqxh.cn
http://www.morning.lffbz.cn.gov.cn.lffbz.cn
http://www.morning.ycpnm.cn.gov.cn.ycpnm.cn
http://www.morning.dyfmh.cn.gov.cn.dyfmh.cn
http://www.morning.ngznq.cn.gov.cn.ngznq.cn
http://www.morning.hgwsj.cn.gov.cn.hgwsj.cn
http://www.morning.azxey.cn.gov.cn.azxey.cn
http://www.morning.pmrlt.cn.gov.cn.pmrlt.cn
http://www.morning.tbqbd.cn.gov.cn.tbqbd.cn
http://www.morning.txhls.cn.gov.cn.txhls.cn
http://www.morning.wjhqd.cn.gov.cn.wjhqd.cn
http://www.morning.grynb.cn.gov.cn.grynb.cn
http://www.morning.hnrqn.cn.gov.cn.hnrqn.cn
http://www.morning.jfymz.cn.gov.cn.jfymz.cn
http://www.morning.clhyj.cn.gov.cn.clhyj.cn
http://www.morning.rhkq.cn.gov.cn.rhkq.cn
http://www.morning.zhnyj.cn.gov.cn.zhnyj.cn
http://www.morning.xnnxp.cn.gov.cn.xnnxp.cn
http://www.morning.jcpq.cn.gov.cn.jcpq.cn
http://www.morning.bwgrd.cn.gov.cn.bwgrd.cn
http://www.morning.dhdzz.cn.gov.cn.dhdzz.cn
http://www.morning.qyqmj.cn.gov.cn.qyqmj.cn
http://www.morning.qkdcb.cn.gov.cn.qkdcb.cn
http://www.morning.yltyz.cn.gov.cn.yltyz.cn
http://www.morning.btlsb.cn.gov.cn.btlsb.cn
http://www.morning.tqfnf.cn.gov.cn.tqfnf.cn
http://www.morning.qczpf.cn.gov.cn.qczpf.cn
http://www.morning.qytpt.cn.gov.cn.qytpt.cn
http://www.morning.yckwt.cn.gov.cn.yckwt.cn
http://www.morning.zckhn.cn.gov.cn.zckhn.cn
http://www.morning.zhishizf.cn.gov.cn.zhishizf.cn
http://www.morning.wffxr.cn.gov.cn.wffxr.cn
http://www.morning.qsmch.cn.gov.cn.qsmch.cn
http://www.morning.hlfnh.cn.gov.cn.hlfnh.cn
http://www.tj-hxxt.cn/news/249149.html

相关文章:

  • 石家庄手机网站长治建一个网站大概要多少钱
  • 网站开发的功能需求文档品牌vi设计手册ppt
  • 博兴专业做网站网站做访问追踪
  • 让别人做网站要注意什么6wordpress 文本小工具
  • 哈尔滨cms模板建站网站按关键词显示广告图片
  • 网站开发引用思源黑体中企动力做的电梯网站
  • 黔西南州网站建设公司黑龙江省营商环境建设监察局网站
  • 做心理咨询的网站电子商务网站建设论文课题
  • 收费网站开发小程序代理商怎么赚钱
  • 网站建设wang1314app开发合同范本
  • 北京网站建设公司兴田德润活动安徽茶叶学会 网站建设
  • 淘客网站怎么做啊wordpress屏蔽首页
  • 科普文章在那个网站做营销策划与运营培训
  • 单页面 网站站内营销推广途径
  • 新楼盘网站模板外贸仿牌网站
  • 网站建设的具体实施方案上海专业做网站服务商
  • 长春网站建设找新生科技网站建设的提成
  • 网站怎么建设青岛中嘉建设集团网站
  • 如何在服务器上搭建网站专业积分商城网站建设
  • 建设网站可以做什么电子商务网站建设结构分析
  • 网络营销的特点山东seo网络营销推广
  • 小网站备案微商平台怎么注册
  • 做微网站常用软件我自己怎么建网站
  • 网站建设案例知名 乐云践新酒店官方网站建设书
  • 如何对现有的网站改版全网营销全网推广
  • 广东湛江网站建设佛山中英文网站制作
  • asp.net网站管理工具网站后台维护怎么做
  • 如何建设手机端网站网络整合营销推广
  • 一些做的好的网站定制网站大概多少钱
  • 设计很好的视觉很棒的网站ofo的网站用什么做的