遇到了小bug:R中矩阵相乘错误于A %*% B: 需要数值/复数矩阵/矢量参数看到网上别人的做法,发现了用class(A)和class(B)之后才发现,是因为读入的时候数据的类型不对,A、B的类型并不是matrix,才导致了这个问题。用as.matrix来变型一下,就OK了。
分类:
其他好文 时间:
2014-07-19 20:19:21
阅读次数:
731
一般 做这题之前应该先去做下 hdu的1003----这是 一维上的 最大连续和矩阵么 就是二维了嘛~我一开始 走进了个错误的方向... 我去计算了第X行前Y个数的和...这是不对的我们这里也同样用到了 前缀和的思想 但应该去计算前X个行第Y个数的和这样 假如 有个matrix[j][y] - ma...
分类:
其他好文 时间:
2014-07-16 17:57:52
阅读次数:
173
1、Drawable就是一个可画的对象,其可能是一张位图(BitmapDrawable),也可能是一个图形(ShapeDrawable),还有可能是一个图层(LayerDrawable),我们根据画图的需求,创建相应的可画对象
2、Canvas画布,绘图的目的区域,用于绘图
3、Bitmap位图,用于图的处理
4、Matrix矩阵
1、从资源中获取Bit...
分类:
其他好文 时间:
2014-07-16 16:41:17
阅读次数:
229
吃土豆时间限制:1000ms | 内存限制:65535KB难度:4描述Bean-eating is an interesting game, everyone owns an M*N matrix, which is filled with different qualities beans. Me...
分类:
其他好文 时间:
2014-07-16 12:01:49
阅读次数:
255
Matrix
Time Limit: 3000MS
Memory Limit: 65536K
Total Submissions: 17766
Accepted: 6674
Description
Given an N*N matrix A, whose elements are either 0 or 1. A[i, j] ...
分类:
其他好文 时间:
2014-07-15 12:24:44
阅读次数:
319
uva11992:http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&problem=3143题意:给你n*m的矩阵初始化的时候矩阵里面的元素全部是0,对于这个矩阵有3中操作。1...
分类:
其他好文 时间:
2014-07-13 22:35:03
阅读次数:
286
如果直接对矩阵元素进行二分查找的话,时间复杂度是O(m*n),其实很容易想到先通过查找找到对应可能存在于哪一行,然后再在那行中查找是否存在,采用最简单的直接查找这样时间复杂度仅有O(m+n),如果这两次查找再分别采用二分查找的话,时间复杂度更可以降低到O(logm+logn),下面是O(m+n)的代码:...
分类:
其他好文 时间:
2014-07-13 18:50:21
阅读次数:
228
Matrix Chain Multiplication
Suppose you have to evaluate an expression like A*B*C*D*E where A,B,C,D and E are matrices. Since matrix multiplication is associative, the order in which multi...
分类:
其他好文 时间:
2014-07-13 18:10:40
阅读次数:
223
Given an integer n, generate a square matrix filled with elements from 1 to n2 in
spiral order.
For example,
Given n = 3,
You should return the following matrix:
[
[ 1, 2, 3 ],
[ 8, 9, 4 ],
[...
分类:
其他好文 时间:
2014-07-13 16:37:16
阅读次数:
199
Sum
Time Limit: 2000/1000MS (Java/Others) Memory Limit: 128000/64000KB (Java/Others)
SubmitStatus
Problem Description
You are given an N*N digit matrix and you can get several horizontal o...
分类:
其他好文 时间:
2014-07-12 21:17:15
阅读次数:
182