#P3170. [CQOI2015] 标识设计
[CQOI2015] 标识设计
Description
A company abbreviated as LLL is designing a logo. Their initial plan is to place L-shaped patterns and some extra decorative shapes on a square grid, for example:
(the gray area denotes decorative shapes).
The L-shaped patterns and the decorative shapes are all placed on the grid, and together they must cover the entire grid. The horizontal and vertical strokes of each L may have any positive length, but each length must be greater than (i.e., an L cannot degenerate into a straight line segment). In addition, to keep the L patterns clear and recognizable, the L-shaped patterns must not overlap or cross each other. Of course, an L-shaped pattern also cannot pass through or overlap any decorative shape.
Now that the designer has fixed the positions of all decorative shapes, please compute how many different logos can be designed by placing the L-shaped patterns.
Input Format
The first line contains two space-separated positive integers and , the numbers of rows and columns of the grid.
The next lines each contain characters. In the -th line, the -th character denotes the cell at row , column . Each character is either . or #. # means the cell is a decorative shape, and . means it is an empty cell where an L-shaped pattern may be placed.
Output Format
Output a single integer, the total number of possible logos.
4 4
....
#...
....
..#.
4
Hint
Constraints
For of the testdata, .
Translated by ChatGPT 5
京公网安备 11011102002149号