#P6438. [COCI 2011/2012 #6] PROZORI
[COCI 2011/2012 #6] PROZORI
Description
We represent a window blind as a square grid. In each row, all characters are either * or all are .. The blind can only be in the following five states:

The building opposite has floors, and each floor has windows. Given the representation of the windows in the building, find how many blinds there are in each of the five states above.
Input Format
The first line contains two integers, representing the number of floors and the number of windows per floor .
The next lines each contain characters describing the building’s windows. The window frames are represented by #, and the inside can only be one of the five states given above. You can read the sample to better understand the input format.
Output Format
Output one line with five integers separated by spaces, in order, representing how many blinds are in each of the five states above.
1 2
###########
#....#****#
#....#****#
#....#....#
#....#....#
###########
1 0 1 0 0
2 3
################
#****#****#****#
#****#****#****#
#****#....#****#
#....#....#****#
################
#....#****#****#
#....#****#....#
#....#....#....#
#....#....#....#
################
1 1 2 1 1
Hint
Explanation of Sample 1
- The window whose top-left corner is at row , column , and bottom-right corner is at row , column is a window in the first state.
- The window whose top-left corner is at row , column , and bottom-right corner is at row , column is another window, in the third state.
Constraints
For all testdata, it is guaranteed that .
Notes
This problem is translated from COCI2011-2012 CONTEST #6 T2 PROZORI. Translation by @一扶苏一.
Translated by ChatGPT 5
京公网安备 11011102002149号