![](https://img-blog.csdnimg.cn/20201014180756922.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
数论
zg轩
你要知道什么是自己想要的,知道什么是不可逆转的,知道用什么方式实现梦想,知道用什么心情面对苦难,人就在转瞬间感悟,进退得失不离不弃也就有了答案。我不知道命运会把我带到何方,但是我会一直用善良维护其左右
展开
-
如何用牛顿迭代法求平方根
设函数y=f(x)在点x0的某个邻域内有定义,当自变量x在x0处有增量Δx,(x0+Δx)也在该邻域内时,相应地函数取得增量Δy=f(x0+Δx)-f(x0);如果Δy与Δx之比当Δx→0时极限存在,则称函数y=f(x)在点x0处可导,并称这个极限为函数y=f(x)在点x0处的导数记作①f’(x0) ;②y’│x=x0 ;③ │x=x0, 即 导函数 如果函数y=f(x)在开区间内每一点都可导,...原创 2019-02-06 11:23:44 · 5190 阅读 · 0 评论 -
leetcode 507 完美数
题目: We define the Perfect Number is a positive integer that is equal to the sum of all its positive divisors except itself. Now, given an integer n, write a function that returns true when it is a per...原创 2019-02-06 19:24:58 · 235 阅读 · 0 评论 -
leetcode 4 求两个有序数组的中位数
题目: There are two sorted arrays nums1 and nums2 of size m and n respectively. Find the median of the two sorted arrays. The overall run time complexity should be O(log (m+n)). You may assume nums1 and...原创 2019-02-07 11:18:14 · 72 阅读 · 0 评论 -
矩阵快速幂
1.基础知识储备篇 矩阵的相关运算会再线性代数中学到。 1.1矩阵的定义: N阶方阵(N阶矩阵):行数m与列数n相同的矩阵,如下图所示就是一个44的方阵:* 行矩阵(行向量):只有一行的矩阵,下图就是一个行矩阵: 列矩阵(列向量):只有一列的矩阵,下图就是一个列矩阵: 同型矩阵:设先有矩阵A和矩阵B,矩阵A的行数与列数和矩阵B的相同,则矩阵A、B是同型矩阵。 单位矩阵:在矩阵的乘法...原创 2019-02-07 20:32:05 · 129 阅读 · 0 评论 -
约数个数定理及其模板
原题目: 输入n个整数,依次输出每个数的约数的个数,输入0表示输入结束 定理介绍及其证明, 对于一个大于1正整数n可以分解质因数: 则n的正约数的个数就是 。 其中a1、a2、a3…ak是p1、p2、p3,…pk的指数。 证明:首先同上,n可以分解质因数:n=p1a1×p2a2×p3a3*…*pkak, 由约数定义可知p1a1的约数有:p10, p1^1, p12…p1a1 ,共(a1+1)个;...原创 2019-02-09 08:16:04 · 536 阅读 · 0 评论