Advertisement

P1596-USACO10OCT-LakeCountingS

阅读量:

[USACO10OCT]Lake Counting S

题面翻译

因近期持续的降水导致了雨水汇聚到农民约翰田地中不同的区域。

输入第 1 行:两个空格隔开的整数:NM

从第二行开始一直到第N+1行的每一行都是由M个W或.组成的一个字符串序列,这些字符代表网格图中的一排位置,各字符之间紧挨着排列而没有空隙

输出一行,表示水坑的数量。

题目描述

Following recent rains, water has accumulated in different regions within Farmer John's field. The field is modeled as an N x M grid with each cell containing either 'W' for water or '.' for dry land. The farmer aims to determine the number of ponds present on his farm. A pond consists of interconnected water-filled cells, each cell being adjacent to up to eight neighboring cells. Using the provid

全部评论 (0)

还没有任何评论哟~