2013年4月21日
摘要: #include #include #include #include using namespace std;#define M 105typedef struct Node{ int row,col,step,f_row,f_col,count; friend bool operator b.step; }} Node;const int move[4][2]={{-1,0},{1,0},{0,-1},{0,1}};char map[M][M];int n,m,sum;priority_queue Q;queue __Q;stack S,__S;void __cle... 阅读全文
posted @ 2013-04-21 20:03 lk1993 阅读(243) 评论(0) 推荐(0) 编辑
摘要: #include #include #include #include #define M 8char map[M][M];int move[4][2]={{-1,0},{1,0},{0,-1},{0,1}};int n,m,sx,sy,ex,ey,t,flag,count;void init(){ for(int i=0;i=0 && row=0 && col t-step) return; for(int i=0;i<4;i++) { int _row=row+move[i][0]; int _col=col+move[i]... 阅读全文
posted @ 2013-04-21 13:48 lk1993 阅读(139) 评论(0) 推荐(0) 编辑
摘要: #include #include #define M 12int map[M][M],n,sum;int ini[M];int jud(int row,int col){ for(int i=1;in) { sum++; return ; } for(int i=1;i<=n;i++) { map[row][i]=1; if(jud(row,i)) dfs(row+1); map[row][i]=0; }}int main(int argc, char *argv[]){ #... 阅读全文
posted @ 2013-04-21 13:33 lk1993 阅读(204) 评论(0) 推荐(0) 编辑
  2013年4月20日
摘要: 1 #include 2 #include 3 4 #define M 21 5 6 int id[M],jud[M],n; 7 8 int is_prime(int n) 9 {10 for(int i=2;i*i=n)27 {28 show(); return ;29 }30 for(int i=1;i<=n;i++)31 {32 if(!jud[i] && is_prime(m+i))33 {34 id[cr+1]=i;35 ju... 阅读全文
posted @ 2013-04-20 22:13 lk1993 阅读(140) 评论(0) 推荐(0) 编辑