随笔分类 - 数论——矩阵乘法
摘要:T1 数学老师的报复 T1 数学老师的报复 矩阵快速幂模板,类似于菲波那切数列的矩阵 [1,1]*[A,1 B,0] 1 #include <cstdio> 2 3 #define LL long long 4 inline void read(LL &x) 5 { 6 x=0; register
阅读全文
摘要:https://www.51nod.com/onlineJudge/questionCode.html#!problemId=1242 基准时间限制:1 秒 空间限制:131072 KB 分值: 0 难度:基础题 收藏 关注 https://www.51nod.com/onlineJudge/que
阅读全文
摘要:https://www.51nod.com/onlineJudge/questionCode.html#!problemId=1113 基准时间限制:3 秒 空间限制:131072 KB 分值: 40 难度:4级算法题 收藏 关注 https://www.51nod.com/onlineJudge/
阅读全文
摘要:T1 斐波那契数列+斐波那契公约数+n<=10^18 1 #include <cstdio> 2 3 #define LL long long 4 const LL mod(1000000007); 5 6 inline void read(LL &x) 7 { 8 x=0; register ch
阅读全文
摘要:https://www.luogu.org/problem/show?pid=1962 题目背景 大家都知道,斐波那契数列是满足如下性质的一个数列: • f(1) = 1 • f(2) = 1 • f(n) = f(n-1) + f(n-2) (n ≥ 2 且 n 为整数) 题目描述 请你求出 f(
阅读全文