给定一个矩阵matrix, 按照“之” 字形的方式打印这个矩阵, 例如: 1 2 3 4 5 6 7 8 9 10 11 12“之” 字形打印的结果为: 1, 2, 5, 9, 6, 3, 4, 7, 10, 11,8, 12【要求】 额外空间复杂度为O(1)。 ...
分类:
其他好文 时间:
2018-04-08 18:15:58
阅读次数:
125
使用numpy时,跟matlab不同: 1、* dot() multiply() 对于array来说,* 和 dot()运算不同 *是每个元素对应相乘 dot()是矩阵乘法 对于matrix来说,* 和 multiply() 运算不同 * 是矩阵乘法 multiply() 是每个元素对应相乘 A B ...
分类:
其他好文 时间:
2018-04-07 17:48:14
阅读次数:
1340
一.混淆矩阵 (一).简介 在人工智能中,混淆矩阵(confusion matrix)是可视化工具,特别用于监督学习,在无监督学习一般叫做匹配矩阵。在图像精度评价中,主要用于比较分类结果和实际测得值,可以把分类结果的精度显示在一个混淆矩阵里面。混淆矩阵是通过将每个实测像元的位置和分类与分类图像中的相 ...
分类:
其他好文 时间:
2018-04-07 17:42:07
阅读次数:
862
A matrix is Toeplitz if every diagonal from top-left to bottom-right has the same element. Now given an M x N matrix, return True if and only if the m ...
分类:
其他好文 时间:
2018-04-07 01:12:40
阅读次数:
395
本文以csr_matrix为例来说明sparse矩阵的使用方法,其他类型的sparse矩阵可以参考https://docs.scipy.org/doc/scipy/reference/sparse.html csr_matrix是Compressed Sparse Row matrix的缩写组合,下 ...
分类:
编程语言 时间:
2018-04-04 23:34:52
阅读次数:
298
第二类斯特林数$\left\{\begin{matrix}n\\m\end{matrix}\right\}$表示把含有$n$个不同的数的集合划分为$m$个非空子集的方案数 递推式$\left\{\begin{matrix}n\\m\end{matrix}\right\}=m\left\{\begin ...
分类:
其他好文 时间:
2018-04-03 22:16:39
阅读次数:
206
"原题链接" 描述 相信大家都会做两个整数的 A+B 了,今天我们把它扩展到矩阵,如果给你两个 N M 的矩阵,你会做么? 输入描述 第一行一个数 C(1 0) { int n, m; Matrix a = new Matrix(); Matrix b = new Matrix(); Matrix ...
分类:
其他好文 时间:
2018-03-31 17:26:29
阅读次数:
171
题面: 传送门 思路: 看一眼这个公式: $x\left[n+1\right]=\left(a\ast x\left[n\right]+c\right) mod m$ 递推,数据范围$n\leq 10^18$,自然想到矩阵快速幂 构造如下矩阵: 状态矩阵: $\begin{bmatrix}x\lbr ...
分类:
其他好文 时间:
2018-03-31 13:22:05
阅读次数:
205
4753: Lydsy2351 Matrix Description 给定一个M行N列的01矩阵,以及Q个A行B列的01矩阵,你需要求出这Q个矩阵哪些在原矩阵中出现过。所谓01矩阵,就是矩阵中所有元素不是0就是1。 Input 输入文件的第一行为M、N、A、B,参见题目描述。接下来M行,每行N个字符 ...
分类:
其他好文 时间:
2018-03-31 00:48:40
阅读次数:
228
矩阵快速幂 按列递推 cpp include include include include include include define ll long long using namespace std; const int MOD = 10000007; int n, m; struct Mat ...
分类:
其他好文 时间:
2018-03-30 21:42:54
阅读次数:
127