#P6866. [COCI 2019/2020 #5] Emacs
[COCI 2019/2020 #5] Emacs
Description
Given an matrix containing only . and *.
The * cells in the matrix form some non-overlapping rectangles. They do not touch at edges or corners.
How many rectangles are there?
Input Format
The first line: two positive integers and .
The next lines: the matrix described above. The matrix contains only . and *.
Output Format
Output one non-negative integer in one line, your answer.
6 7
***....
***..**
.....**
.***.**
.***...
.***...
3
3 3
*.*
...
*.*
4
1 10
.*.**.***.
3
Hint
Constraints
- For pts of the testdata, each rectangle in the matrix contains only one
*. - For another pts of the testdata, it is guaranteed that .
- For all testdata, .
Notes
Translated from COCI2019-2020 CONTEST #5 T1 Emacs, translator: 90693。
Translated by ChatGPT 5
京公网安备 11011102002149号