摘要: 简单的矩阵构造题,参看我前几篇的谈到的矩阵的构造法。#include #include #include #include using namespace std;int Mod;struct Matrax { int m[15][15];};Matrax a,per;int ats[15],an[... 阅读全文
posted @ 2014-09-02 16:41 chenjunjie1994 阅读(285) 评论(0) 推荐(0) 编辑
摘要: 可以利用DP的思想来做,不过是在DP时加上了矩阵乘法的思想而已,但乘法不是真的乘法,而是mp[a][i]+mp[i][b]I=0的话,则会一直不动,所以要初始化到I->I=INF;#include #include #include using namespace std;const int inf... 阅读全文
posted @ 2014-09-02 16:04 chenjunjie1994 阅读(206) 评论(0) 推荐(0) 编辑
摘要: 呃,离散数学课上直接就有这样的题#include #include #include using namespace std;const int Mod=1000;struct Matrax { int m[25][25];};Matrax a,per;int n,m;void initial(){... 阅读全文
posted @ 2014-09-02 13:36 chenjunjie1994 阅读(124) 评论(0) 推荐(0) 编辑
摘要: 知道了怎么置换之后,就可以用矩阵来置换了,但这道题一直关于置换的地方读不明白。#include #include #include using namespace std;const int Maxn=100;int pn[Maxn],xn[Maxn],bn[Maxn];int ansp[Maxn]... 阅读全文
posted @ 2014-09-02 10:18 chenjunjie1994 阅读(173) 评论(0) 推荐(0) 编辑
摘要: 利用矩阵来做变换,参考Max大神的思想的,虽然不是同一道题。-----------给定n个点,m个操作,构造O(m+n)的算法输出m个操作后各点的位置。操作有平移、缩放、翻转和旋转这里的操作是对所有点同时进行的。其中翻转是以坐标轴为对称轴进行翻转(两种情况),旋转则以原点为中心。如果对每个点分别进行... 阅读全文
posted @ 2014-09-02 08:51 chenjunjie1994 阅读(207) 评论(0) 推荐(0) 编辑