当前你的浏览器版本过低,网站已在兼容模式下运行,兼容模式仅提供最小功能支持,网站样式可能显示不正常。
请尽快升级浏览器以体验网站在线编辑、在线运行等功能。

建议使用的浏览器:

谷歌Chrome 火狐Firefox Opera浏览器 微软Edge浏览器 QQ浏览器 360浏览器 傲游浏览器

2560:Buildings

题目描述
We divide the HZNU Campus into N*M grids. As you can see from the picture below, the green grids represent the buidings. Given the size of the HZNU Campus, and the color of each grid, you should count how many green grids in the N*M grids.

输入解释
Standard input will contain multiple test cases. The first line of the input is a single integer T which is the number of test cases. T test cases follow.
The first line of each test case contains two integers n and m(1<=n,m<=100), the size of the campus. Then follow n lines, each line containing m integers. The j-th integer in the i-th line is the color of that grid, 0 stands for white color, while 1 stands for green.

输出解释
Results should be directed to standard output. For each case, output an integers T, the total green grids in the N*M size campus.
输入样例
2
2 2
1 1
0 0
3 3
1 0 1
0 0 1
1 1 0
输出样例
2
5
来自杭电HDUOJ的附加信息
Recommend lcy

该题目是Virtual Judge题目,来自 杭电HDUOJ

源链接: HDU-2560

最后修改于 2020-10-25T22:54:39+00:00 由爬虫自动更新

共提交 18

通过率 50.0%
时间上限 内存上限
2000/1000MS(Java/Others) 32768/32768K(Java/Others)