#t443. 面积
面积
Area
Problem Background
Special for beginners, ^_^
Problem Description
Write a program to compute the area of the figure enclosed by 1s.
The area is computed by counting the number of intersections of horizontal and vertical lines inside the closed curve formed by 1s.
As shown in the sample data, in a two-dimensional array, 1s enclose points, so the area is .
Input Format
A digit matrix, with a space between digits on each line. The digits are 0 or 1.
Output Format
Output one number: the area of the figure enclosed by 1s in the matrix.
Sample Input 1
0 0 0 0 0 0 0 0 0 0
0 0 0 0 1 1 1 0 0 0
0 0 0 0 1 0 0 1 0 0
0 0 0 0 0 1 0 0 1 0
0 0 1 0 0 0 1 0 1 0
0 1 0 1 0 1 0 0 1 0
0 1 0 0 1 1 0 1 1 0
0 0 1 0 0 0 0 1 0 0
0 0 0 1 1 1 1 1 0 0
0 0 0 0 0 0 0 0 0 0
Sample Output 1
15
Constraints
Time limit 1s, memory limit 1024KiB for each test case.