矩阵距离
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.
题目描述
给定一个 行 列的 矩阵 , 与 之间的曼哈顿距离定义为:
求一个与矩阵 大小相同的矩阵 ,其中:
$$B[i][j]=\min_{1 \le x \le N,1 \le y \le M,A[x][y]=1} dist(A[i][j],A[x][y]) $$输入格式
第一行,两个整数 ,中间用一个空格隔开。 随后有 行,每行 个数,表示矩阵 。
输出格式
行,每行 个数,表示矩阵 。
样例
3 4
0001
0011
0110
3 2 1 0
2 1 0 0
1 0 0 1
提示
。
C23暑假作业3-搜索-基础题
- Status
- Done
- Problem
- 20
- Open Since
- 2024-7-5 0:00
- Deadline
- 2024-10-27 23:59
- Extension
- 24 hour(s)