"传送门" 发现最多只有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
看题的时候发现了libnum库,觉得还行,mark下来留着以后用。0x00libnum库是一个关于各种数学运算的函数库,它包含commonmaths、modular、modularsqureroots、primes、factorization、ECC、converting、stuff等方面的函数,使计算变得非常简便。0x01安装Linux:gitclonehttps://github.com/he
分类:
其他好文 时间:
2018-11-28 17:29:46
阅读次数:
633
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
题目大意 链接: "CF960G" 给定正整数$n$,表示有$1\sim n$个元素,求有多少种全排列满足: 从左往右按贪心原则去最大值,共取出$a$个元素;从右往左按贪心原则去最大值,共取出$b$个元素。 答案对$998244353$取模,数据满足$1\leq n\leq 10^5,1\leq a ...
分类:
其他好文 时间:
2018-11-25 23:59:22
阅读次数:
381
给予一个矩阵,矩阵有1有0,计算每一个1到0需要走几步,只能走上下左右。 解法一: 利用dp,从左上角遍历一遍,再从右下角遍历一遍,dp存储当前位置到0的最短距离。 十分粗心的搞错了col和row,改了半天………… Runtime: 132 ms, faster than 98.88% of C++ ...
分类:
其他好文 时间:
2018-11-25 20:08:49
阅读次数:
181