Type: RemoteJudge 1000ms 125MiB

求细胞数量

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.

题目描述

一矩形阵列由数字 0099 组成,数字 1199 代表细胞,细胞的定义为沿细胞数字上下左右若还是细胞数字则为同一细胞,求给定矩形阵列的细胞个数。

输入格式

第一行两个整数代表矩阵大小 nnmm

接下来 nn 行,每行一个长度为 mm 的只含字符 09 的字符串,代表这个 n×mn \times m 的矩阵。

输出格式

一行一个整数代表细胞个数。

4 10
0234500067
1034560500
2045600671
0000000089

4

提示

数据规模与约定

对于 100%100\% 的数据,保证 1n,m1001 \le n,m \le 100

C23天河寒假作业2-基础数据结构

Not Claimed
Status
Done
Problem
14
Open Since
2024-1-30 0:00
Deadline
2024-3-31 23:59
Extension
24 hour(s)