九度oj 1001题 题目很纠结,但是很有意思
2013-09-15 22:02
281 查看
今天开始做九度oj上的题了,觉得还蛮有意思的。也是,因为从今天开始,我决定了一件事情,决定要考研了。本来纠结一个星期的,现在终于想通了,也许现在就应该好好的静下心来好好看书和写程序了。不管怎样,这是自己决定的事。
话说今天在九度oj上做了三道题,感觉蛮好玩的,有些事情是我们在以前编程的时候从来不会考虑到的,比如时时间问题,比如内存问题,我们以前在做程序的时候,从来不考虑这些东西,但是做oj上的题时,不考虑的话就不能ac了。但实际上我现在也没有考虑,多是一些其他的问题导致我不能ac。比如当用到开关flag时,每次在用之前都要先还原一下,否则继续用的话会导致有些测试案例不能ac。还有就是规范问题,总是感觉visual c++的规范好难看啊,如果以现在的用户体验来看待这个问题的话,visual
c++ 6.0编译器简直就是跌倒渣了啊。所以现在改用codeblocks,开源工具。做的蛮好。
下面贴下我在九度oj上的第1001道题目:
题目描述:
This time, you are supposed to find A+B where A and B are two matrices, and then count the number of zero rows and columns.
输入:
The input consists of several test cases, each starts with a pair of positive integers M and N (≤10) which are the number of rows and columns of the matrices, respectively. Then 2*M lines follow, each contains N integers
in [-100, 100], separated by a space. The first M lines correspond to the elements of A and the second M lines to that of B.
The input is terminated by a zero M and that case must NOT be processed.
输出:
For each test case you should output in one line the total number of zero rows and columns of A+B.
样例输入:
样例输出:
话说今天在九度oj上做了三道题,感觉蛮好玩的,有些事情是我们在以前编程的时候从来不会考虑到的,比如时时间问题,比如内存问题,我们以前在做程序的时候,从来不考虑这些东西,但是做oj上的题时,不考虑的话就不能ac了。但实际上我现在也没有考虑,多是一些其他的问题导致我不能ac。比如当用到开关flag时,每次在用之前都要先还原一下,否则继续用的话会导致有些测试案例不能ac。还有就是规范问题,总是感觉visual c++的规范好难看啊,如果以现在的用户体验来看待这个问题的话,visual
c++ 6.0编译器简直就是跌倒渣了啊。所以现在改用codeblocks,开源工具。做的蛮好。
下面贴下我在九度oj上的第1001道题目:
题目描述:
This time, you are supposed to find A+B where A and B are two matrices, and then count the number of zero rows and columns.
输入:
The input consists of several test cases, each starts with a pair of positive integers M and N (≤10) which are the number of rows and columns of the matrices, respectively. Then 2*M lines follow, each contains N integers
in [-100, 100], separated by a space. The first M lines correspond to the elements of A and the second M lines to that of B.
The input is terminated by a zero M and that case must NOT be processed.
输出:
For each test case you should output in one line the total number of zero rows and columns of A+B.
样例输入:
2 2 1 1 1 1 -1 -1 10 9 2 3 1 2 3 4 5 6 -1 -2 -3 -4 -5 -6 0
样例输出:
1 5
相关文章推荐
- 九度OJ题目1001:A+B for Matrices
- 【九度OJ】题目1001:A+B for Matrices
- 九度OJ题目1001:A+B for Matrices
- 九度OJ题目1001:A+B for Matrices
- 九度OJ 题目1001:A+B for Matrices
- 九度OJ-题目1283:第一个只出现一次的字符
- 九度OJ 1001
- 【九度OJ】题目1173:查找 解题报告
- 九度OJ-题目1020 最小长方形
- 【九度OJ】题目1187:最小年龄的3个职工 解题报告
- 【九度OJ】题目1191:矩阵最大值 解题报告
- 【九度OJ】题目1073:杨辉三角形 解题报告
- 九度oj 题目1174:查找第K小数(sort的使用)
- 九度OJ-题目1169:比较奇偶数个数-10计院上机A
- 九度OJ-题目1008 最短路径问题
- 九度 OJ 之 题目1538:GrassLand密码
- 九度OJ 题目1029:魔咒词典
- 题目1096:日期差值 九度OJ
- <C/C++练习>九度OJ题目1101--1150解题练习(四)
- 九度OJ 1525 子串逆序打印 -- 2012年Google校园招聘笔试题目