摘要: 题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1002#include#include#include#includeusing namespace std;int t;char a[1001],b[1001];int sum[2000];int la... 阅读全文
posted @ 2014-02-26 19:22 neverchanje 阅读(276) 评论(0) 推荐(0) 编辑
摘要: 题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1998/*奇数阶幻方的de la loubere方法首先给出幻方的大小n [i,j]所要移动到的位置是[x,y]x=i==1?n:i+1y=j==n?1:j+1if([i,j]所要移动的方向已被占 即map[x,y]!=0) 则x=i==n?1:i-1; if(map[x,y]!=0)//出现这个问题的时候说明已经塞满了 break;i=x;j=y; */#include#includeusing namespace std;const int maxn=25;in... 阅读全文
posted @ 2014-02-26 11:23 neverchanje 阅读(265) 评论(0) 推荐(0) 编辑