ZOJ Problem Set - 1482
Given a maze, you are to tell the number of partitions in it.
The first line is an integer N (2 <= N <= 3000), the size of the maze.
The next N lines each has N 0-and-1's, 1 for an obstacle and 0 for an unoccupied
One number on a line - the number of partitions.
Author: PAN, Minghao
Source: ZOJ Monthly, January 2003