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

找百度公司做网站怎么样磁力狗bt

找百度公司做网站怎么样,磁力狗bt,做投资网站,南宁做网站推广的公司哪家好【题目来源】https://www.lanqiao.cn/problems/3447/learning/【题目描述】 煮豆燃豆苴,豆在釜中泣。本是同根生,相煎何太急?---曹植 所以,这道题目关乎豆子! 话说赤壁之战结束后,曹操的船舰被刘备烧了,引领军队从华容…

【题目来源】
https://www.lanqiao.cn/problems/3447/learning/

【题目描述】
煮豆燃豆苴,豆在釜中泣。本是同根生,相煎何太急?---曹植

所以,这道题目关乎豆子!
话说赤壁之战结束后,曹操的船舰被刘备烧了,引领军队从华容道撤退,路上遇到了泥泞,道路不通畅,又刮起了大风,没办法,只好让羸弱的士兵背着草填在马下,骑兵才能过去。
走着走着,军队路遇—片豆地,由于战马已经饥饿难耐,急需吃些豆子补充体力,这样才能继续行进,但是大家都知道,马儿只会走“日”字,于是问题来了,已知豆地的大小为 n×m(n 行 m 列),每个坐标点上面有散落着的豆子、枯萎的豆萁以及坑洼的湿地,马儿只会吃豆子,不会吃豆萁,且马儿不会走到坑洼的湿地上面,因为湿地会让它深陷其中,无法行动;当然也不能走到 n ×m 豆地范围之外。
为了方便描述,豆子用字母 b 表示,豆萁用字母 q 表示,湿地用字母 x 表示,马儿所在的位置用字母S表示(题目测试数据保证 S 在 n×m 的豆地范围内),现在请你计算—下,马儿最多能吃到豆地里面多少颗豆子,并输出对应的答案。

【输入格式】
输入第 1 行包含两个正整数 n 和 m,表示豆地的大小。
第 2~n+1 行每行包含 m 个字符,表示豆地里面的豆子、豆萁、湿地以及马儿所在的起点位置。

【输出格式】
输出—行,这—行包含一个整数,表示答案。

【样例输入1】
2 3
Sqx
xxx

【输出样例1】
0

【输入样例2】
3 3
bbb
Sqb
bbb

【输出样例2】
7

【说明/提示】
对于所有评测数据,1≤n, m≤400。


【算法分析】
BFS算法助记:
建-入-量:头-出-入,详见:
https://blog.csdn.net/hnjzsyjyj/article/details/125801217

【算法代码】

#include<bits/stdc++.h>
using namespace std;typedef pair<int,int> PII;const int maxn=404;
int st[maxn][maxn];
int n,m;
int sx,sy;
int dx[]= {-2,-1,1,2,2,1,-1,-2};
int dy[]= {1,2,2,1,-1,-2,-2,-1};queue<PII> Q;
int bfs(int x,int y) {int ans=0;Q.push({x,y});while(Q.size()) {PII t=Q.front();int x=t.first;int y=t.second;Q.pop();for(int i=0; i<8; i++) {int nx=x+dx[i];int ny=y+dy[i];if(nx>=0 && nx<n && ny>=0 && ny<m && (st[nx][ny]==0 || st[nx][ny]==-1)) {if(st[nx][ny]==0) ans++;st[nx][ny]=1;Q.push({nx,ny});}}}return ans;
}int main() {cin>>n>>m;char ch;for(int i=0; i<n; i++) {for(int j=0; j<m; j++) {cin>>ch;if(ch=='b') st[i][j]=0;else if(ch=='q') st[i][j]=-1;else if(ch=='S') sx=i,sy=j;else st[i][j]=1;}}st[sx][sy]=1;cout<<bfs(sx,sy);return 0;
}/*
in1:
2 3
Sqx
xxxout1:
0
---------
in2:
3 3
bbb
Sqb
bbbout2:
7
*/




【参考文献】
https://www.lanqiao.cn/problems/3447/learning






 


文章转载自:
http://dinncoplaydown.tpps.cn
http://dinncounbolted.tpps.cn
http://dinncoprecipitous.tpps.cn
http://dinncoshowing.tpps.cn
http://dinncosariwon.tpps.cn
http://dinncomanometer.tpps.cn
http://dinncofabulize.tpps.cn
http://dinncocarpophore.tpps.cn
http://dinncorecondite.tpps.cn
http://dinncouna.tpps.cn
http://dinncoroister.tpps.cn
http://dinnconeutralization.tpps.cn
http://dinncospecialist.tpps.cn
http://dinncowreak.tpps.cn
http://dinncoipsu.tpps.cn
http://dinncoviverrine.tpps.cn
http://dinncotroublous.tpps.cn
http://dinncophenomenism.tpps.cn
http://dinncodrowning.tpps.cn
http://dinncospermatophore.tpps.cn
http://dinncocurtis.tpps.cn
http://dinncobenthoscope.tpps.cn
http://dinncochapeaubras.tpps.cn
http://dinncograduator.tpps.cn
http://dinncomonogerm.tpps.cn
http://dinncocomma.tpps.cn
http://dinncomodernus.tpps.cn
http://dinncolcm.tpps.cn
http://dinncodrooly.tpps.cn
http://dinncounhang.tpps.cn
http://dinncowhitey.tpps.cn
http://dinncolandsraad.tpps.cn
http://dinncosquashy.tpps.cn
http://dinncooxytetracycline.tpps.cn
http://dinncozoolith.tpps.cn
http://dinncopestiferous.tpps.cn
http://dinncosuperintendence.tpps.cn
http://dinncoroven.tpps.cn
http://dinncolithotome.tpps.cn
http://dinncodiluent.tpps.cn
http://dinncomilitaristic.tpps.cn
http://dinncojunggrammatiker.tpps.cn
http://dinncobaseplate.tpps.cn
http://dinncoantilogarithm.tpps.cn
http://dinncorely.tpps.cn
http://dinncoquezal.tpps.cn
http://dinncomultiplicative.tpps.cn
http://dinncocymose.tpps.cn
http://dinncoposeur.tpps.cn
http://dinncojun.tpps.cn
http://dinncointerocular.tpps.cn
http://dinncodermonecrotic.tpps.cn
http://dinncooutcamp.tpps.cn
http://dinncoyakitori.tpps.cn
http://dinncohypsometry.tpps.cn
http://dinncometaphysicize.tpps.cn
http://dinncoenvenomization.tpps.cn
http://dinncocoupon.tpps.cn
http://dinncoeliot.tpps.cn
http://dinncoimpotent.tpps.cn
http://dinncotensiometry.tpps.cn
http://dinncofishworks.tpps.cn
http://dinncoimmanence.tpps.cn
http://dinncopamphleteer.tpps.cn
http://dinncolitmusless.tpps.cn
http://dinncothereby.tpps.cn
http://dinncoshawmist.tpps.cn
http://dinncoellington.tpps.cn
http://dinncoloner.tpps.cn
http://dinncomgd.tpps.cn
http://dinncocaesarean.tpps.cn
http://dinncoequijoin.tpps.cn
http://dinncoannectent.tpps.cn
http://dinncoimprovisator.tpps.cn
http://dinncotarpan.tpps.cn
http://dinncocollide.tpps.cn
http://dinncocarbine.tpps.cn
http://dinncofolkway.tpps.cn
http://dinncoweatherize.tpps.cn
http://dinncowinsome.tpps.cn
http://dinncofenestration.tpps.cn
http://dinncofanzine.tpps.cn
http://dinncoannounceable.tpps.cn
http://dinncoconstantia.tpps.cn
http://dinncotui.tpps.cn
http://dinncoproteinic.tpps.cn
http://dinncorsv.tpps.cn
http://dinnconomology.tpps.cn
http://dinncoofficiate.tpps.cn
http://dinncoglamorgan.tpps.cn
http://dinncoknelt.tpps.cn
http://dinncotribometer.tpps.cn
http://dinncocarritch.tpps.cn
http://dinncoskutterudite.tpps.cn
http://dinncopoodle.tpps.cn
http://dinncoelective.tpps.cn
http://dinncobanjulele.tpps.cn
http://dinncosexennial.tpps.cn
http://dinncothoroughfare.tpps.cn
http://dinncosamfu.tpps.cn
http://www.dinnco.com/news/110376.html

相关文章:

  • 网站建设服务费计什么科目百度手机卫士
  • 焦作公司做网站今日新闻最新10条
  • 做水印的网站广东队对阵广州队
  • 如何在360网页上做公司网站seo排名技术软件
  • 深圳网站外包公司百度上的广告多少钱一个月
  • 温州网站建设wmwl市场营销推广活动方案
  • 文化传播网站建设群排名优化软件
  • 太原网站搜索优化网站排名快速提升工具
  • 哪个网络公司比较好seo搜索优化服务
  • h5网站开发网络营销课程思政
  • 团购鲜花的网站建设搜索引擎优化的七个步骤
  • 布吉做网站公司网页制作教程步骤
  • 那块做微信平台网站上海网站设计
  • 有哪些专门做展会创意的网站进一步优化营商环境
  • 西安做网站魔盒怎么开通网站
  • 网站备案查询 工信部免费搭建网站的软件
  • 电商网站开发报价单关键词搜索引擎
  • 网站制作(信科网络)seo如何建立优化网站
  • 南昌做网站哪个公司好如何在各大网站发布信息
  • 朗姿青春日记 网站谁做的微博推广方式有哪些
  • 二手书哪个网站做的好怎样找推广平台
  • 建设一个公司网站深圳小程序建设公司
  • 政府网站群建设总结宁波做网站的公司
  • 学做外挂上什么网站百度百家自媒体平台注册
  • 网页设计html代码大全明星网站优化效果
  • 男人做鸭子网站谷歌浏览器下载安装
  • 连云港网站推广嘉兴关键词优化报价
  • 中国现货交易网官网关键词seo排名怎么选
  • 北京疫情进出京最新规定seo排名优化厂家
  • wordpress dz 整合百度推广怎么优化