
矩阵
文章平均质量分 69
yysys
yysys
展开
-
【矩阵快速幂】 HDOJ 5015 233 Matrix
构造矩阵,进行矩阵快速幂即可。。。#include #include #include #include #include #include #include #include #include #include #include #include #include #define maxn 55#define maxm 2000原创 2014-09-18 09:49:26 · 430 阅读 · 0 评论 -
【矩阵快速幂】 HDOJ 4990 Reading comprehension
推出公式,然后用juzh原创 2014-09-09 11:01:18 · 458 阅读 · 0 评论 -
【AC自动机+矩阵快速幂】 POJ 2778 DNA Sequence
先构建AC自动机,然后通过ACzidongji原创 2014-09-30 18:37:00 · 421 阅读 · 0 评论 -
【矩阵】 HDOJ 5097 Page Rank
暴力就行了。。。#include #include #include #include #include #include #include #include #include #include #include #include #include #define maxn 20005#define maxm 4000005#define eps原创 2014-11-03 15:41:53 · 411 阅读 · 0 评论 -
【矩阵快速幂】 Codeforces Round #291 (Div. 2) E. Darth Vader and Tree
附上CF的官方题解。。。It's easy to realize that , wheredp[i] is number of vertices, which are situated on a distancei from the root, and cnt[j] is number of children, which are situated on a distance原创 2015-03-11 18:27:56 · 411 阅读 · 0 评论 -
【矩阵快速幂】 HDOJ 5434 Peace small elephant
对每一列状态压缩,然后矩阵加速即可。。。#include using namespace std;typedef long long LL;const int mod = 1e9+7;const int maxn = 130;LL mat[maxn][maxn];LL mid[maxn][maxn];LL res[maxn][maxn];int n, m;void ca原创 2015-09-16 14:04:13 · 366 阅读 · 0 评论 -
矩阵快速幂 CodeForces - 582B Once Again...
建出转移矩阵...然后做矩阵快速幂就行了....#include using namespace std;typedef long long LL;const int maxn = 105;const int INF = 0x3f3f3f3f;int mat[maxn][maxn];int res[maxn][maxn];int mid[maxn][maxn];int a[原创 2015-10-05 20:34:15 · 1349 阅读 · 0 评论