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

景区智慧旅游网站建设wordpress手机版错误

景区智慧旅游网站建设,wordpress手机版错误,献县网站建设公司,做网站视频用哪个视频编辑软件洛谷P2895&#xff1a;用BFS走出危险区域&#xff0c;危险区域存在时间&#xff0c;我们用ma记录最快变成危险区域的时间&#xff0c; 然后每次枚举时间1然后跟ma数组比较看能不能走&#xff0c;然后时间复杂度为O(305^2)。 #include<iostream> #include<cstring>…

洛谷P2895:用BFS走出危险区域,危险区域存在时间,我们用ma记录最快变成危险区域的时间, 然后每次枚举时间+1然后跟ma数组比较看能不能走,然后时间复杂度为O(305^2)。

#include<iostream>
#include<cstring>
#include<queue>
using namespace std;
const int N = 50010;
int m, x, y, t;
typedef pair<int, int>PII;
int ma[305][305], ans[305][305];
bool v[305][305];
int dx[5] = {1, -1, 0, 0, 0},dy[5] = {0, 0, 1, -1, 0};
int change(int x){if(x == -1)return 99999;return x;
}
int main(){cin >> m;memset(ma, -1, sizeof(ma));while(m--){cin >> x >> y >> t;for(int i = 0; i < 5; i++){if(x + dx[i] >= 0 && y + dy[i] >= 0 && (ma[x + dx[i]][y + dy[i]] == -1 || ma[x + dx[i]][y + dy[i]] > t)){ma[x + dx[i]][y + dy[i]] = t;}}}queue<PII> q;q.push({0, 0});v[0][0] = true;while(q.size()){auto t = q.front();q.pop();int xd = t.first, yd = t.second;int s = ans[xd][yd] + 1;if(ma[xd][yd] == -1){cout << s - 1 << endl;return 0;}for(int i = 0; i < 4; i++){int xx = xd + dx[i], yy = yd + dy[i];if(xx >= 0 && yy >= 0 && s < change(ma[xx][yy]) && !v[xx][yy]){v[xx][yy] = true;ans[xx][yy] = s;q.push({xx, yy});}}}cout << -1 << endl;return 0;
}

洛谷P2036

#include<iostream>
#include<cmath>
#include<algorithm>
using namespace std;
int n, ss = 1, bb;
int s[15], b[15];
bool flag[15];
int ans = 0x7ffffff;
void dfs(int x){if(x > n){}else{for(int i = 1; i <= n; i++){if(flag[i] == false){ss *= s[i], bb += b[i];flag[i] = true;ans = min(ans, abs(ss - bb));dfs(x + 1);ss /= s[i], bb -= b[i];flag[i] = false;}}}
}
int main(){cin >> n;for(int i = 1; i <= n; i++){cin >> s[i] >> b[i];}dfs(1);cout << ans << endl;return 0;
}

洛谷P1605迷宫

#include<iostream>
#include<cstring>
#include<queue>
using namespace std;
int n, m, t;
const int N = 15;
int sx, sy, fx, fy, xd, yd;
bool za[N][N], st[N][N];
int ans;
int dx[4] = {0, 0, 1, -1}, dy[4] = {1, -1, 0, 0};
void dfs(int x, int y){if(x == fx && y == fy){ans++;return;}for(int i = 0; i < 4; i++){int xx = x + dx[i], yy = y + dy[i];if(xx >= 1 && xx <= n && yy >= 1 && yy <= m && !za[xx][yy] && !st[xx][yy]){st[xx][yy] = true;dfs(xx, yy);st[xx][yy] = false;}}
}
int main(){cin >> n >> m >> t;cin >> sx >> sy >> fx >> fy;st[sx][sy] = true;//注意特殊点 while(t--){cin >> xd >> yd;za[xd][yd] = true;}dfs(sx, sy);cout << ans << endl;return 0;
}


文章转载自:

http://cZrLkuIs.qtbnm.cn
http://hxdgypGa.qtbnm.cn
http://sJUTIiTM.qtbnm.cn
http://8rdjVN8x.qtbnm.cn
http://KXtbPhi9.qtbnm.cn
http://N0u2PXKf.qtbnm.cn
http://0mLSfLRa.qtbnm.cn
http://gcghoQYx.qtbnm.cn
http://c17xiatC.qtbnm.cn
http://JbUXCR8k.qtbnm.cn
http://ULm0Lk9G.qtbnm.cn
http://bOiFWw1K.qtbnm.cn
http://aQbFd6zj.qtbnm.cn
http://16zqBxFh.qtbnm.cn
http://V84QMaof.qtbnm.cn
http://U9TZnb7m.qtbnm.cn
http://dYNUtwYb.qtbnm.cn
http://lseAfVm4.qtbnm.cn
http://aAotFgfh.qtbnm.cn
http://dtaPghII.qtbnm.cn
http://w2mJTq6F.qtbnm.cn
http://y3z6NR22.qtbnm.cn
http://GchSSS3w.qtbnm.cn
http://jLnwPybf.qtbnm.cn
http://E2fvvbyg.qtbnm.cn
http://kcMBZFQS.qtbnm.cn
http://d1ePAJsI.qtbnm.cn
http://96NR70v9.qtbnm.cn
http://BiYYyeVb.qtbnm.cn
http://wljE1uom.qtbnm.cn
http://www.dtcms.com/wzjs/727983.html

相关文章:

  • 欧美企业网站模板开一个做网站的公司
  • 网站建设 部署与发布题库浙江建设职业技术学院继续教育学院网站
  • 策划与设计一个电子商务网站网站服务器干啥
  • 不懂英文怎么做英文的seo网站怎么检查网站死链
  • 手机版网站优化织梦门户网站做大后
  • 宣传网站建设实践报告网站建设费用大概多少
  • 长春建设银行网站溧阳人才网 网站开发
  • 做网站安全的公司有哪些北京模板网站开发公司
  • 网站建设组织专注高密做网站哪家好
  • 个人介绍微电影网站模板软文案例大全
  • 网站建设正规公司iis 建立子网站
  • 长春新建高铁站网站安全狗 fastcgi
  • 建站工具官网重庆建设摩托车价格及图片
  • 七台河网站网站建设深圳展示型网站建设
  • ucenter整合wordpress白山网站seo
  • 怎样设置自己的网站免费培训seo
  • 如何利用fortran语言建设网站又拍云wordpress全站cdn
  • c2c跨境电子商务平台湖南seo推广软件
  • 支付网站建设费用做账网站不让百度收录
  • 深圳网站程序开发深圳10大产品设计公司
  • 网站建设与管理吴振峰ppt关键词推广平台
  • 大连开发区做网站的公司点卡平台网站开发
  • 重庆模板网站建设费用漫画网站源码
  • 北京酷站科技有限公司秦皇岛市建设局
  • 学做企业网站网站建设与维护试卷 一
  • 短网址在线生成免费佛山网站优化
  • 龙岗区住房和建设局官方网站八大员考试报名官网
  • wordpress 网站换域名asp个人网站论文
  • 网站建设重要意义深一互联网站建设怎样
  • 设计公司网站制作淘客网站怎么建设