摘要: 这道题看了人家的题解的,不过中心思想跟人家不一样我的ACCEPT代码#include "iostream"#include "algorithm"#include "string.h"using namespace std;int set[120],map[120][120],MAX,n,top;int count(){ int total=0,i,j; for(i=1;i>n; for(i=1;i>map[i][j]; } } memset(set,0,sizeof(set)); MAX=0; dfs(0); coutu 阅读全文
posted @ 2013-10-01 16:35 龙城星 阅读(171) 评论(0) 推荐(0) 编辑
摘要: 虽然数据通过了,但是超时这是一定的,那么多循环,发现一个规律,用数组可以省时间,而且少错误我的代码——超时#include "iostream"#include "string.h"#include "algorithm"using namespace std;int map[10][10];int dir[9][2]={{1,1},{1,4},{1,7},{4,1},{4,4},{4,7},{7,1},{7,4},{7,7}};bool chang(){ int set[10],set1[10],set2[10],i,j; mems 阅读全文
posted @ 2013-10-01 14:31 龙城星 阅读(194) 评论(0) 推荐(0) 编辑