随笔分类 -  搜索

摘要:dfs+奇偶剪枝,关键在于奇偶剪枝的应用#include <iostream> #include <stdio.h> using namespace std; char s[10][10]; int vis[10][10]; int d[4][2]={{0,1},{0,-1},{1,0},{-1,0}}; int fx,fy; int n,m,t; int flag; void dfs(int sx,int sy,int step) { int i; if((t-step)%2!=(sx+sy+fx+fy)%2) return;//奇偶性剪枝 if(step==t) . 阅读全文
posted @ 2013-02-26 20:22 LJ_COME!!!!! 阅读(127) 评论(0) 推荐(0)
摘要:我草!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!靠!以后一定要注意注意判断语句的先后顺序,因为粗心,无数次re,居然调了四个小时,时间啊,心疼#include <iostream> #include <cstdio> #include <queue> using namespace std; const int maxn=200; int dis[maxn*maxn+10],m,n,map[maxn][maxn],loc[maxn*maxn+10],p 阅读全文
posted @ 2012-12-25 18:10 LJ_COME!!!!! 阅读(113) 评论(0) 推荐(0)