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

如何为公司建立网站网站设计主要做什么

如何为公司建立网站,网站设计主要做什么,微信网站搭建哪家好,装修第一网洛谷P1101单词方阵:用sta存字符串,for找到‘y的位置,然后dfs对字符串用for进行一个一个的判断,不符合就return,下面再用for进行book标记,能执行下面的for说明上面没有return,所以说明找到&#…

洛谷P1101单词方阵:用sta存字符串,for找到‘y'的位置,然后dfs对字符串用for进行一个一个的判断,不符合就return,下面再用for进行book标记,能执行下面的for说明上面没有return,所以说明找到,book标记字符串长度就行,然后for+if判断book为true就输出,不然就输出*就行。

#include<iostream>
#include<cstring>
using namespace std;
const int N = 105;
int n;
string sta = "yizhong";
char ch[N][N];
bool book[N][N];
int dx[8] = {0, 0, 1, -1, 1, -1, 1, -1}, dy[8] = {1, -1, 0, 0, 1, -1, -1, 1};
void dfs(int x, int y, int xd, int yd){int a = x + xd, b = y + yd;for(int i = 1; i < 7; i++){if(sta[i] != ch[a][b])return;a += xd;b += yd;}for(int i = 0; i < 7; i++){book[x][y] = true;x += xd;y += yd;} 
}
int main(){cin >> n;for(int i = 1; i <= n; i++){for(int j = 1; j <= n; j++){cin >> ch[i][j];}}for(int i = 1; i <= n; i++){for(int j = 1; j <= n; j++){if(ch[i][j] == 'y'){for(int k = 0; k < 8; k++) dfs(i, j, dx[k], dy[k]);} } }for(int i = 1; i <= n; i++){for(int j = 1; j <= n; j++){if(book[i][j]) cout << ch[i][j];else cout << '*' ;}cout << endl;}return 0;
}

洛谷P2404自然数的拆分问题:DFS

#include<iostream>
using namespace std;
int n, m;
int p[15] = {1};
void dfs(int x){for(int i = p[x - 1]; i <= m; i++){if(i == n)continue;p[x] = i;m -= i;if(m == 0){for(int j = 1; j < x; j++){cout << p[j] << '+';}cout << p[x] << endl;}else dfs(x + 1);m += i;}
}
int main(){cin >> n;m = n;dfs(1);return 0;
}

洛谷P1596一道BFS,求连通块数量。

#include<iostream>
#include<queue>
using namespace std;
const int N = 105;
int n, m;
bool st[N][N];
char ch[N][N];
int ans;
int dx[8] = {0, 0, 1, -1, 1, -1, 1, -1};
int dy[8] = {1, -1, 0, 0, 1, -1, -1, 1};
typedef pair<int, int> PII;
void bfs(int a, int b){queue<PII> q;q.push({a, b});st[a][b] = true;while(q.size()){auto t = q.front();q.pop();int x = t.first, y = t.second;for(int i = 0; i < 8; i++){int xx = x + dx[i], yy = y + dy[i];if(xx >= 1 && xx <= n && yy >= 1 && yy <= m && !st[xx][yy] && ch[xx][yy] == 'W'){st[xx][yy] = true;q.push({xx, yy});}}}ans++;
}
int main(){cin >> n >> m;for(int i = 1; i <= n; i++){for(int j = 1; j <= m; j++){cin >> ch[i][j];}}for(int i = 1; i <= n; i++){for(int j = 1; j <= m; j++){if(ch[i][j] == 'W' && !st[i][j])bfs(i, j);}}cout << ans << endl;return 0;
}

洛谷P1162填色:相当于围墙加水,里面的是水也就是2, 外面的为0,外面从0,0开始把围墙外的数通过BFS都给标记成3,然后是3就输出0,原来的围墙1不变,然后围墙里面本来是0,的就输出2。

#include<iostream>
#include<queue>
using namespace std;
const int N = 35;
int a[N][N];
int n;
bool st[N][N];
int dx[4] = {0, 0, 1, -1}, dy[4] = {1, -1, 0, 0};
typedef pair<int, int> PII; 
void bfs(){queue<PII> q;q.push({0, 0});st[0][0] = true;while(q.size()){auto t = q.front();q.pop();int x = t.first, y = t.second;for(int i = 0; i < 4; i++){int xx = x + dx[i], yy = y + dy[i];if(xx >= 0 && xx <= n + 1 && yy >= 0 && yy <= n + 1 && !st[xx][yy] && a[xx][yy] == 0){a[xx][yy] = 3;st[xx][yy] = true;q.push({xx, yy});}}}
}
int main(){cin >> n;for(int i = 1; i <= n; i++){for(int j = 1; j <= n; j++){cin >> a[i][j];}}bfs();for(int i = 1; i <= n; i++){for(int j = 1; j <= n; j++){if(a[i][j] == 3) cout << 0 << ' ';else if(a[i][j] == 1) cout << 1 << ' ';else cout << 2 << ' '; }cout << endl;}return 0;
}

http://www.yayakq.cn/news/10077/

相关文章:

  • 网站建设专业总结铜官山区建设局网站
  • 建设企业网站官网登录人工智能建筑设计软件
  • 网站网络优化外包个人网站的建设
  • 自建网站营销是什么平面设计网课平台哪个好
  • 建设网站的网站做性的网站有哪些
  • 网站设置搜索框是什么知识点品牌策划网站建设
  • 怎么做网站网站建筑公司分几级资质
  • 网站建设开发网站案例项目费用企业所得税的征收方式有
  • 网站优化分析软件加工设备网
  • 怎样才能建设一歌网站亚马逊电商平台入口
  • wordpress网站搬福州seo外包公司
  • 国际贸易网站排名搜狗识图
  • 建网站建设网站wordpress 分类判断
  • 网站建设126私域视频
  • 广西汽车网网站建设网站制作的基本步骤是
  • 布局网站开发如何给网站做权重
  • 上海迈诺网站建设个人网站 虚拟主机
  • 临沂吧网站建设wordpress图片不显示
  • 企业建站套餐巩义网络推广
  • wap网站制作模板网站建设推广用兴田德润
  • 有专门做特产的网站吗百度seo优化推广公司
  • 深圳做男装什么网站容易找工qq网页版登录官网登录入口
  • 网站服务器租用价格多少钱一年网站开发要注意的问题
  • 用织梦做的网站一般后台大学 建网站
  • 济南哪家公司做网站好椒江网站建设
  • 小语种网站建设要点优秀网页制作模板
  • 手机自适应网站公司简介模板范文高大上
  • 网站后台传不上图片软件开发的步骤流程
  • 东莞app培训网站建设wordpress配置163邮箱
  • 宁波网站免费制作工程建设教育网站