标签:ack indent span arc arch neu hit gif nsf
? 矩阵上的问题(3题)
public int searchMatrix(int[][] matrix, int target) { // write your code here int n = matrix.length; if (n == 0) { return 0; } int m = matrix[0].length; if (m == 0) { return 0; } int i = n - 1; int j = 0; int res = 0; while (i >= 0 && j < m) { if (matrix[i][j] == target) { res++; i--; j++; } else if (matrix[i][j] > target) { i--; } else { j++; } } return res; }
? 高精度运算(4题)
? 快速幂(1题)
标签:ack indent span arc arch neu hit gif nsf
原文地址:http://www.cnblogs.com/whesuanfa/p/7795923.html