题目大意:
解题思路:再调用一下别人的图。。。
#include
#include
using namespace std;
#define mod 1024struct Matrix{
int mat[2][2];
}a, b, tmp;
int n;void init() {
a.mat[0][0] = 5;
a.mat[0][1]...
分类:
其他好文 时间:
2015-05-19 19:09:58
阅读次数:
88
题目:Write an efficient algorithm that searches for a value in anmxnmatrix. This matrix has the following properties:Integers in each row are sorted fro...
分类:
其他好文 时间:
2015-05-19 18:08:14
阅读次数:
171
public class Solution { public void setZeroes(int[][] matrix) { if (matrix == null || matrix.length == 0 || matrix[0].length == 0) { ...
分类:
其他好文 时间:
2015-05-19 12:33:50
阅读次数:
134
解题思路:int型的注意,+= (a * b) % 9973时小心溢出了#include
#include
using namespace std;
#define maxn 10
#define mod 9973
typedef long long ll;
struct Matrix{
ll mat[maxn][maxn];
}a, b, tmp;
int...
分类:
其他好文 时间:
2015-05-19 10:46:29
阅读次数:
164
要主要的几个特殊的函数:1、构造函数,2、复制构造函数,3、拷贝构造函数//以上三个函数,会默认创建,但是当用户定义的时候会取消默认的创建。4、常对象的函数,5、可变对象的函数,//在对象变量可以变化的时候,只有5;在对象变量不变的时候,只有4,可以参考的代码: #ifndef MATRIX_H ....
分类:
编程语言 时间:
2015-05-19 07:10:36
阅读次数:
118
1 Rotate Image
You are given an n x n 2D matrix representing an image.Rotate the image by 90 degrees (clockwise).
对于 n x n 的矩阵按顺时针旋转90度,相当于先将矩阵上下翻转,然后将矩阵装置。void rotate(vector<vector>& matrix) {...
分类:
编程语言 时间:
2015-05-18 12:58:39
阅读次数:
139
Matrix Multiplication
Time Limit: 2000MS
Memory Limit: 65536K
Total Submissions: 17132
Accepted: 3732
Description
You are given three n × n matrices A, B and C. Does ...
分类:
其他好文 时间:
2015-05-18 09:07:56
阅读次数:
114
上次西安网络赛的题了
刚开始始终构造不出递推矩阵,后来想通了。。
当我们存放递推值的矩阵是竖条的时候,我们要把该矩阵放在乘法的右端,而横条的时候放在左端。。。根据矩阵乘法的原理,这样构造递推矩阵的时候就非常简单了,把对应值放上去就行了。。。
#include
#include
using namespace std;
typedef long long ll;
typedef vector...
分类:
其他好文 时间:
2015-05-18 09:05:31
阅读次数:
110
向量 = vector向量空间 = vector space两个向量空间 U, V 之间的线性变换,可以用 matrix 表示。如果 U 的维数是 m,V 的维数是 n,则 $T: U \rightarrow V$的矩阵形式是 $m \times n$。矩阵应该正确地理解为:两个向量空间之间的线性变...
分类:
其他好文 时间:
2015-05-17 20:10:55
阅读次数:
208
There is an integer matrix which has the following features:The numbers in adjacent positions are different.The matrix has n rows and m columns.For al...
分类:
其他好文 时间:
2015-05-17 14:58:30
阅读次数:
115