这道题是一个二维树状数组,思路十分神奇,其实还是挺水的 题目描述 给定一个N?NN?N的矩阵AA,其中矩阵中的元素只有0或者1,其中A[i,j]A[i,j]表示矩阵的第i行和第j列(1≤i,j≤N)(1≤i,j≤N),初始矩阵元素都是0。在矩阵上进行TT次操作,操作有以下两种: (1)格式为C?x1 ...
分类:
编程语言 时间:
2018-12-02 12:09:21
阅读次数:
246
Given two sparse matrices A and B, return the result of AB. You may assume that A's column number is equal to B's row number. Example: Input: A = [ [ ...
分类:
其他好文 时间:
2018-12-02 10:32:42
阅读次数:
172
Given a matrix consists of 0 and 1, find the distance of the nearest 0 for each cell. The distance between two adjacent cells is 1. Example 1: Input: ...
分类:
其他好文 时间:
2018-12-01 21:50:58
阅读次数:
198
"传送门" 发现最多只有20行,所以开20个线段树处理即可。当然存在更优的做法,就是一行接着一行,变成一个线段树,节省空间。 cpp include include include define MAXN 1000006 define lson (rt 1) define sizel (((l+r) ...
分类:
其他好文 时间:
2018-12-01 20:22:17
阅读次数:
194
from sklearn.metrics import confusion_matrix from sklearn.metrics import accuracy_score from sklearn.metrics import classification_report # accuracy_s... ...
分类:
其他好文 时间:
2018-12-01 20:12:35
阅读次数:
149
Given a 2D grid, each cell is either a wall 'W', an enemy 'E' or empty '0' (the number zero), return the maximum enemies you can kill using one bomb.?... ...
分类:
其他好文 时间:
2018-11-29 10:55:31
阅读次数:
74
今天看了个题目很有意思,原型在https://leetcode.com/articles/spiral-matrix/ 摘要如下: Given a matrix of m x n elements (m rows, n columns), return all elements of the mat ...
分类:
Web程序 时间:
2018-11-28 20:32:58
阅读次数:
184
Overview: Matrix algebra Matrix algebra covers rules allowing matrices to be manipulated algebraically via addition, subtraction, multiplication and d ...
分类:
其他好文 时间:
2018-11-28 12:20:13
阅读次数:
219
Canvas的几何变换是倒序的,Matrix是正序。 比如先平移在旋转: canvas.rotate(); canvas.translate(); //translate先执行,rotate后执行 Matrix里面就好比维护者一个双端队列,当调用preXxx方法时,将该方法放入队列的顶端,(即每来一 ...
分类:
其他好文 时间:
2018-11-27 17:06:17
阅读次数:
259
reference:http://www.mathworks.com/help/matlab/ref/mex.html .MEX文件是一种可在matlab环境中调用的C(或fortran)语言衍生程序,MEX文件的后缀名按32位/64位分别为 .mexw32/.mexw64。MEX文件是由C或For ...
分类:
其他好文 时间:
2018-11-27 11:13:51
阅读次数:
977