1768. Password in Rectangle

单点时限: 2.0 sec

内存限制: 256 MB

The famous thief―Kid has encountered a problem when he wanted to steal a diamond ring. He would get the important password after solving that problem. However, he has tried his best to solve the problem, but failed. Kid needs help with that problem, could you help him, or you won’t, as he is a thief?

输入格式

However, the problem was like this: Give you a rectangle with m*n letters (0<m, n<=100) and 6 different words, you should find out how many times each word has appeared in that rectangle. The matching can be done in any of the eight directions either horizontally, vertically or diagonally through the grid. Upper and lower case of the same letter are considered same. Words start with different points should be considered different.

输出格式

Please output the times, that’s the password.

样例

Input
8 11
abcDEFGhigg
hEbkWalDork
FtyAwaldORm
FtsimrLqsrc
byoArBeDeyv
Klcbqwikomk
strEBGadhrb
yUiqlxcnBjf
Abcd
Waldorf
Bambi
STR
Betty
Dagbert
Output
1 1 1 1 1 1

13 人解决,27 人已尝试。

18 份提交通过,共有 66 份提交。

6.4 EMB 奖励。

创建: 17 年,1 月前.

修改: 7 年,2 月前.

最后提交: 6 年,3 月前.

来源: 成都赛区选拔赛

题目标签