Merge k sorted linked lists and return it as one sorted list. Analyze and describe its complexity. 同378. Kth Smallest Element in a Sorted Matrix ...
分类:
其他好文 时间:
2017-07-28 15:42:05
阅读次数:
124
题目 OvO click here http://acm.hdu.edu.cn/showproblem.php?pid=6052 解 分开考虑每种颜色 pre[i][j]代表第j列最近一个i颜色的行数,ppre是次近 calcu(li,ji,x,y,clr)表示从col=li到col=ri,计算(x ...
分类:
其他好文 时间:
2017-07-28 14:45:44
阅读次数:
339
筛素数 void shai() { no[1]=true;no[0]=true; for(int i=2;i<=r;i++) { if(!no[i]) p[++p[0]]=i; int j=1,t=i*p[1]; while(j<=p[0] && t<=r) { no[t]=true; if(i%p ...
分类:
其他好文 时间:
2017-07-28 13:30:31
阅读次数:
163
Data Frame一般被翻译为数据框,感觉就像是R中的表,由行和列组成,与Matrix不同的是,每个列可以是不同的数据类型,而Matrix是必须相同的。 Data Frame每一列有列名,每一行也可以指定行名。如果不指定行名,那么就是从1开始自增的Sequence来标识每一行。 初始化 使用dat ...
分类:
编程语言 时间:
2017-07-28 11:07:21
阅读次数:
194
Consider a tropical forrest, represented as a matrix. The cell from the right top corner of the matrix has the coordinates (1,1), and the coordinates ...
分类:
其他好文 时间:
2017-07-27 20:04:31
阅读次数:
350
https://leetcode.com/problems/set-matrix-zeroes/tabs/description Given a m x n matrix, if an element is 0, set its entire row and column to 0. Do it i ...
分类:
其他好文 时间:
2017-07-27 18:24:57
阅读次数:
214
最近打算用Delphi写软件播放器,主要是界面问题,如果用Delphi控件来做界面,那实在是太麻烦了。所以最后决定用Delphi结合HTML来做,主要用到的是Delphi的webbrower来做,这样做的速度可能是原来的10倍,还不止。不过还是要写播放器方面的UI的,希望早日做好吧。用空还是要把ht ...
题意:求A + A^2 + A^3 + ... + A^m。 析:主要是两种方式,第一种是倍增法,把A + A^2 + A^3 + ... + A^m,拆成两部分,一部分是(E + A^(m/2))(A + A^2 + A^3 + ... + A^(m/2)),然后依次计算下去,就可以分解,logn ...
分类:
其他好文 时间:
2017-07-27 12:43:27
阅读次数:
159
Given a m-by-n (0,1)-matrix, of all its submatrices of all 1’s which is the largest? By largest we mean that the submatrix has the most elements. Inpu ...
分类:
其他好文 时间:
2017-07-26 14:40:25
阅读次数:
135
代码两分钟...证明2小时(雾 这道题简单来说就是:要想很久但是代码一下子就能打完... 首先看数据范围猜算法系列--猜不出来... 接着看题...求生成树数目,转向百度,得到一个叫做matrix tree定理的东西...看完一脸懵啊...不会写... 算了既然点开还是写一写吧... 突然发现不用这 ...
分类:
其他好文 时间:
2017-07-26 01:56:25
阅读次数:
138