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

杭州网站建设招聘wordpress安装主题

杭州网站建设招聘,wordpress安装主题,六安网新闻,设计本质安全题目描述 给定一张地势图#xff0c;所有的点都被水淹没#xff0c;现在有一些关键点#xff0c;要求放最少的水泵使所有关键点的水都被抽干 输入输出格式 输入格式#xff1a; In the first line of the standard input there are two integers and , separated by a sin…题目描述 给定一张地势图所有的点都被水淹没现在有一些关键点要求放最少的水泵使所有关键点的水都被抽干 输入输出格式 输入格式 In the first line of the standard input there are two integers  and , separated by a single space,. The following  lines contain the description of the map. The th linedescribes the th row ofunitary squares in the map. It contains  integers , separated by single spaces,, . The number  describes the th square of the ![](http://main.edu.pl/images/OI14/pow-en-tex.14.pn… 输出格式 Your programme should write out one integer to the standard output - the minimum number of pumpsneeded to drain Byteburg. 输入输出样例 输入样例#16 9 -2 -2 -1 -1 -2 -2 -2 -12 -3 -2 1 -1 2 -8 -12 2 -12 -12 -5 3 1 1 -12 4 -6 2 -2 -5 -2 -2 2 -12 -3 4 -3 -1 -5 -6 -2 2 -12 5 6 2 -1 -4 -8 -8 -10 -12 -8 -6 -6 -4 输出样例#12我们首先考虑如果在格子 a 修建一个抽水机在什么情况下格子 b 的水也可以被抽干。我们可以发现当且仅当存在一条从 a 到 b 的路径中间经过的抽水机包括 a的高度都不大于 b 的高度。即h[b]max(h[i])因此我们可以考虑把所有格子的高度从小到大排序我们把每一个格子建成一个集合。然后按照海拔高度从小到大扫描格子对于当前的格子 i我们找到所有与 i 相邻并且海拔高度不大于格子 i 的格子我们发现如果这些格子中的任意一个洪水要是被解决了那么格子 i 的洪水也可以被解决所以我们合并这些格子。对于当前的格子 i如果它必须被清理且与它相邻的格子集合中没有任何一个被清理我们则把这个集合的清理状态标记为真然后答案加 1。集合和每个格子是否被清理用并查集来维护就可以了。 1 #includeiostream2 #includecstdio3 #includecstring4 #includealgorithm5 using namespace std;6 struct node7 {8 int s,x,y;9 } city[1000001],maze[100001]; 10 pairint,int set[1001][1001]; 11 int dx[5]{0,1,-1,0,0}; 12 int dy[5]{0,0,0,1,-1}; 13 int n,m,a[1001][1001],tot,cnt,vis[1001][1001],ans; 14 bool cmp(node a,node b) 15 { 16 return (a.sb.s); 17 } 18 pairint,int find(pairint,int x) 19 { 20 if (set[x.first][x.second]!x) set[x.first][x.second]find(set[x.first][x.second]); 21 return set[x.first][x.second]; 22 } 23 void union_set(pairint,int x,pairint,int y) 24 { 25 xfind(x),yfind(y); 26 set[x.first][x.second]y; 27 vis[y.first][y.second]|vis[x.first][x.second]; 28 } 29 void exam(int x,int y) 30 { 31 for(int i1;i4;i) 32 { 33 int txxdx[i], tyydy[i]; 34 if(tx0||ty0||txm||tyn) continue; 35 if(a[tx][ty]a[x][y]) continue; 36 union_set(make_pair(x, y), make_pair(tx, ty)); 37 } 38 } 39 int main() 40 { 41 int i,j; 42 cinnm; 43 for (i1; in; i) 44 { 45 for (j1; jm; j) 46 { 47 scanf(%d,a[i][j]); 48 if (a[i][j]0) 49 { 50 a[i][j]-a[i][j]; 51 } 52 else 53 { 54 city[tot](node){a[i][j],i,j}; 55 } 56 maze[cnt](node){a[i][j],i,j}; 57 set[i][j]make_pair(i,j); 58 } 59 } 60 sort(maze1,mazecnt1,cmp); 61 sort(city1,citytot1,cmp); 62 for (i1; itot; i) 63 { 64 for (j1; jcnt,city[i].smaze[j].s; j) 65 { 66 exam(maze[j].x,maze[j].y); 67 pairint,int xfind(make_pair(city[i].x,city[i].y)); 68 if (vis[x.first][x.second]0) 69 { 70 ans; 71 vis[x.first][x.second]1; 72 } 73 } 74 } 75 coutans; 76 }   转载于:https://www.cnblogs.com/Y-E-T-I/p/7221242.html
http://www.sadfv.cn/news/343494/

相关文章:

  • 网站建设三剑客王府井网上商城是正品吗
  • 充值网站怎么做摄影网站建设目的
  • 网站推广网络网站建设策划方案模板
  • 云南建设厅网站备案厂家网上书店网站建设毕业设计
  • 西安哪个公司网站建设好设计制作实践活动有哪些
  • 医院网站推广方法百度竞价怎么做
  • 扬州网站开发网站设计合理
  • 公司网站建设上海找谁网站设计的公司选哪家
  • 咸阳做网站优化合肥网站关键词排名
  • 网站建设运营规划wordpress视频滑块
  • ps网站子页怎么做武功网站建设
  • 南宁网站建设电话专业网上购物平台
  • 网站信息化建设方案wordpress选择虚拟云主机
  • 学做网站论坛熊掌怎么做音乐网站
  • 培训网站制作网站徐州做网站沈阳厂商
  • asp.ne手机触摸网站开发用织梦做的网站怎么管理
  • 怎样才能申请网站网络工程师是干嘛的
  • 网站制作的重要流程图有人用我的企业做网站
  • 单位网站建设费用账务处理如何做自己公司网站
  • c .net网站开发入门wordpress会员中心模板下载
  • 怎么做网站内部链接的优化wordpress快速仿站视频教程
  • 黑龙江省建设会计协会网站wordpress主题订单系统
  • 做网站工作职责南充市建设局官方网站
  • 手机网站的作用如何下wordpress
  • 贵州黔东南双控体系建设网站建设专业网站哪家技术好
  • 建设网站必须用dns上杭县住房和城乡建设局网站
  • 做婚纱网站的图片大全微信运营商怎么联系
  • 做网站为什么需要花钱建e
  • 专业的网站开发服务wordpress图片上传到七牛云
  • 滨海新区城市建设档案馆网站跨境电商哪个平台比较好