Buildings
来源:互联网 发布:铃声制作软件 编辑:程序博客网 时间:2024/05/01 22:09
Sample Input
2
2 2
1 1
0 0
3 3
1 0 1
0 0 1
1 1 0
Sample Output
2
2
2 2
1 1
0 0
3 3
1 0 1
0 0 1
1 1 0
Sample Output
2
5
import java.io.*;
import java.util.*;
public class PracticeIV {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int a = sc.nextInt();
while((a--)>0){
int n = sc.nextInt();
int m = sc.nextInt();
int[][] b = new int[n][m];
for(int i=0; i<n; i++){
for(int j=0; j<m; j++){
b[i][j] = sc.nextInt();
}
}
int count = 0;
for(int i=0; i<n; i++){
for(int j=0; j<m; j++){
if(b[i][j]==1)
count++;
}
}
System.out.println(count);
}
}
}
我这代码一直报:Memory Limit Exceeded
0 0
- Buildings
- Buildings
- Buildings
- Buildings
- Buildings
- Buildings
- Buildings
- Buildings
- Buildings
- Buildings
- Buildings
- HDU Buildings
- HDU2560:Buildings
- HDU4296--Buildings
- hdu4296 Buildings
- Buildings 2560
- HDU Buildings
- HDU Buildings
- 如何快速有效的将word转换PDF方法
- 数据库设计14个技巧
- linux服务器上生成CSR和KEY
- C# 运算符重载
- 算法导论(第三版) 第二章思考题
- Buildings
- 《C语言及程序设计》实践项目——函数起步
- C++学习笔记
- Linux下查看文件常用命令—cat,more,less,head,tail,od,file
- linux下生成core dump文件方法及设置
- vs2008下载地址大全
- 可复制文字的Label
- CentOS 6 安装 OpenCV 2
- 平衡树 算法摘记