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

三端合一网站开发的关键技术阿里云搜索引擎网址

三端合一网站开发的关键技术,阿里云搜索引擎网址,昆明网站开发培训机构,做网站建设需要题目链接如下&#xff1a; Online Judge UVA439 骑士的移动 - 锦依卫议事堂 - 洛谷博客 这里有好几个特别厉害的解法...先存着慢慢看。 我的代码如下&#xff1a; #include <iostream> #include <deque> #include <string> // #define debugstruct node{…

题目链接如下:

Online Judge

UVA439 骑士的移动 - 锦依卫议事堂 - 洛谷博客 这里有好几个特别厉害的解法...先存着慢慢看。

我的代码如下:

#include <iostream>
#include <deque>
#include <string>
// #define debugstruct node{std::string loc;int step;
};
std::string s1, s2;
int dx[] = {2, 1, -1, -2, -2, -1, 1, 2};
int dy[] = {1, 2, 2, 1, -1, -2, -2, -1};int calStep(){if (s1 == s2){return 0;}node temp;temp.loc = s1;temp.step = 0;std::deque<node> dq;dq.push_back(temp);while (!dq.empty()){node curr = dq.front();dq.pop_front();for (int u = 0; u < 8; ++u){node tmp;tmp.loc.push_back(curr.loc[0] + dx[u]);tmp.loc.push_back(curr.loc[1] + dy[u]);if (tmp.loc == s2){return curr.step + 1;}if (tmp.loc[0] >= 'a' && tmp.loc[0] <= 'h' && tmp.loc[1] >= '1' && tmp.loc[1] <= '8'){tmp.step = curr.step + 1;dq.push_back(tmp);}}}
}int main(){#ifdef debugfreopen("0.txt", "r", stdin);freopen("1.txt", "w", stdout);#endifwhile (std::cin >> s1 >> s2){printf("To get from %s to %s takes %d knight moves.\n", s1.c_str(), s2.c_str(), calStep());}#ifdef debugfclose(stdin);fclose(stdout);#endifreturn 0;
}

http://www.wooajung.com/news/27490.html

相关文章:

  • 江苏建设人才网网站百度seo排名规则
  • 网站竞争对手郑州网站制作公司哪家好
  • 溧水114网站开发容易被百度收录的网站
  • 行业网站建设蓝云排名优化课程
  • 网站被降权恢复市场营销分析案例
  • 闵行区 网站制作网站排名
  • 功能型网站案例品牌推广的目的和意义
  • 广东 网站经营性备案太原关键词优化公司
  • 怎么做草坪网站长春网站建设策划方案
  • 做房地产网站广告销售百度品牌推广
  • 太原网站制作维护搜索引擎优化技术都有哪些
  • web网站如何做负载均衡百度搜索资源平台
  • 外贸网站建设的好处市场营销说白了就是干什么的
  • 赣州做网站的公司有哪家介绍网络营销
  • 小网站推荐周口网站seo
  • 做网站公司怎么做网络营销的基本方法
  • 网站首页被k 做跳转品牌推广策略怎么写
  • 做一个简单网站谷歌搜索引擎seo
  • 北京专业网站改版公司网站seo查询站长之家
  • 代做毕业设计网站 道路桥梁郑州网站seo推广
  • 一个虚拟空间可以做两个网站吗百度搜索排名机制
  • 西安机场商务宾馆百度做网站短链接生成网址
  • 做网站 源码谷歌三件套一键安装
  • 网站开发毕业设计题目seo优化入门教程
  • 厘米售卡站怎么做网站好的竞价推广外包公司
  • 赣州网站制作培训2023年新闻热点事件摘抄
  • 做网站营业范围宁波网站推广方案
  • 如何编辑网站网站运营公司
  • 网站怎么做可以再上面输入文字推广
  • 自助网站企业网络营销推广方案