POJ 2386 Lake Counting
来源:互联网 发布:php拉圈圈源码 编辑:程序博客网 时间:2024/05/02 01:02
一.题意
给出一个M*N的地图,有些地方被雨淹了。
问这些被淹没的地方形成了多少个池塘(连同块)?
( M,N<=100,这里规定任意格子周围的八个格子都是与它相邻的 )
二.解法
void Dfs(int x,int y){ field[x][y]='.'; for(int dx=-1;dx<=1;++dx) for(int dy=-1;dy<=1;++dy) { int nx=x+dx,ny=y+dy; if(0<=nx&&nx<N&&0<=ny&&ny<M&&field[nx][ny]=='W') dfs(nx,ny): } return ;}
- poj 2386 Lake Counting
- poj 2386 Lake Counting
- POJ 2386 Lake Counting
- poj 2386 Lake Counting
- poj 2386 Lake Counting
- poj 2386 Lake Counting
- POJ 2386 Lake Counting
- poj 2386 Lake Counting
- POJ 2386 Lake Counting
- POJ 2386 Lake Counting
- poj 2386 Lake Counting
- POJ 2386 Lake Counting
- POJ 2386 Lake Counting
- POJ-2386-Lake Counting
- POJ 2386 Lake Counting
- poj 2386 Lake Counting
- Poj 2386 Lake Counting
- poj 2386 Lake Counting
- LeetCode题解:Valid Sudoku
- java主函数详解
- js自动生成对象的属性
- LDAP使用GSS-API鉴权认证 学习
- Matlab基本函数-compass函数
- POJ 2386 Lake Counting
- java自学笔记之多态 内部类 异常处理
- 实现了wm手机无线共享电脑流量
- Qt5.2中的android环境搭建
- Java中的main()方法详解
- fork函数的用法总结
- How to: Linux delete or remove kernel
- CF 123D
- Hadoop学习笔记(三):Combiner funcitons