八连块
You cannot submit for this problem because the contest is ended. You can click "Open in Problem Set" to view this problem in normal mode.
Description
输入一个m行n列的字符矩阵,统计字符“@”组成多少个八连块。如果两个字符“@”所在的格子相邻(横竖或者对角线方向),就说它们属于同一个八连块。例如,下图中有两个八连块。

Input Format
第一行包括两个正整数m和n,由空格隔开,接下来的m行,每行n个字符,字符只包括“*”和“@”。
Output Format
一个自然数,表示八连块的个数。
5 5
****@
*@@*@
*@**@
@@@*@
@@**@
2
Hint
数据范围:0<m,n<101
2025ACM寒假实训周-dfs算法训练-2
- Status
- Done
- Rule
- XCPC
- Problem
- 8
- Start at
- 2025-3-13 22:45
- End at
- 2025-3-14 0:45
- Duration
- 2 hour(s)
- Host
- Partic.
- 9