摘要: 题目大意: 给两个正6面体,问二者是否等价,每个面都用6个字母表示; 解题思路: 固定一个面旋转,有四种可能,一共固定6个面; #include #include #include using namespace std;const int N=20;char str[N],str1[N],st... 阅读全文
posted @ 2016-09-22 17:48 hong-ll 阅读(118) 评论(0) 推荐(0) 编辑
摘要: 题目大意: 有n行n列(2#include #include #include #include #include using namespace std;int H[10][10];int V[10][10];int main(){ int n,m,x,y,T = 0; char c; w... 阅读全文
posted @ 2016-09-22 17:11 hong-ll 阅读(110) 评论(0) 推荐(0) 编辑
摘要: 题目大意就是: 一个象棋残局,红方有n(2#include#include#includeusing namespace std;char cb[12][10],ab[12][10];void RG(int a,int b){ //判断帅和车能到达的地方 int c; for(c=a-1;c... 阅读全文
posted @ 2016-09-22 15:31 hong-ll 阅读(124) 评论(0) 推荐(0) 编辑
摘要: Description 依阿华来到镇守府的第一件事情,就是找大和solo!然而这并不是什么好消息,说不定,镇守府,甚至佐伯湾就这么消失了。。。于是,提督君想了一个简单的游戏,来分出她们的胜负。游戏规则如下:这里有N堆石子,每堆石子有a[i](1#include int t, n;bool... 阅读全文
posted @ 2016-04-18 13:34 hong-ll 阅读(158) 评论(0) 推荐(0) 编辑
摘要: /* 题目描述: 给定你一个数n,请你统计出在[a,b]这个区间中和n互质的数的个数。 两个数互质当且仅当他们除了1之外没有其他的公共因子或者他们最大的公共因子是1。1和任何数是互素的。 输入: 第一行输入一个整数T(1 #include#includeusing namespace std;t... 阅读全文
posted @ 2016-04-18 13:25 hong-ll 阅读(988) 评论(0) 推荐(0) 编辑
摘要: —————————————————————————————————————— 先交换偶数列,,在换偶数行这样。。就可以最少的次数算出 阅读全文
posted @ 2016-03-02 19:36 hong-ll 阅读(80) 评论(0) 推荐(0) 编辑
摘要: ———————————————————————————————————————————— 这个题应用了快排。。。虽然题目只要求一遍,但是回了一遍就会了全部的。。。。 先上一遍的。。。。 ———————————————————————————————————————————— #incl... 阅读全文
posted @ 2015-12-29 21:00 hong-ll 阅读(219) 评论(0) 推荐(0) 编辑
摘要: 这个算法可以解决负边,弥补了Dijkstra算法的不足 #include#define N 100#define inf 9999999int main(){ int a[N][N]; int n,m; //n是顶点的数量,m是边的数量 scanf("%d%d",&n,&m); int ... 阅读全文
posted @ 2015-12-28 11:08 hong-ll 阅读(172) 评论(0) 推荐(0) 编辑
摘要: 这个算法是通过边的松弛来进行实现最短路 #include#define N 100#define inf 9999999int main(){ freopen("in.txt","r",stdin); int a[N][N]; int n,m; //n是顶点的数量,m是边的数量 scanf... 阅读全文
posted @ 2015-12-28 11:02 hong-ll 阅读(135) 评论(0) 推荐(0) 编辑
摘要: 这个算法是最短路中最容易理解的一个了,,,,所以一般都是想学习这个 但是这个算法是时间复杂度最高为 n^3,,,,所以如果是竞赛中一般都不会用这一个 先看代码吧.... #include#define N 100#define inf 999999int main(){ int a[N][N]... 阅读全文
posted @ 2015-12-28 10:56 hong-ll 阅读(141) 评论(0) 推荐(0) 编辑