中文亚洲精品无码_熟女乱子伦免费_人人超碰人人爱国产_亚洲熟妇女综合网

當(dāng)前位置: 首頁 > news >正文

建網(wǎng)站要學(xué)什么手機優(yōu)化大師官方免費下載

建網(wǎng)站要學(xué)什么,手機優(yōu)化大師官方免費下載,金華外貿(mào)網(wǎng)站建設(shè),珠海網(wǎng)站建設(shè)公司網(wǎng)站101. 孤島的總面積//思路大概是先計算面積&#xff0c;然后如果有接觸路面就返回false??赡苌晕⒍嘤嗨懔颂酂o用面積。 #include<bits/stdc.h> using namespace std; void sum(vector<vector<bool>>& finded,const vector<vector<int>>&a…

101. 孤島的總面積//思路大概是先計算面積,然后如果有接觸路面就返回false??赡苌晕⒍嘤嗨懔颂酂o用面積。

#include<bits/stdc++.h>
using namespace std;
void sum(vector<vector<bool>>& finded,const vector<vector<int>>& graph,int a,int b,int& result,bool& Ifisland){if(a<0||b<0||a>graph.size()-1||b>graph[0].size()-1) return;else if(finded[a][b]==true) return;else if(graph[a][b]==0){finded[a][b]=true;return;}else {finded[a][b]=true;result++;if(a==0||b==0||a==graph.size()-1||b==graph[0].size()-1) Ifisland=false;sum(finded,graph,a+1,b,result,Ifisland);sum(finded,graph,a,b+1,result,Ifisland);sum(finded,graph,a-1,b,result,Ifisland);sum(finded,graph,a,b-1,result,Ifisland);}return;
}
int main(){int n,m;cin>>n>>m;vector<vector<int>> graph(n,vector<int> (m));for(int i=0;i<n;i++){for(int j=0;j<m;j++){cin>>graph[i][j];}}int sumcount=0;vector<vector<bool>> finded(n,vector<bool> (m));for(int i=0;i<n;i++){for(int j=0;j<m;j++){if(graph[i][j]==1){bool Ifisland=true;int result=0;sum(finded,graph,i,j,result,Ifisland);if(Ifisland) sumcount+=result;} }}cout<<sumcount<<endl;    
}

102. 沉沒孤島//思路大致是,先遍歷邊框的,然后遞歸把連著的陸地都掃過,最后把沒掃過的且為陸地的改為0。最后按題目的要求輸出。

#include<bits/stdc++.h>
using namespace std;void DFS(vector<vector<bool>>& finded,const vector<vector<int>>& graph,int i,int j){if(i<0||j<0||i>graph.size()-1||j>graph[0].size()-1) return;else if(finded[i][j]) return;else if(graph[i][j]==0) {finded[i][j]=true;return;}else{finded[i][j]=true;DFS(finded,graph,i+1,j);DFS(finded,graph,i,j+1);DFS(finded,graph,i-1,j);DFS(finded,graph,i,j-1);}
}int main(){int n,m;cin>>n>>m;vector<vector<int>> graph(n,vector<int> (m));for(int i=0;i<n;i++){for(int j=0;j<m;j++){cin>>graph[i][j];}}vector<vector<bool>> finded(n,vector<bool> (m,false));    for(int i=0;i<n;i++){if(graph[i][0]==1&&!finded[i][0]) DFS(finded,graph,i,0);if(graph[i][m-1]==1&&!finded[i][m-1]) DFS(finded,graph,i,m-1);}  for(int j=0;j<m;j++){if(graph[0][j]==1&&!finded[0][j]) DFS(finded,graph,0,j);if(graph[n-1][j]==1&&!finded[n-1][j]) DFS(finded,graph,n-1,j);}for(int i=0;i<n;i++){for(int j=0;j<m;j++){if(graph[i][j]==1&&!finded[i][j]) {graph[i][j]=0;finded[i][j]=true;}}}for(int i=0;i<n;i++){for(int j=0;j<m-1;j++){cout<<graph[i][j]<<" ";}cout<<graph[i][m-1]<<endl;}   
}

http://www.risenshineclean.com/news/53042.html

相關(guān)文章:

  • 電商網(wǎng)站開發(fā)實驗報告seo算法是什么
  • 手機上能不能制作網(wǎng)站開發(fā)百度一下百度知道
  • 江蘇做網(wǎng)站公司抖音搜索seo
  • 青島網(wǎng)站推廣優(yōu)化百度號碼認證
  • 東營做網(wǎng)站優(yōu)化價格百度seo排名推廣
  • 株洲做網(wǎng)站公司品牌seo如何優(yōu)化
  • 做本地化的返利網(wǎng)站怎么樣營銷型網(wǎng)站方案
  • 合肥做網(wǎng)站一般多少錢百度seo不正當(dāng)競爭秒收
  • asp如何做網(wǎng)站四川seo技術(shù)培訓(xùn)
  • 寧波網(wǎng)站建設(shè)方案咨詢域名備案官網(wǎng)
  • 海南新聞最新消息太原seo管理
  • 請人做網(wǎng)站收費多少錢杭州谷歌推廣
  • 鄧州做網(wǎng)站網(wǎng)站建設(shè)的推廣渠道
  • 創(chuàng)建網(wǎng)站商城新冠疫情最新數(shù)據(jù)
  • 女人脫內(nèi)衣褲給男人做網(wǎng)站關(guān)鍵詞優(yōu)化seo多少錢一年
  • 政務(wù)公開既網(wǎng)站信息化建設(shè)會議十大電商代運營公司
  • 個人執(zhí)業(yè)資格注冊查詢搜索引擎優(yōu)化排名品牌
  • 自己網(wǎng)站上做淘寶搜索引擎百度關(guān)鍵詞推廣工具
  • 網(wǎng)站推廣項目平臺推廣廣告宣傳詞
  • 微網(wǎng)站開發(fā)中國十大網(wǎng)站排名
  • 網(wǎng)站源碼綁定域名萬秀服務(wù)不錯的seo推廣
  • 視頻網(wǎng)站如何推廣電商網(wǎng)站分析
  • 為什么要做網(wǎng)站首頁設(shè)計汕頭seo優(yōu)化項目
  • 建德網(wǎng)站優(yōu)化公司百度快照優(yōu)化的優(yōu)勢是什么
  • 西直門網(wǎng)站建設(shè)公司如何建立自己的網(wǎng)站
  • 如何用ps做網(wǎng)站效果圖百度電腦版網(wǎng)頁版
  • wordpress增加網(wǎng)址大全seo優(yōu)化一般多少錢
  • 哪些網(wǎng)站做外鏈好搜索引擎營銷的特點是什么
  • 如何用wd做網(wǎng)站設(shè)計百度競價代運營
  • 個人做的網(wǎng)站可以收款百度一下你就知道手機版官網(wǎng)