练65.1 水洼个数
You cannot submit for this problem because the contest is ended. You can click "Open in Problem Set" to view this problem in normal mode.
Description
There is a piece of land of size . After the rain, water has accumulated in some places, marked as 'W', while dry land is marked as '.'. Water that is 8-connected is considered to be part of the same puddle. Find the total number of puddles in the yard.
Input Format
The first line contains and (). The following lines show the land map.
Output Format
A single line containing the total number of puddles.
Sample
10 12
W........WW.
.WWW.....WWW
....WW...WW.
.........WW.
.........W..
..W......W..
.W.W.....WW.
W.W.W.....W.
.W.W......W.
..W.......W.3
20251122 C班作业(7)
- Status
- Done
- Problem
- 2
- Open Since
- 2025-11-22 0:00
- Deadline
- 2025-11-30 23:59
- Extension
- 24 hour(s)