当前你的浏览器版本过低,网站已在兼容模式下运行,兼容模式仅提供最小功能支持,网站样式可能显示不正常。
请尽快升级浏览器以体验网站在线编辑、在线运行等功能。

建议使用的浏览器:

谷歌Chrome 火狐Firefox Opera浏览器 微软Edge浏览器 QQ浏览器 360浏览器 傲游浏览器

5079:Square

题目描述
Nothing is more beautiful than square! So, given a grid of cells, each cell being black or white, it is reasonable to evaluate this grid’s beautifulness by the side length of its maximum continuous subsquare which fully consists of white cells.

Now you’re given an N × N grid, and the cells are all black. You can paint some cells white. But other cells are broken in the sense that they cannot be paint white. For each integer i between 0 and N inclusive, you want to find the number of different painting schemes such that the beautifulness is exactly i. Two painting schemes are considered different if and only if some cells have different colors. Painting nothing is considered to be a scheme.


For example, N = 3 and there are 4 broken cells as shouwn in Fig. J(a). There are 2 painting schemes for i=2 as shown in Fig. J(b) and J(c).

You just need to output the answer modulo 109 + 7.
输入解释
The first line contains an integer T (T ≤ 10) denoting the number of the test cases.

For each test case, the first line contains an integer N (1 ≤ N ≤ 8), denoting the size of the grid is N × N . Then N lines follow, each line containing an N-character string of “o” and “*”, where “o” stands for a paintable cell and “*” for a broken cell.
输出解释
For each test case, for each integer i between 0 and N inclusive, output the answer in a single line.
输入样例
2
3
oo*
ooo
***
8
oooooooo
oooooooo
oooooooo
oooooooo
oooooooo
oooooooo
oooooooo
oooooooo
输出样例
1
29
2
0
1
401415247
525424814
78647876
661184312
550223786
365317939
130046
1
来自杭电HDUOJ的附加信息
Recommend liuyiding

该题目是Virtual Judge题目,来自 杭电HDUOJ

源链接: HDU-5079

最后修改于 2020-10-25T23:19:34+00:00 由爬虫自动更新

共提交 0

通过率 --%
时间上限 内存上限
24000/12000MS(Java/Others) 262144/262144K(Java/Others)