1047:Rectangular

时间限制:2 S   /  内存限制:65536 KB
AC:18   /  Submit:49
问题描述

Given a m * n matrix, consists of 0 and 1, we need to calculate the number of rectangle that meet the following conditions: = child rectangle, the value of the four vertices 1.

Such as:

10101

00111

10001

Four vertices 1, is a meet the conditions of the rectangle.

输入描述

The input consists of several test cases. For each case,

The first line contains two integers m and n. (1 < = m, n < = 100).

The following m lines, each line has a number n, said 01 matrix

输出描述

The number of rectangles in the meet the conditions.

样例输入复制样例

1 3

1 1 1

2 3

1 0 1

0 1 1

3 3

1 0 1

0 1 1

1 1 1

样例输出

0

0

2

相关

round1


Copyright 2016 - 2024 XUJC ACM Team
闽ICP备2020022076号-1