#P3272. [SCOI2011] 地板

    ID: 2321 远端评测题 1000ms 125MiB 尝试: 0 已通过: 0 难度: 9 上传者: 标签>动态规划,dp2011四川O2优化广度优先搜索,BFS进制

[SCOI2011] 地板

Description

lxhgww’s nickname is “Little L” (Xiao L), because he always likes L-shaped things.

Little L’s living room is an r×cr\times c rectangle. He wants to cover the entire living room with L-shaped tiles. Some positions contain pillars and cannot be tiled.

Little L wants to know how many different ways there are to tile the living room using L-shaped tiles.

Note that, as shown in the figure below, the two arms of an L-shaped tile can have any positive lengths, but neither arm can have length 00.

After tiling, every position without a pillar must be covered by tiles, and no position may be covered more than once.

Input Format

The first line contains two integers, rr and cc, representing the size of the living room.

Then follow rr lines, each containing cc characters. Each character is either _ or *. _ indicates the position is empty and must be tiled; * indicates the position has a pillar and cannot be tiled.

Output Format

Output one line containing an integer: the number of tiling schemes. Since this number can be large, print the remainder when it is divided by 2011052020110520.

2 2
*_
__
1
3 3
 ___
 _*_
 ___
8

Hint

Constraints

Test point ID Limits
121\sim 2 1r×c251\le r\times c\le 25
353\sim 5 1r×c1001\le r\times c\le 100 and (r=2r=2 or c=2c=2)
6106\sim 10 1r×c1001\le r\times c\le 100

Translated by ChatGPT 5