UVa 871 - Counting Cells in a Blob

871 - Counting Cells in a Blob
Counting Cells in a Blob

Summary
Search all area in the given map using floodfill method. Then calculate the area for each found blob. Output the maximum one.

Instruction
Search all area in the given map using floodfill method. Then calculate the area for each found blob. Output the maximum one. Since the map only 25x25 size, use array for better approaching.

Optimization
Using iterative floodfill method can increase the speed of your program and make your program more save from stack overflow.

Gotcha's
Multiple input problem. Beware!

Input
2

11000 01100 00101 10001 01011

010101 101010 010101 101010 010101 101010

Output
5

18