时间限制:0.25s空间限制:4MSolution n=10000,m=100000,显然不能用矩阵乘法乘出来。 S= ATA 对于矩阵S的一行,所有在A矩阵中1位置的元素都相等,并且都等于这一行1的个数之和。假设有k个1,这一行的和显然是k*k 由此只要统计每一行有多...
分类:
其他好文 时间:
2014-09-10 19:11:00
阅读次数:
162
总目录:http://blog.csdn.net/iloveas2014/article/details/38304477
4.3.1 ColorMatrixFilter与ColorTransform的功能比较
如果说ColorTransform是田忌的加减法,那么ColorMatrixFilter就是孙膑的乘法了。所以,ColorMatrixFilter与Matrix变...
分类:
其他好文 时间:
2014-09-10 17:55:30
阅读次数:
158
题意:求S(k) = A+A^2+...+A^k.解法:二分即可。if(k为奇) S(k) = S(k-1)+A^kelse S(k) = S(k/2)*(I+A^(k/2))代码:#include #include #include #include #define SMod musing ...
分类:
其他好文 时间:
2014-09-09 12:28:28
阅读次数:
199
Given an integern, generate a square matrix filled with elements from 1 ton2in spiral order.For example,Givenn=3,You should return the following matri...
分类:
其他好文 时间:
2014-09-09 11:38:08
阅读次数:
204
1 public class Solution { 2 public void setZeroes(int[][] matrix) { 3 int m=matrix.length; 4 int n=matrix[0].length; 5 bo...
分类:
其他好文 时间:
2014-09-09 10:38:48
阅读次数:
203
1 public class Solution { 2 public int[][] generateMatrix(int n) { 3 int num=1; 4 int [][] result = new int[n][n]; 5 6 ...
分类:
其他好文 时间:
2014-09-09 10:27:58
阅读次数:
206
public class Solution { public boolean searchMatrix(int[][] matrix, int target) { int low=0, high=matrix.length-1; while (low target)...
分类:
其他好文 时间:
2014-09-08 00:58:06
阅读次数:
347
F -BananaTime Limit:1000MSMemory Limit:30000KB64bit IO Format:%I64d & %I64uSubmitStatusDescriptionConsider a tropical forrest, represented as a matrix...
分类:
其他好文 时间:
2014-09-07 23:45:45
阅读次数:
252