题目链接: NOI题库http://noi.openjudge.cn/ch0205/1388/ POJ 2386 http://poj.org/problem?id=2386 题目大意: 有一块N*M的土地,雨后机起了水,有水标记为'W',干燥标记为'.'。八连通的积水被认为是连接在一起的。需要求出
转载 2017-07-30 12:49:00
135阅读
2评论
Lake Counting 1 #include<iostream> 2 #include<cstdio> 3 #include<queue> 4 using namespace std; 5 6 const int N=1005; 7 int r,c,ans,t[]={1,0,-1,-1,-1,0 ...
转载 2021-08-13 12:34:00
172阅读
简单的DFS , 和紫书上的油田差不多! 写这篇博客主要通过 #include using namespace
原创 2023-05-15 00:40:08
33阅读
代码不写就手生啊。。。 注意输入, 二维数组 #include #include #include #include #include using namespace std; const int maxn=100+5; char field[maxn][maxn]; int n,m; void input() { scanf("%d%d", &n, &m); for(...
Due to recent rains, w...
转载 2019-05-05 16:05:00
16阅读
Due to recent rains, w...
转载 2019-05-05 16:05:00
12阅读
Lake Counting Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 19591 Accepted: 9848 Description Due to recent rains, water has pooled in var
转载 2016-02-24 17:19:00
36阅读
2评论
Due to recent rains, water has pooled in various places in Farmer John's field, which is represented by a rectangle of N x M
原创 2023-05-18 14:22:29
78阅读
Lake CountingTime Limit: scriptionDue to recent rains, water has pooled in various places in
原创 2023-07-11 16:38:42
77阅读
#include <iostream> #include <cstdio> #include <cstring> #include <cstdlib> #include <cmath> #include <stack> #define Max 101 using namespace std; cha
转载 2018-05-12 20:21:00
43阅读
Description Due to recent rains, water has pooled in various places in Farmer John's field, which is represented by a rectangle of N x M (1 <= N <= 10
转载 2019-10-09 18:05:00
90阅读
2评论
来源:http://poj.org/problem?id=2386 Lake Counting Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 20124 Accepted: 10139 Description Due to re
转载 2017-06-02 10:12:00
92阅读
2评论
Due to recent rains, water has pooled in various places in Farmer John’s field, which is represented by a rectangle of N x M (1 <= N <= 100; 1 <= M <= 100) squares. Each square contains ei...
原创 2021-08-10 10:11:29
59阅读
Due to recent rains, water has pooled in various places in Farmer John’s field, which is represented by a rectangle of N x M (1 <= N <= 100; 1 <= M <= 100) squares. Each square contains ei
原创 2022-03-24 11:41:33
125阅读
查看题目点击:http://poj.org/problem?id=2386思路:先找到一个为'W'的点,然后对其周围的8个方向搜索,每次搜索ans++#includeusing namespace std;const int N=105;int n,m,num;char a[N][N];void dfs(int x,int y){    a[x][y]='.
原创 2021-07-06 13:46:27
88阅读
Description Due to recent rains, water has pooled in various places in Farmer John's field, which is represented by a rectangle of N x M (1 <= N <= 10
转载 2018-04-22 00:03:00
65阅读
2评论
题意几乎和杭电OJ上的合并石油那个题一样,但是我改哪个石油的代码交的时候没过,索性就自己又再写了一遍,简单搜索,可以说是比较简单了,附代码如下:#include<iostream>#include<cstdio>#include<cstring>using nam
原创
VII
2023-05-26 14:51:31
79阅读
是简单的搜索题,可以深搜,也可以广搜。这里用的是深搜记得要标记状态就行了。#include#include#include#includeusing namespace
原创 2023-07-27 18:37:53
49阅读
problemsolutioncodes//DFS 求通块#include<iostream>#include<string>using namespace std;int n, m, ans;string a[100];void dfs(int x, int y){ for(int i = -1; i <= 1; i+...
原创 2023-02-08 11:21:16
75阅读
Lake Counting时间限制: 1000ms 内存限制: 65536KB通过次数: 1总提交次数: 1问题描述Due to recent rains, water has pooled in various places in Farmer John's fie...
转载 2017-06-27 05:29:00
55阅读
2评论
  • 1
  • 2
  • 3
  • 4
  • 5