KKT基本算法1002瓷砖
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
在一个W*h的矩形广场上,每一块1*1的地面都铺设了红色或黑色瓷砖。小林同学站在某一块黑色瓷砖上,他可以从此处出发,移动到上下左右四个相邻的且是黑色的瓷砖上。现在他想知道,通过重复上述移动所能经过的黑色瓷砖数。
Input Format
第一行为h、w,2<=w、h<=50,之间有一个空格隔开。
以下为一个w行h列的二维字符矩阵,每个字符为“.”“#”“@”分别表示该位置为黑色瓷砖、红色瓷砖、小林初始位置。
## Output Format输出一行一个整数,表示小林从出发位置可以经过的黑色瓷砖数量。
11 9
. # . . . . . . . . .
. # . # # # # # # # .
. # . # . . . . . # .
. # . # . # # # . # .
. # . # . . @ # . # .
. # . # # # # # . # .
. # . . . . . . . # .
. # # # # # # # # # .
. . . . . . . . . . .
59
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