PLUSEVI
시간 제한: 1000ms메모리 제한: 128MB출처: CHC 2011 Final Exam - Additional competition for juniorsBOJ 3095
문제
Mirko is a strange boy so he has written down a square matrix full of ones and zeroes. Now he is interested in how many plusses there are in his matrix.
A plus is a square such that its side has an odd length greater than 1 and all of its cells are zero, except for the middle row and the middle column: they must be full of ones. For example, in the matrix below there are two plusses, one inside the other:
00100 00100 11111 00100 00100
How many plusses are there in Mirko’s matrix?
입력
In the first line there is an integer N (3 ≤ N ≤ 2000), dimension of the square matrix.
Next N lines represents rows of the matrix.
출력
In one and only line of output print the number of plusses appearing in the matrix.
예제
예제 1
입력
5 00100 00100 11111 00100 00100
출력
2
예제 2
입력
8 00010000 00010000 00010000 11111111 00010000 00010010 00010111 00010010
출력
3
코드를 제출하려면 로그인하세요.