|| ||Code Submission Evaluation System
CSES - HIIT Open 2017
HIIT Open 2017
|Contest start:||2017-05-27 11:00:00|
|Contest end:||2017-05-27 16:00:00|
Task list | Submit code | Submissions | Messages | Scoreboard
You are given an $n \times m$ grid whose each square is either black or white.
Count the number of rectangles whose each corner square is black.
The first input line contains two integer $n$ and $m$: the size of the grid.
Then, there are $n$ lines of length $m$ that describe the grid. Each line consists of characters 0 (white) and 1 (black).
Print the number of rectangles whose each corner square is black.