上一页 1 ··· 3 4 5 6 7 8 9 10 11 ··· 20 下一页

2014年10月30日

Hdu2855Fibonacci Check-up矩阵

摘要: 转个图。或者打表找的规律是 g[n] = 3*g[n-1] - g[n-2];构造个 3 -1 的矩阵然后搞下就好了。 1 0 #include #include #include #include typedef long long LL;using namespace std;LL mod... 阅读全文

posted @ 2014-10-30 20:07 一个西瓜 阅读(145) 评论(0) 推荐(0)

2014年10月29日

Hdu2276Kiki & Little Kiki 2矩阵

摘要: ai = (ai-1 + ai) %2 然后构造个 n*n的矩阵A, 时间K之后的状态就是 A^k * B(给出的字符串)#include #include #include #include typedef long long LL;using namespace std;int n;struct... 阅读全文

posted @ 2014-10-29 16:00 一个西瓜 阅读(144) 评论(0) 推荐(0)

Hdu2807The Shortest Path矩阵

摘要: 矩阵相乘,判断之后建图。 注意 A B C三个互不相同的城市#include #include #include #include typedef long long LL;using namespace std;const int INF = 0xfffffff;struct Matrix{... 阅读全文

posted @ 2014-10-29 14:23 一个西瓜 阅读(160) 评论(0) 推荐(0)

zoj3497Mistwald矩阵

摘要: 判断i到j 是否k步可达。#include #include #include #include typedef long long LL;using namespace std;int n;int x[100], y[100];struct Matrix{ int m[40][40];... 阅读全文

posted @ 2014-10-29 13:19 一个西瓜 阅读(317) 评论(0) 推荐(0)

2014年10月28日

Hdu3233Matrix Power Series矩阵

摘要: 前面就做过了。。。二分搞下#include #include #include #include typedef long long LL;using namespace std;int n, M;struct Matrix{ int m[40][40];};Matrix Mul(Matrix... 阅读全文

posted @ 2014-10-28 22:44 一个西瓜 阅读(246) 评论(0) 推荐(0)

Hdu1575Tr A矩阵

摘要: 矩阵快速幂,就是快速幂的乘法变成矩阵乘法,其余的都一样。#include #include #include #include using namespace std;const int mod = 9973;const int maxn = 12;struct Matrix{ int m[m... 阅读全文

posted @ 2014-10-28 22:22 一个西瓜 阅读(197) 评论(0) 推荐(0)

Hdu2157How many ways??矩阵

摘要: 给定一个有向图,问从A点恰好走k步(允许重复经过边)到达B点的方案数mod p的值。详见matrix67博客http://www.matrix67.com/blog/archives/276#include #include #include #include typedef long long L... 阅读全文

posted @ 2014-10-28 22:20 一个西瓜 阅读(142) 评论(0) 推荐(0)

Hdu 1757A Simple Math Problem矩阵

摘要: 构造个矩阵搞下就行了a0 a1 a2 a3 a4 a5 a6 a7 a8 a91 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 00 0 0 1 0 0 0 0 0 00 0 0 0 1 ... 阅读全文

posted @ 2014-10-28 22:00 一个西瓜 阅读(115) 评论(0) 推荐(0)

Hdu1588Gauss Fibonacci矩阵

摘要: 题意:求g(i)=k*i+b; f(g(i)) for 0#include #include #include typedef long long LL;LL M;using namespace std;struct Matrix{ LL m[4][4];};Matrix Mul(Matrix... 阅读全文

posted @ 2014-10-28 18:42 一个西瓜 阅读(184) 评论(0) 推荐(0)

2014年10月25日

Hdu3966( Aragorn's Story ) 树链剖分

摘要: 点更新树链剖分入门题,诶 错了好多发,提到同一点时没更新,边数组开小了一倍。#include #include #include #include using namespace std;#define lson l,mid,rt size[son[x]]) son[x] = cc; }}vo... 阅读全文

posted @ 2014-10-25 16:46 一个西瓜 阅读(271) 评论(0) 推荐(0)

上一页 1 ··· 3 4 5 6 7 8 9 10 11 ··· 20 下一页

导航