摘要: 半小时就写完了代码,提交后,一直是wa,煎熬了两小时后发现,忘了考虑在同一点这一情况#include <stdio.h> #include <memory.h> const int maxn=200000+10; int N,K; int queue[maxn]; int visit[maxn]={0}; int dis[maxn]; int bfs(int N,int K) { int font=0; int rear=0; queue[rear++]=N; visit[N]=1; int tem; while(font<rear) { int w=queue[ 阅读全文
posted @ 2012-05-29 19:06 lishimin_come 阅读(96) 评论(0) 推荐(0) 编辑
摘要: #include <stdio.h> #include <memory.h> const int maxn=40+10; int visit[maxn*maxn]; int map[maxn][maxn]; int m,n; int dir[4][2]={{0,-1},{-1,0},{0,1},{1,0}}; int step1; int step2; void dfs1(int step ,int way,int tem) { int x=tem/n; int y=tem%n; if(map[x][y]=='E'){ step1=step; retur 阅读全文
posted @ 2012-05-29 16:14 lishimin_come 阅读(143) 评论(0) 推荐(0) 编辑