Rectangle_Area

В роботі Опубліковано %project.relative_time Оплачується при отриманні
В роботі Оплачується при отриманні

The task

A 2D array of 0's and 1's is given. The array was filed with a sequence of correctly drawn rectangles of various sizes on different positions. Count the number of the remaining correctly drawn rectangles in the array and calculate the total area of their interiors.

Input

The first input line contains two integer M and N separated by space and specifying the number of rows and the number of columns in a 2D array which is on the next M lines. Each of next M lines contains N values which specify the contents of a row in the array, the values are separated by spaces. Each value is 0 or 1.

It holds 5 ≤ M, N ≤ 1000.

Output

The output contains one text line with two integers separated by space. The first integer represents the number of correctly drawn rectangles in the input array. The second line represents the sum of areas of interiors of all correctly drawn retangles in the input array.

Machine Learning (ML) Python Алгоритм

ID Проекту: #20087201

Про проект

1 заявка Дистанційний проект Остання активність 4 роки(ів) тому