Write an efficient algorithm that searches for a value in an m x n matrix. This matrix has the following properties: Integers in each row are sorted i ...
分类:
其他好文 时间:
2018-03-03 21:52:21
阅读次数:
185
spoj 104 Highways 生成树计数,matrix-tree定理的应用。 Matrix-tree定理: D为无向图G的度数矩阵(D[i][i]是i的度数,其他的为0),A为G的邻接矩阵(若u,v之间存在边,A[u][v]=A[v][u]=1),C=D-A。 对于一个无向图G,它的生成树个数 ...
分类:
其他好文 时间:
2018-03-03 21:21:01
阅读次数:
156
#include <iostream>#include <string>#include <cstdio>using namespace std; #define MaxVnum 50typedef double A_Matrix[MaxVnum][MaxVnum];typedef struct{ ...
分类:
编程语言 时间:
2018-03-03 18:16:12
阅读次数:
129
开始没看到要求对角线以外的地方不能是0,以为是个xx题。。。照着题解思路写的,很妙啊 题意:给定01矩阵 求矩阵中最长的只有对角线是1的正方形的对角线长度 x[i][j]从(i,j)向左/右(不包括(i,j))的连续的0的数量 y[i][j]从(i,j)向上(不包括(i,j))的连续的0的数量 1 ...
分类:
其他好文 时间:
2018-03-03 14:12:51
阅读次数:
159
A museum was represented by a square matrix that was filled with O, G, and W where O represented open space, G represented guards, and W represented w ...
分类:
其他好文 时间:
2018-03-02 10:23:10
阅读次数:
189
如果不谈证明,稍微有点线代基础的人都可以在两分钟内学完所有相关内容。。 行列式随便找本线代书看一下基本性质就好了。 学习资源: https://www.cnblogs.com/candy99/p/6420935.html http://blog.csdn.net/Marco_L_T/article/ ...
分类:
其他好文 时间:
2018-02-28 01:08:12
阅读次数:
1486
AC自动机+矩阵乘法 套路$dp$,也就是从$root$开始走n步不经过危险节点 这不就是经典的倍增$floyd$吗,trie图是有向图 AC自动机真是个奇怪的东西,不能识别的子串都属于根节点 #include <cstdio> #include <cstring> #include <algori ...
分类:
其他好文 时间:
2018-02-27 21:20:57
阅读次数:
202
题目链接 "51nod 1462" 题目描述 给一颗以1为根的树。 每个点有两个权值:vi, ti,一开始全部是零。 Q次操作: 读入o, u, d o = 1 对u到根上所有点的vi += d o = 2 对u到根上所有点的ti += vi d 最后,输出每个点的ti值(n, Q include ...
分类:
其他好文 时间:
2018-02-27 12:46:40
阅读次数:
174
We are stacking blocks to form a pyramid. Each block has a color which is a one letter string, like `'Z'`. For every block of color `C` we place not i ...
分类:
其他好文 时间:
2018-02-27 01:10:41
阅读次数:
459
一、tensorflow官方文档内容 Defined in tensorflow/python/ops/array_ops.py. See the guides: Math > Matrix Math Functions, Tensor Transformations > Slicing and J ...
分类:
其他好文 时间:
2018-02-26 23:21:35
阅读次数:
734