码迷,mamicode.com
首页 >  
搜索关键字:confusion matrix    ( 4333个结果
leetcode 之 Rotate Image
Rotate Image...
分类:其他好文   时间:2014-09-10 12:35:50    阅读次数:195
POJ 3233 Matrix Power Series --二分求矩阵等比数列和
题意:求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
Spiral Matrix II <leetcode>
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
[LeetCode] Set Matrix Zeros
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
[LeetCode] Spiral Matrix II
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
59. Spiral Matrix && Spiral Matrix II
思路: 可参考剑指offer:题20
分类:其他好文   时间:2014-09-09 10:26:28    阅读次数:250
[LeetCode] Search a 2D Matrix
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
poj 1838
F -BananaTime Limit:1000MSMemory Limit:30000KB64bit IO Format:%I64d & %I64uSubmitStatusDescriptionConsider a tropical forrest, represented as a matrix...
分类:其他好文   时间:2014-09-07 23:45:45    阅读次数:252
[LeetCode] Rotate Image
public class Solution { public void rotate(int[][] matrix) { int n=matrix.length; for (int i=0; i<n/2; i++) { for (int j=i...
分类:其他好文   时间:2014-09-07 14:42:05    阅读次数:159
Search a 2D Matrix <leetcode>
Write an efficient algorithm that searches for a value in anmxnmatrix. This matrix has the following properties:Integers in each row are sorted from l...
分类:其他好文   时间:2014-09-07 10:58:14    阅读次数:185
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!