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 一个西瓜 阅读(143) 评论(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 一个西瓜 阅读(158) 评论(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 一个西瓜 阅读(316) 评论(0) 推荐(0)

导航