DWITE Online Computer Programming Contest, May 2010, Problem 3
We want to measure globes of the oil spills, by calculating their area from satellite images. There could be multiple disconnected globes in a single image, so the area of interest is marked.
The input will contain 5 test cases, each a grid. Each set is followed by a line of 10 =
signs, to visually break up test cases.
#
— oil spill.
— waterA
— marks the area of interest
The output will contain 5 lines, integers — area of corresponding oil globes.
Note: only up/down and left/right adjacent cells are connected. Diagonals are not.
Sample Input
..........
.##.......
...#......
....###...
....#A#...
....###...
..........
..........
..........
..........
==========
..........
...######.
...#....#.
...#.##.#.
...##A#.#.
........#.
.......##.
..........
##........
##........
==========
Sample Output
9
20
Problem Resource: DWITE
Comments