文件名称:jvzhen
介绍说明--下载内容均来自于网络,请自行研究使用
Descr iption
给定一个r * c的只包含0和1两个数字的矩阵,对于矩阵中任意一点(x,y),定义(x,y)的权为(x,y)到与此点曼哈顿距离最小的1的曼哈顿距离(如果mat[x][y] = 1,则(x,y)的权为0)。请求出对于给定01矩阵中所有点的权值之和。
Input
输入包含多组数据,每组数据第一行为两个整数r, c(0 < r, c < = 1000)。
接下来 r 行每行有 c 个整数,且保证只能为0或者1(保证矩阵中含有至少一个1)。
Output
对于每组数据,输出一个整数,此矩阵中每个点的权之和。-Descr iption Given a r* c 1 contains only two digits 0 and the matrix, the matrix for any point (x, y), define (x, y) the right of (x, y) to the Manhattan distance to this point Manhattan distance of a minimum (if mat [x] [y] = 1, then (x, y) the right of 0). Request a 01 matrix for a given weight of all the points and. Input The input contains multiple sets of data, each data first act two integers r, c (0 < r, c < = 1000). Then there are r rows c integers per line, and to ensure that only 0 or 1 (to ensure that the matrix contains at least one 1). Output For each test case, output an integer, the matrix of rights and each point.
给定一个r * c的只包含0和1两个数字的矩阵,对于矩阵中任意一点(x,y),定义(x,y)的权为(x,y)到与此点曼哈顿距离最小的1的曼哈顿距离(如果mat[x][y] = 1,则(x,y)的权为0)。请求出对于给定01矩阵中所有点的权值之和。
Input
输入包含多组数据,每组数据第一行为两个整数r, c(0 < r, c < = 1000)。
接下来 r 行每行有 c 个整数,且保证只能为0或者1(保证矩阵中含有至少一个1)。
Output
对于每组数据,输出一个整数,此矩阵中每个点的权之和。-Descr iption Given a r* c 1 contains only two digits 0 and the matrix, the matrix for any point (x, y), define (x, y) the right of (x, y) to the Manhattan distance to this point Manhattan distance of a minimum (if mat [x] [y] = 1, then (x, y) the right of 0). Request a 01 matrix for a given weight of all the points and. Input The input contains multiple sets of data, each data first act two integers r, c (0 < r, c < = 1000). Then there are r rows c integers per line, and to ensure that only 0 or 1 (to ensure that the matrix contains at least one 1). Output For each test case, output an integer, the matrix of rights and each point.
(系统自动生成,下载前可以参看下载内容)
下载文件列表
jvzhen.c