#P1191. 矩形
矩形
Description
You are given an matrix. In the matrix, some cells are colored white and some are colored black. Find the number of white rectangles in the matrix.
Input Format
The first line contains an integer , denoting the size of the matrix. Then follow lines, each containing characters. Each character is or . Here, denotes a white cell, and denotes a black cell.
Output Format
Output a single positive integer: the number of white rectangles.
4
WWBW
BBWB
WBWW
WBWB
15
Hint
For of the testdata, . For of the testdata, .
Translated by ChatGPT 5
京公网安备 11011102002149号