![](https://img-blog.csdnimg.cn/20201014180756925.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
快速幂
leibniz_zhang
欢天喜地小企鹅
展开
-
hdoj 4506 小明系列故事——师兄帮帮忙<二分求幂>
E - 快速幂Time Limit:1000MS Memory Limit:32768KB 64bit IO Format:%I64d & %I64uSubmit StatusDescription 小明自从告别了ACM/ICPC之后,就开始潜心研究数学问题了,一则可以为接下来的考研做准备,再者可以借此机会帮助一些同学,尤其是漂亮的师妹。这不,班里唯一的女原创 2016-04-19 07:42:35 · 335 阅读 · 0 评论 -
POJ - 3641 Pseudoprime numbers <快速幂加素数判定>
Pseudoprime numbersTime Limit: 1000MS Memory Limit: 65536KB 64bit IO Format: %lld & %lluSubmit StatusDescriptionFermat's theorem states that for any prime num原创 2016-07-23 13:45:15 · 308 阅读 · 0 评论 -
LightOJ - 1067 数论<100000左右的组合数取模求法《逆元》>
题目链接: LightOJ - 1067 对于组合数取模的问题----数值10e6且询问的次数很多的情况--我们可以通过打表降低时间复杂度先说一下:C(n,m)= n!/(m!*(n-m)!)-----C(n ,m)=(n*(n-1)*....*(n-m+1))/(1*2*..........*m)=(n*(n-1)*(n-2)*....1)/((n-m)*(n-m原创 2016-08-06 21:54:11 · 700 阅读 · 0 评论 -
poj 3070 <矩阵快速幂【模板】求Fibonacci数列>
FibonacciTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 12950 Accepted: 9209DescriptionIn the Fibonacci integer sequence, F0 = 0, F1 = 1, and Fn =原创 2016-07-28 20:24:16 · 395 阅读 · 0 评论 -
hdoj 1575 Tr A 51nod oj 1113 矩阵快速幂【矩阵快速幂】
传送门:1575矩阵快速幂--与一般快速幂一样--代码:#include#include#includeusing namespace std;struct node{ int n; long long shu[12][12]; node operator * (node &b){ node c; c.n=n; for (int i=1;i<=原创 2016-08-12 20:30:07 · 423 阅读 · 0 评论 -
hdoj 5895 Mathematician QSC 【数论----矩阵快速幂求解类斐波那契数列】
Mathematician QSCTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 131072/131072 K (Java/Others)Total Submission(s): 342 Accepted Submission(s): 184Problem DescriptionQSC drea原创 2016-09-21 21:49:05 · 490 阅读 · 0 评论 -
51nod oj 1537 分解 【类斐波那契数列的矩阵求法】
1537 分解基准时间限制:0.5 秒 空间限制:131072 KB 分值: 80 难度:5级算法题 收藏 关注 问(1+sqrt(2)) ^n 能否分解成 sqrt(m) +sqrt(m-1)的形式 如果可以 输出 m%1e9+7 否则 输出noInput一行,一个数n。(nOutput原创 2016-09-28 21:03:52 · 730 阅读 · 0 评论