矩阵快速幂
文章平均质量分 76
Peppermint__
这个作者很懒,什么都没留下…
展开
-
ZOJ 3497 Mistwald 矩阵快速幂
思路:先将二维的坐标转换成一维的坐标,然后用矩阵存储,然后进行pci路径转移。关键点就是不能从出口处转移。#include <string>#include <iostream>#include <cstdio>#include <cstring>using namespace std;const int N = 26;int n,m;...原创 2018-04-22 21:31:43 · 184 阅读 · 0 评论 -
Just Pour the Water ZOJ - 2974 矩阵快速幂
思路:用一个N*N的矩阵的第一行来记录水量。另外一个矩阵记录转移的方式,不是很好描述,具体看代码。当k是0的时候,水量都给了自己。#include <iostream>#include <cstdio>#include <cstring>using namespace std;int n;const int N = 25;struct Matrix ...原创 2018-04-22 21:37:34 · 289 阅读 · 0 评论