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

建议使用的浏览器:

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

4029:Distinct Sub-matrix

题目描述
In this problem, let us consider an N*M matrix of capital letters. By selecting consecutive columns and rows, we can define the sub-matrix as the elements on chosen columns and rows.
Two sub-matrices should be regarded the same if and only if they have the same dimensions and characters (which, of course, are capital letters) on corresponding position. It is your task to find the number of distinct sub-matrices of a given letter matrix.
输入解释
The input contains a lot of test cases. The first line of input contains exactly one integer, indicating the number of test cases.
  For each of the test case, the first line contains two integers N and M, denoting the number of rows and columns of the given matrix. (1 <= N, M <= 128)
  The next N lines contain only capital letters, indicating the given matrix.
输出解释
For each test case, output a single integer denoting the number of distinct sub-matrices.
输入样例
2
2 2
AB
BA
3 3
ABA
BAA
AAA
输出样例
Case #1: 7
Case #2: 22
来自杭电HDUOJ的附加信息
Recommend lcy

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

源链接: HDU-4029

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

共提交 0

通过率 --%
时间上限 内存上限
10000/5000MS(Java/Others) 165768/165768K(Java/Others)