1 #include 2 #include 3 4 using namespace std; 5 6 long long tmp[11]; 7 8 //矩阵大小上限 9 const int SIZ=100; 10 int MOD=10000007; 11 12 //矩...
分类:
其他好文 时间:
2015-07-27 12:44:43
阅读次数:
148
1 #include 2 #include 3 4 using namespace std; 5 6 //矩阵大小上限 7 const int SIZ=100; 8 int MOD; 9 10 //矩阵大小为n*m,初始化全部为0 11 struct mat 12 { ...
分类:
其他好文 时间:
2015-07-26 17:19:11
阅读次数:
150
http://poj.org/problem?id=3070直接用矩阵快速幂得到f(n)然后输出后四位即可。 1 #include 2 typedef long long ll; 3 const int mod = 10000; 4 struct Mat 5 { 6 ll matrix[2...
分类:
其他好文 时间:
2015-07-25 10:37:37
阅读次数:
119
前天看到该组中,网络游戏的快速启动,第一个我觉得不错的度假曼城。它不是因工作原因啊。哈哈那种感觉度日如年。说实话出时间来了解。 上一张ACM网络赛时间表赛区(官方站点)邀请赛网络赛现场赛备注牡丹江赛区牡丹江师范学院9.7 12:00~17:00 在HDOJ举行浙江大学命题10.11~12浙江大...
分类:
其他好文 时间:
2015-07-23 19:34:47
阅读次数:
164
矩阵快速幂#include#include#include#include#includeusing namespace std;const long long MOD=1000000000+7;long long n,k,RR,CC;mapans;struct Matrix{ long lo...
分类:
其他好文 时间:
2015-07-22 17:59:46
阅读次数:
83
矩阵快速幂。先构造邻接矩阵,这个矩阵的K次方,就表示从从i到j有几种走法。#include#include#include#includeusing namespace std;int n,m;const int maxn=20;const int MOD=1000;struct Matrix{ ....
分类:
其他好文 时间:
2015-07-21 20:28:01
阅读次数:
118
矩阵快速幂#include#include#include#includeusing namespace std;long long a,b,n,m;int R,C;struct Matrix{ long long A[5][5]; Matrix operator*(Matrix b);...
分类:
其他好文 时间:
2015-07-21 12:22:40
阅读次数:
87
矩阵快速幂#include#include#include#includeusing namespace std;struct Matrix{ long long A[10][10]; Matrix operator*(Matrix b);};const long long MOD=10...
分类:
其他好文 时间:
2015-07-20 21:03:32
阅读次数:
128
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1757题意不难理解,当x小于10的时候,数列f(x)=x,当x大于等于10的时候f(x) = a0 * f(x-1) + a1 * f(x-2) + a2 * f(x-3) + …… + a9 * f(x...
分类:
其他好文 时间:
2015-07-20 20:56:58
阅读次数:
155
题目链接:戳我题目大意:一个函数 f(x) 当 x= 10 时,f(x) = a0 * f(x-1) + a1 * f(x-2) + a2 * f(x-3) + …… + a9 * f(x-10);给 k 和 m,求 f(k) % m的值样例解释:略解题思路:用矩阵快速幂,建立A 矩阵为 10 * ...
分类:
其他好文 时间:
2015-07-20 20:56:44
阅读次数:
186