/ OPS / 题库 /

座位安排

座位安排

#描述#
Elly and some of her friends (possibly none) are going to the movies. Their company consists of N people, including Elly. Since they don't want to be spread across the entire hall, they decided to sit either in the same row or in the same column (though not necessarily next to one another).
<BR>
<BR>
Your are given a matrix M consisting of char representing the layout of seats in the theater that are already taken. The M[i][j] will be '#' if the seat at row i, column j is already taken and '.' if it is empty.

<BR>
<BR>
calculate the number of different ways for Elly and her friends to choose N different empty seats so that their seating requirement is fulfilled. Two ways are considered different if there exists a person in their company that will sit in different seats in these two ways.

#格式#
##输入格式##
Multi testcase.
For every case ,there will be three integer N,R,C(1&lt=N&lt=8,1&lt=R,C&lt=50)represent the number of people and rows, columns of the char matrix. Then a R*C char matrix.

##输出格式##
The number of different ways

#样例1#
##样例输入1##

3 2 3
#..
...
2 3 3
..#
.##
...

##样例输出1##

6
16

#限制#
1000ms
32768KB

#提示#

#来源#

信息

ID
1779
难度
5
分类
category1 点击显示
标签
递交数
0
已通过
0
通过率
?
上传者